When Gconvert is a macro around sprintf with a .* format we need
authorNicholas Clark <nick@ccl4.org>
Sat, 29 Nov 2003 15:41:19 +0000 (15:41 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 29 Nov 2003 15:41:19 +0000 (15:41 +0000)
to cast to int (in case STRLEN isn't the same size as int)
gcc issues a warning even when it is the same size

p4raw-id: //depot/perl@21806

sv.c

diff --git a/sv.c b/sv.c
index 3a05916..469faa9 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -8651,7 +8651,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
                return;
            if (*pp == 'g') {
                if (digits < sizeof(ebuf) - NV_DIG - 10) { /* 0, point, slack */
-                   Gconvert(nv, digits, 0, ebuf);
+                   Gconvert(nv, (int)digits, 0, ebuf);
                    sv_catpv(sv, ebuf);
                    if (*ebuf)  /* May return an empty string for digits==0 */
                        return;
@@ -9361,7 +9361,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
            if ( !(width || left || plus || alt) && fill != '0'
                 && has_precis && intsize != 'q' ) {    /* Shortcuts */
                if ( c == 'g') {
-                   Gconvert((NV)nv, precis, 0, PL_efloatbuf);
+                   Gconvert((NV)nv, (int)precis, 0, PL_efloatbuf);
                    if (*PL_efloatbuf)  /* May return an empty string for digits==0 */
                        goto float_converted;
                } else if ( c == 'f' && !precis) {