develooper Front page | perl.perl5.porters | Postings from October 2001

[PATCH] Fix sharedsv.c compile-time warnings.

From:
Richard Soderberg
Date:
October 25, 2001 20:43
Subject:
[PATCH] Fix sharedsv.c compile-time warnings.
Message ID:
NAEKLNAAHLMBPMPNBMLEKEJCEAAA.rs@crystalflame.net
`sh  cflags "optimize='-g'" libperl.a sharedsv.o`  sharedsv.c
          CCCMD =

cc -DPERL_CORE -c -D_REENTRANT -DDEBUGGING -fno-strict-aliasing -I/home/
coral/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -Wall
sharedsv.c: In function `Perl_sharedsv_find':
sharedsv.c:98: warning: cast to pointer from integer of different size
sharedsv.c:106: warning: cast to pointer from integer of different size

Patch included, attached.  I took the INT2PTR routine from elsewhere in
this file.

R.

--- sharedsv.c~	Thu Oct 25 07:22:18 2001
+++ sharedsv.c	Thu Oct 25 23:53:32 2001
@@ -95,7 +95,7 @@
             if(mg) {
 	        if(strcmp(mg->mg_ptr,"threads::shared"))
                     break;
-                ssv = (shared_sv*) SvIV(mg->mg_obj);
+                ssv = INT2PTR(shared_sv *, SvIV(mg->mg_obj));
 	        break;
              }

@@ -103,7 +103,7 @@
              if(mg) {
                  SV* obj = SvTIED_obj(sv,mg);
 	         if(sv_derived_from(obj, "threads::shared"))
-		     ssv = (shared_sv*) SvIV(SvRV(obj));
+		     ssv = INT2PTR(shared_sv *, SvIV(SvRV(obj)));
                  break;
              }
 	}




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About