Change 13764 by jhi@alpha on 2001/12/18 20:58:44

        %g -> NVgf cleanup, based on Schwern's RedHat 7.1/Alpha
        findings -- some of the warnings I can't explain except
        by NVgf being detected wrong, though.

Affected files ...

.... //depot/perl/dump.c#104 edit
.... //depot/perl/pp.c#323 edit
.... //depot/perl/sv.c#499 edit
.... //depot/perl/x2p/a2p.h#16 edit
.... //depot/perl/x2p/str.c#13 edit

Differences ...

==== //depot/perl/dump.c#104 (text) ====
Index: perl/dump.c
--- perl/dump.c.~1~     Tue Dec 18 14:15:05 2001
+++ perl/dump.c Tue Dec 18 14:15:05 2001
@@ -285,7 +285,7 @@
     }
     else if (SvNOKp(sv)) {
        STORE_NUMERIC_LOCAL_SET_STANDARD();
-       Perl_sv_catpvf(aTHX_ t, "(%g)",SvNVX(sv));
+       Perl_sv_catpvf(aTHX_ t, "(%"NVgf")",SvNVX(sv));
        RESTORE_NUMERIC_LOCAL();
     }
     else if (SvIOKp(sv)) {

==== //depot/perl/pp.c#323 (text) ====
Index: perl/pp.c
--- perl/pp.c.~1~       Tue Dec 18 14:15:05 2001
+++ perl/pp.c   Tue Dec 18 14:15:05 2001
@@ -2627,7 +2627,7 @@
       value = POPn;
       if (value <= 0.0) {
        SET_NUMERIC_STANDARD();
-       DIE(aTHX_ "Can't take log of %g", value);
+       DIE(aTHX_ "Can't take log of %"NVgf, value);
       }
       value = Perl_log(value);
       XPUSHn(value);
@@ -2643,7 +2643,7 @@
       value = POPn;
       if (value < 0.0) {
        SET_NUMERIC_STANDARD();
-       DIE(aTHX_ "Can't take sqrt of %g", value);
+       DIE(aTHX_ "Can't take sqrt of %"NVgf, value);
       }
       value = Perl_sqrt(value);
       XPUSHn(value);

==== //depot/perl/sv.c#499 (text) ====
Index: perl/sv.c
--- perl/sv.c.~1~       Tue Dec 18 14:15:05 2001
+++ perl/sv.c   Tue Dec 18 14:15:05 2001
@@ -1941,7 +1941,7 @@
 STATIC int
 S_sv_2iuv_non_preserve(pTHX_ register SV *sv, I32 numtype)
 {
-    DEBUG_c(PerlIO_printf(Perl_debug_log,"sv_2iuv_non '%s', IV=0x%"UVxf" NV=%g 
inttype=%"UVXf"\n", SvPVX(sv), SvIVX(sv), SvNVX(sv), (UV)numtype));
+    DEBUG_c(PerlIO_printf(Perl_debug_log,"sv_2iuv_non '%s', IV=0x%"UVxf" NV=%"NVgf" 
+inttype=%"UVXf"\n", SvPVX(sv), SvIVX(sv), SvNVX(sv), (UV)numtype));
     if (SvNVX(sv) < (NV)IV_MIN) {
        (void)SvIOKp_on(sv);
        (void)SvNOK_on(sv);
@@ -2195,7 +2195,7 @@
            DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2iv(%" PERL_PRIgldbl 
")\n",
                                  PTR2UV(sv), SvNVX(sv)));
 #else
-           DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2iv(%g)\n",
+           DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2iv(%"NVgf")\n",
                                  PTR2UV(sv), SvNVX(sv)));
 #endif
 
@@ -2251,7 +2251,7 @@
                        this NV is in the preserved range, therefore: */
                     if (!(U_V(SvNVX(sv) > 0 ? SvNVX(sv) : -SvNVX(sv))
                           < (UV)IV_MAX)) {
-                        Perl_croak(aTHX_ "sv_2iv assumed (U_V(fabs(SvNVX(sv))) < 
(UV)IV_MAX) but SvNVX(sv)=%g U_V is 0x%"UVxf", IV_MAX is 0x%"UVxf"\n", SvNVX(sv), 
U_V(SvNVX(sv)), (UV)IV_MAX);
+                        Perl_croak(aTHX_ "sv_2iv assumed (U_V(fabs(SvNVX(sv))) < 
+(UV)IV_MAX) but SvNVX(sv)=%"NVgf" U_V is 0x%"UVxf", IV_MAX is 0x%"UVxf"\n", 
+SvNVX(sv), U_V(SvNVX(sv)), (UV)IV_MAX);
                     }
                 } else {
                     /* IN_UV NOT_INT
@@ -2483,7 +2483,7 @@
             DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2uv(%" PERL_PRIgldbl 
")\n",
                                   PTR2UV(sv), SvNVX(sv)));
 #else
-            DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2uv(%g)\n",
+            DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%"UVxf" 2uv(%"NVgf")\n",
                                   PTR2UV(sv), SvNVX(sv)));
 #endif
 
@@ -2538,7 +2538,7 @@
                        this NV is in the preserved range, therefore: */
                     if (!(U_V(SvNVX(sv) > 0 ? SvNVX(sv) : -SvNVX(sv))
                           < (UV)IV_MAX)) {
-                        Perl_croak(aTHX_ "sv_2uv assumed (U_V(fabs(SvNVX(sv))) < 
(UV)IV_MAX) but SvNVX(sv)=%g U_V is 0x%"UVxf", IV_MAX is 0x%"UVxf"\n", SvNVX(sv), 
U_V(SvNVX(sv)), (UV)IV_MAX);
+                        Perl_croak(aTHX_ "sv_2uv assumed (U_V(fabs(SvNVX(sv))) < 
+(UV)IV_MAX) but SvNVX(sv)=%"NVgf" U_V is 0x%"UVxf", IV_MAX is 0x%"UVxf"\n", 
+SvNVX(sv), U_V(SvNVX(sv)), (UV)IV_MAX);
                     }
                 } else
                     sv_2iuv_non_preserve (sv, numtype);
