difforig Devel-Caller-0.11-61Nuzd

2007-12-26  Reini Urban <rurban@x-ray.at>
	* 5.10 also not no ithread-safe
	* Fix "cast to pointer from integer of different size" warnings for use64bitint

diff -ub  Devel-Caller-0.11-61Nuzd/lib/Devel/Caller.xs.orig
--- Devel-Caller-0.11-61Nuzd/lib/Devel/Caller.xs.orig	2007-12-26 16:16:43.796875000 +0000
+++ Devel-Caller-0.11-61Nuzd/lib/Devel/Caller.xs	2007-12-26 16:32:34.921875000 +0000
@@ -32,8 +32,8 @@
 	   sigil, op, PL_defgv, gv, want_name, cPADOPx(op)->op_padix );
 #endif
 
-#if defined(USE_ITHREADS) && (PERL_VERSION == 8)
-    /* for 5.8 gv will be garbage causing a segfault. bah */
+#if defined(USE_ITHREADS) && (PERL_VERSION >= 8)
+    /* for 5.8++ gv will be garbage causing a segfault. bah */
     if (want_name) {
 	return sv_2mortal(newSVpvf(""));
     }
@@ -78,7 +78,7 @@
 #if WORK_DAMN_YOU
 	    printf("SCAN PUSH %x\n", op);
 #endif
-	    av_push( markstack, sv_2mortal(newSViv( (IV) op)) );
+	    av_push( markstack, sv_2mortal(newSViv( PTR2IV(op) )));
 	    break;
 	    /* ops that consume marks */
 #if WORK_DAMN_YOU
@@ -94,7 +94,7 @@
 #endif
     
     sv = av_pop(markstack);
-    return (OP*) SvIV(sv);
+    return INT2PTR(OP*, SvIV(sv));
 }
 
 
@@ -106,7 +106,7 @@
 SV *cv_ref;
 I32 want_names;
   PREINIT:
-    PERL_CONTEXT* cx = (PERL_CONTEXT*) SvIV(context);
+    PERL_CONTEXT* cx = INT2PTR(PERL_CONTEXT*, SvIV(context));
     CV *cv      = SvROK(cv_ref) ? (CV*) SvRV(cv_ref) : 0;
     AV* padn    = cv ? (AV*) AvARRAY(CvPADLIST(cv))[0] : PL_comppad_name;
     AV* padv    = cv ? (AV*) AvARRAY(CvPADLIST(cv))[1] : PL_comppad;
@@ -222,7 +222,7 @@
 _context_cv(context)
 SV* context;
   CODE:
-    PERL_CONTEXT *cx = (PERL_CONTEXT*) SvIV(context);
+    PERL_CONTEXT *cx = INT2PTR(PERL_CONTEXT*, SvIV(context));
     CV *cur_cv;
 
     if (cx->cx_type != CXt_SUB)
@@ -242,7 +242,7 @@
 SV* context;
 PPCODE:
 {
-    PERL_CONTEXT* cx = (PERL_CONTEXT*) SvIV(context);
+    PERL_CONTEXT* cx = INT2PTR(PERL_CONTEXT*, SvIV(context));
     OP* op, *prev_op;
 
     op = cx->blk_oldcop->op_next;