EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Bug Reports (https://www.eqemulator.org/forums/forumdisplay.php?f=591)
-   -   perl_mob.cpp return type fixes (https://www.eqemulator.org/forums/showthread.php?t=36410)

c0ncrete 02-04-2013 12:56 AM

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);
 }



All times are GMT -4. The time now is 05:26 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.