@@ -2634,7 +2634,7 @@
 #else
        DEBUG_c({
            STORE_NUMERIC_LOCAL_SET_STANDARD();
-           PerlIO_printf(Perl_debug_log, "0x%"UVxf" num(%g)\n",
+           PerlIO_printf(Perl_debug_log, "0x%"UVxf" num(%"NVgf")\n",
                          PTR2UV(sv), SvNVX(sv));
            RESTORE_NUMERIC_LOCAL();
        });
@@ -2763,7 +2763,7 @@
 #else
     DEBUG_c({
        STORE_NUMERIC_LOCAL_SET_STANDARD();
-       PerlIO_printf(Perl_debug_log, "0x%"UVxf" 1nv(%g)\n",
+       PerlIO_printf(Perl_debug_log, "0x%"UVxf" 1nv(%"NVgf")\n",
                      PTR2UV(sv), SvNVX(sv));
        RESTORE_NUMERIC_LOCAL();
     });
@@ -5936,7 +5936,7 @@
            DEBUG_c(PerlIO_printf(Perl_debug_log,"sv_inc punt failed to convert '%s' 
to IOK or NOKp, UV=0x%"UVxf" NV=%"PERL_PRIgldbl"\n",
                                  SvPVX(sv), SvIVX(sv), SvNVX(sv)));
 #else
-           DEBUG_c(PerlIO_printf(Perl_debug_log,"sv_inc punt failed to convert '%s' 
to IOK or NOKp, UV=0x%"UVxf" NV=%g\n",
+           DEBUG_c(PerlIO_printf(Perl_debug_log,"sv_inc punt failed to convert '%s' 
+to IOK or NOKp, UV=0x%"UVxf" NV=%"NVgf"\n",
                                  SvPVX(sv), SvIVX(sv), SvNVX(sv)));
 #endif
        }
@@ -6084,7 +6084,7 @@
            DEBUG_c(PerlIO_printf(Perl_debug_log,"sv_dec punt failed to convert '%s' 
to IOK or NOKp, UV=0x%"UVxf" NV=%"PERL_PRIgldbl"\n",
                                  SvPVX(sv), SvIVX(sv), SvNVX(sv)));
 #else
-           DEBUG_c(PerlIO_printf(Perl_debug_log,"sv_dec punt failed to convert '%s' 
to IOK or NOKp, UV=0x%"UVxf" NV=%g\n",
+           DEBUG_c(PerlIO_printf(Perl_debug_log,"sv_dec punt failed to convert '%s' 
+to IOK or NOKp, UV=0x%"UVxf" NV=%"NVgf"\n",
                                  SvPVX(sv), SvIVX(sv), SvNVX(sv)));
 #endif
        }

==== //depot/perl/x2p/a2p.h#16 (text) ====
Index: perl/x2p/a2p.h
--- perl/x2p/a2p.h.~1~  Tue Dec 18 14:15:05 2001
+++ perl/x2p/a2p.h      Tue Dec 18 14:15:05 2001
@@ -362,7 +362,7 @@
 
 #define str_true(str) (Str = (str), (Str->str_pok ? True(Str->str_ptr) : 
(Str->str_nok ? (Str->str_nval != 0.0) : 0 )))
 
-#define str_peek(str) (Str = (str), (Str->str_pok ? Str->str_ptr : (Str->str_nok ? 
(sprintf(buf,"num(%g)",Str->str_nval),buf) : "" )))
+#define str_peek(str) (Str = (str), (Str->str_pok ? Str->str_ptr : (Str->str_nok ? 
+(sprintf(buf,"num(%"NVgf")",Str->str_nval),buf) : "" )))
 #define str_get(str) (Str = (str), (Str->str_pok ? Str->str_ptr : str_2ptr(Str)))
 #define str_gnum(str) (Str = (str), (Str->str_nok ? Str->str_nval : str_2num(Str)))
 EXT STR *Str;

==== //depot/perl/x2p/str.c#13 (text) ====
Index: perl/x2p/str.c
--- perl/x2p/str.c.~1~  Tue Dec 18 14:15:05 2001
+++ perl/x2p/str.c      Tue Dec 18 14:15:05 2001
@@ -55,7 +55,7 @@
     str->str_nok = 1;
 #ifdef DEBUGGING
     if (debug & 32)
-       fprintf(stderr,"0x%lx num(%g)\n",(unsigned long)str,str->str_nval);
+       fprintf(stderr,"0x%lx num(%"NVgf")\n",(unsigned long)str,str->str_nval);
 #endif
     return str->str_nval;
 }
End of Patch.

Reply via email to