View Single Post
  #1  
Old 02-04-2013, 12:56 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default perl_mob.cpp return type fixes

corrected a few signed/unsigned mismatches

Code:
Index: perl_mob.cpp
===================================================================
--- perl_mob.cpp	(revision 2481)
+++ perl_mob.cpp	(working copy)
@@ -664,7 +664,7 @@
 		Perl_croak(aTHX_ "Usage: Mob::GetEquipment(THIS, material_slot)");
 	{
 		Mob *		THIS;
-		int32		RETVAL;
+		uint32		RETVAL;
 		dXSTARG;
 		uint8		material_slot = (uint8)SvUV(ST(1));
 
@@ -678,7 +678,7 @@
 			Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");
 
 		RETVAL = THIS->GetEquipment(material_slot);
-		XSprePUSH; PUSHi((IV)RETVAL);
+		XSprePUSH; PUSHi((UV)RETVAL);
 	}
 	XSRETURN(1);
 }
@@ -718,7 +718,7 @@
 		Perl_croak(aTHX_ "Usage: Mob::GetEquipmentColor(THIS, material_slot)");
 	{
 		Mob *		THIS;
-		int32		RETVAL;
+		uint32		RETVAL;
 		dXSTARG;
 		uint8		material_slot = (uint8)SvUV(ST(1));
 
@@ -732,7 +732,7 @@
 			Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");
 
 		RETVAL = THIS->GetEquipmentColor(material_slot);
-		XSprePUSH; PUSHi((IV)RETVAL);
+		XSprePUSH; PUSHi((UV)RETVAL);
 	}
 	XSRETURN(1);
 }
@@ -745,7 +745,7 @@
 		Perl_croak(aTHX_ "Usage: Mob::GetArmorTint(THIS, material_slot)");
 	{
 		Mob *		THIS;
-		int32		RETVAL;
+		uint32		RETVAL;
 		dXSTARG;
 		uint8		material_slot = (uint8)SvUV(ST(1));
 
@@ -759,7 +759,7 @@
 			Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");
 
 		RETVAL = THIS->GetArmorTint(material_slot);
-		XSprePUSH; PUSHi((IV)RETVAL);
+		XSprePUSH; PUSHi((UV)RETVAL);
 	}
 	XSRETURN(1);
 }
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote