Change 16532 by jhi@alpha on 2002/05/10 03:38:40

        Subject: [PATCH] format and other warnings
        From: Robin Barker <[EMAIL PROTECTED]>
        Date: Thu, 9 May 2002 18:27:30 +0100 (BST)
        Message-Id: <[EMAIL PROTECTED]>  

Affected files ...

.... //depot/perl/Porting/pumpkin.pod#38 edit
.... //depot/perl/ext/Encode/Encode.xs#89 edit
.... //depot/perl/ext/Encode/Unicode/Unicode.xs#6 edit
.... //depot/perl/ext/Storable/Storable.xs#50 edit
.... //depot/perl/ext/Time/HiRes/HiRes.xs#31 edit
.... //depot/perl/ext/threads/shared/shared.xs#25 edit
.... //depot/perl/ext/threads/threads.xs#43 edit

Differences ...

==== //depot/perl/Porting/pumpkin.pod#38 (text) ====
Index: perl/Porting/pumpkin.pod
--- perl/Porting/pumpkin.pod#37~15129~  Sat Mar  9 08:01:00 2002
+++ perl/Porting/pumpkin.pod    Thu May  9 20:38:40 2002
@@ -755,7 +755,7 @@
 
     make clean
     make miniperl      
-    make all OPTIMIZE=-DCHECK_FORMAT >& make.log  
+    make all OPTIMIZE='-DCHECK_FORMAT -Wformat' >& make.log  
                
 =item *
 

==== //depot/perl/ext/Encode/Encode.xs#89 (text) ====
Index: perl/ext/Encode/Encode.xs
--- perl/ext/Encode/Encode.xs#88~16460~ Tue May  7 16:42:42 2002
+++ perl/ext/Encode/Encode.xs   Thu May  9 20:38:40 2002
@@ -80,7 +80,7 @@
        goto ENCODE_END;
     }
 
