In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/562c1ab952f7c8534d6ce411de983a056de08a7f?hp=741002cc5c243352a3db99665e989daddc83b996>
- Log ----------------------------------------------------------------- commit 562c1ab952f7c8534d6ce411de983a056de08a7f Author: Karl Williamson <[email protected]> Date: Fri Nov 18 14:41:17 2016 -0700 Data-Dumper: Rmv impediment to compiling under C++11 C++11 changed from earlier versions to require space between the end of a string literal and a macro, so that a feature can unambiguously be added to the language. Starting in g++ 6.2, the compiler emits a deprecation warning when there isn't a space (presumably so that future versions can support C++11). Although not required by the C++11 change, this patch also makes sure there is space after a macro call, before a string literal. This makes the macro stand out, and is easier to read. As part of this, useless "" following the macro are removed. This patch also changes the affected lines to not exceed 79 columns, as specified by perlhack. Code and modules included with the Perl core need to be compilable using C++. This is so that perl can be embedded in C++ programs. (Actually, only the hdr files need to be so compilable, but it would be hard to test that just the hdrs are compilable.) So we need to accommodate changes to the C++ language. ----------------------------------------------------------------------- Summary of changes: dist/Data-Dumper/Dumper.pm | 2 +- dist/Data-Dumper/Dumper.xs | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/dist/Data-Dumper/Dumper.pm b/dist/Data-Dumper/Dumper.pm index 8e3e4f1..b346221 100644 --- a/dist/Data-Dumper/Dumper.pm +++ b/dist/Data-Dumper/Dumper.pm @@ -10,7 +10,7 @@ package Data::Dumper; BEGIN { - $VERSION = '2.164'; # Don't forget to set version and release + $VERSION = '2.165'; # Don't forget to set version and release } # date in POD below! #$| = 1; diff --git a/dist/Data-Dumper/Dumper.xs b/dist/Data-Dumper/Dumper.xs index 7960ec0..d288bbd 100644 --- a/dist/Data-Dumper/Dumper.xs +++ b/dist/Data-Dumper/Dumper.xs @@ -388,11 +388,11 @@ esc_q_utf8(pTHX_ SV* sv, const char *src, STRLEN slen, I32 do_utf8, I32 useqq) increment = (k == 0 && *s != '\0') ? 1 : UTF8SKIP(s); #if PERL_VERSION < 10 - sprintf(r, "\\x{%"UVxf"}", k); + sprintf(r, "\\x{%" UVxf "}", k); r += strlen(r); /* my_sprintf is not supported by ppport.h */ #else - r = r + my_sprintf(r, "\\x{%"UVxf"}", k); + r = r + my_sprintf(r, "\\x{%" UVxf "}", k); #endif continue; } @@ -611,14 +611,14 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv, i = perl_call_method(SvPVX_const(style->freezer), G_EVAL|G_VOID|G_DISCARD); SPAGAIN; if (SvTRUE(ERRSV)) - warn("WARNING(Freezer method call failed): %"SVf"", ERRSV); + warn("WARNING(Freezer method call failed): %" SVf, ERRSV); PUTBACK; FREETMPS; LEAVE; } ival = SvRV(val); realtype = SvTYPE(ival); #ifdef DD_USE_OLD_ID_FORMAT - idlen = my_snprintf(id, sizeof(id), "0x%"UVxf, PTR2UV(ival)); + idlen = my_snprintf(id, sizeof(id), "0x%" UVxf, PTR2UV(ival)); #else id_buffer = PTR2UV(ival); idlen = sizeof(id_buffer); @@ -676,7 +676,7 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv, #ifdef DD_USE_OLD_ID_FORMAT warn("ref name not found for %s", id); #else - warn("ref name not found for 0x%"UVxf, PTR2UV(ival)); + warn("ref name not found for 0x%" UVxf, PTR2UV(ival)); #endif return 0; } @@ -894,10 +894,10 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv, ilen = inamelen; sv_setiv(ixsv, ix); #if PERL_VERSION < 10 - (void) sprintf(iname+ilen, "%"IVdf, (IV)ix); + (void) sprintf(iname+ilen, "%" IVdf, (IV)ix); ilen = strlen(iname); #else - ilen = ilen + my_sprintf(iname+ilen, "%"IVdf, (IV)ix); + ilen = ilen + my_sprintf(iname+ilen, "%" IVdf, (IV)ix); #endif iname[ilen++] = ']'; iname[ilen] = '\0'; if (style->indent >= 3) { @@ -1222,7 +1222,7 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv, if (namelen) { #ifdef DD_USE_OLD_ID_FORMAT - idlen = my_snprintf(id, sizeof(id), "0x%"UVxf, PTR2UV(val)); + idlen = my_snprintf(id, sizeof(id), "0x%" UVxf, PTR2UV(val)); #else id_buffer = PTR2UV(val); idlen = sizeof(id_buffer); @@ -1262,9 +1262,9 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv, if (DD_is_integer(val)) { STRLEN len; if (SvIsUV(val)) - len = my_snprintf(tmpbuf, sizeof(tmpbuf), "%"UVuf, SvUV(val)); + len = my_snprintf(tmpbuf, sizeof(tmpbuf), "%" UVuf, SvUV(val)); else - len = my_snprintf(tmpbuf, sizeof(tmpbuf), "%"IVdf, SvIV(val)); + len = my_snprintf(tmpbuf, sizeof(tmpbuf), "%" IVdf, SvIV(val)); if (SvPOK(val)) { /* Need to check to see if this is a string such as " 0". I'm assuming from sprintf isn't going to clash with utf8. */ @@ -1607,7 +1607,8 @@ Data_Dumper_Dumpxs(href, ...) STRLEN nchars; sv_setpvs(name, "$"); sv_catsv(name, varname); - nchars = my_snprintf(tmpbuf, sizeof(tmpbuf), "%"IVdf, (IV)(i+1)); + nchars = my_snprintf(tmpbuf, sizeof(tmpbuf), "%" IVdf, + (IV)(i+1)); sv_catpvn(name, tmpbuf, nchars); } -- Perl5 Master Repository
