View Single Post
  #1  
Old 09-25-2013, 11:39 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default Perl Doors Fix -- GetIncline and SetIncline

Incline is allowed to be negative and the Perl only allows uint32.

There is a minor typo fix in this as well... the "Usage example" for GetSize ..said "GetIncline" so just changed it.



Code:
@@ -332,7 +332,7 @@
 		Perl_croak(aTHX_ "Usage: Doors::GetIncline(THIS)");
 	{
 		Doors *		THIS;
-		uint32		RETVAL;
+		int32		    RETVAL;
 		dXSTARG;
 
 		if (sv_derived_from(ST(0), "Doors")) {
@@ -345,7 +345,7 @@
 			Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
 
 		RETVAL = THIS->GetIncline();
-		XSprePUSH; PUSHu((UV)RETVAL);
+		XSprePUSH; PUSHi((IV)RETVAL);
 	}
 	XSRETURN(1);
 }
@@ -355,7 +355,7 @@
 {
 	dXSARGS;
 	if (items != 1)
-		Perl_croak(aTHX_ "Usage: Doors::GetIncline(THIS)");
+		Perl_croak(aTHX_ "Usage: Doors::GetSize(THIS)");
 	{
 		Doors *		THIS;
 		uint32		RETVAL;
@@ -482,7 +482,7 @@
 		Perl_croak(aTHX_ "Usage: Doors::SetIncline(THIS, type)");
 	{
 		Doors *		THIS;
-		uint32		type = (uint32)SvUV(ST(1));
+		int32		type = (int32)SvIV(ST(1));
 
 		if (sv_derived_from(ST(0), "Doors")) {
 			IV tmp = SvIV((SV*)SvRV(ST(0)));
Reply With Quote