-    while (code = do_encode(dir, s, &slen, d, dlen, &dlen, !check))
+    while( (code = do_encode(dir, s, &slen, d, dlen, &dlen, !check)) ) 
     {
        SvCUR_set(dst, dlen+ddone);
        SvPOK_only(dst);
@@ -172,14 +172,14 @@
            else {
                if (check & ENCODE_DIE_ON_ERR){
                    Perl_croak(aTHX_ ERR_DECODE_NOMAP,
-                              PTR2UV(enc->name[0]), (U8)s[slen]);
+                              enc->name[0], (UV)s[slen]);
                    return &PL_sv_undef; /* never reaches but be safe */
                }
                if (check & ENCODE_WARN_ON_ERR){
                    Perl_warner(
                        aTHX_ packWARN(WARN_UTF8),
                        ERR_DECODE_NOMAP,
-                       PTR2UV(enc->name[0]), (U8)s[slen]);
+                               enc->name[0], (UV)s[slen]);
                }
                if (check & ENCODE_RETURN_ON_ERR){
                    goto ENCODE_SET_SRC;

==== //depot/perl/ext/Encode/Unicode/Unicode.xs#6 (text) ====
Index: perl/ext/Encode/Unicode/Unicode.xs
--- perl/ext/Encode/Unicode/Unicode.xs#5~16177~ Thu Apr 25 19:33:19 2002
+++ perl/ext/Encode/Unicode/Unicode.xs  Thu May  9 20:38:40 2002
@@ -212,7 +212,7 @@
            if (!issurrogate(ord)){
                if (ucs2) {
                    if (check) {
-                       croak("%s:code point \"\\x{"UVxf"}\" too high",
+                       croak("%s:code point \"\\x{%"UVxf"}\" too high",
                              SvPV_nolen(
                                  *hv_fetch((HV *)SvRV(obj),"Name",4,0))
                              ,ord);

==== //depot/perl/ext/Storable/Storable.xs#50 (text) ====
Index: perl/ext/Storable/Storable.xs
--- perl/ext/Storable/Storable.xs#49~16518~     Thu May  9 02:04:31 2002
+++ perl/ext/Storable/Storable.xs       Thu May  9 20:38:40 2002
@@ -378,7 +378,7 @@
 
 #define dSTCXT_PTR(T,name)                                                     \
        T name = ((perinterp_sv && SvIOK(perinterp_sv) && SvIVX(perinterp_sv)   \
-                               ? (T)SvPVX(SvRV((SV*)SvIVX(perinterp_sv))) : (T) 0))
+                               ? (T)SvPVX(SvRV(INT2PTR(SV*,SvIVX(perinterp_sv)))) : 
+(T) 0))
 #define dSTCXT                                                                        
 \
        dSTCXT_SV;                                                                     
         \
        dSTCXT_PTR(stcxt_t *, cxt)

==== //depot/perl/ext/Time/HiRes/HiRes.xs#31 (text) ====
Index: perl/ext/Time/HiRes/HiRes.xs
--- perl/ext/Time/HiRes/HiRes.xs#30~16507~      Wed May  8 16:48:12 2002
+++ perl/ext/Time/HiRes/HiRes.xs        Thu May  9 20:38:40 2002
@@ -746,7 +746,7 @@
        struct itimerval oldit;
     PPCODE:
        if (seconds < 0.0 || interval < 0.0)
-           croak("Time::HiRes::setitimer(%"IVdf", %"NVgf", %"NVgf"): negative time 
not invented yet", which, seconds, interval);
+           croak("Time::HiRes::setitimer(%"IVdf", %"NVgf", %"NVgf"): negative time 
+not invented yet", (IV)which, seconds, interval);
        newit.it_value.tv_sec  = seconds;
        newit.it_value.tv_usec =
          (seconds  - (NV)newit.it_value.tv_sec)    * 1000000.0;

==== //depot/perl/ext/threads/shared/shared.xs#25 (text) ====
Index: perl/ext/threads/shared/shared.xs
--- perl/ext/threads/shared/shared.xs#24~16210~ Sat Apr 27 05:56:44 2002
+++ perl/ext/threads/shared/shared.xs   Thu May  9 20:38:40 2002
@@ -262,7 +262,7 @@
 
     /* Try shared SV as 1st choice */
     if (!data && ssv && SvTYPE(ssv) >= SVt_PVMG) {
-       if (mg = mg_find(ssv, PERL_MAGIC_ext)) {
+       if( (mg = mg_find(ssv, PERL_MAGIC_ext)) ){
            data = (shared_sv *) mg->mg_ptr;
        }
     }
@@ -916,7 +916,7 @@
        shared_sv *shared;
        if(SvROK(ref))
            ref = SvRV(ref);
-       if (shared = Perl_sharedsv_find(aTHX_ ref)) {
+       if( (shared = Perl_sharedsv_find(aTHX_ ref)) ){
            ST(0) = sv_2mortal(newSViv(PTR2IV(shared)));
            XSRETURN(1);
        }
@@ -930,17 +930,17 @@
        shared_sv *shared;
        if(SvROK(ref))
            ref = SvRV(ref);
-       if (shared = Perl_sharedsv_find(aTHX_ ref)) {
+       if( (shared = Perl_sharedsv_find(aTHX_ ref)) ){
          if (SHAREDSvPTR(shared)) {
            ST(0) = sv_2mortal(newSViv(SvREFCNT(SHAREDSvPTR(shared))));
            XSRETURN(1);
          }
          else {
-            Perl_warn(aTHX_ "%_ s=%p has no shared SV",ST(0),shared);
+            Perl_warn(aTHX_ "%" SVf " s=%p has no shared SV",ST(0),shared);
          }
        }
        else {
-            Perl_warn(aTHX_ "%_ is not shared",ST(0));
+            Perl_warn(aTHX_ "%" SVf " is not shared",ST(0));
        }
        XSRETURN_UNDEF;
 

==== //depot/perl/ext/threads/threads.xs#43 (xtext) ====
Index: perl/ext/threads/threads.xs
--- perl/ext/threads/threads.xs#42~16314~       Wed May  1 12:15:26 2002
+++ perl/ext/threads/threads.xs Thu May  9 20:38:40 2002
@@ -143,7 +143,8 @@
     int veto_cleanup = 0;
     MUTEX_LOCK(&create_destruct_mutex);
     if (aTHX == PL_curinterp && active_threads != 1) {
-       Perl_warn(aTHX_ "Cleanup skipped %d active threads", active_threads);
+       Perl_warn(aTHX_ "Cleanup skipped %" IVdf " active threads",
+                                               (IV)active_threads);
        veto_cleanup = 1;
     }
     MUTEX_UNLOCK(&create_destruct_mutex);
@@ -279,7 +280,7 @@
                }
                PUTBACK;
                if (SvTRUE(ERRSV)) {
-                   Perl_warn(aTHX_ "Died:%_",ERRSV);
+                   Perl_warn(aTHX_ "Died:%" SVf,ERRSV);
                }
                FREETMPS;
                LEAVE;
@@ -467,7 +468,7 @@
   }
  else
   {
-   Perl_warn(aTHX_ "CLONE %_",obj);
+   Perl_warn(aTHX_ "CLONE %" SVf,obj);
   }
 }
 
End of Patch.

Reply via email to