summaryrefslogtreecommitdiff
path: root/pp_pack.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-11-17 06:21:54 -0700
committerKarl Williamson <khw@cpan.org>2016-11-18 09:41:07 -0700
commit147e38468b8279e26a0ca11e4efd8492016f2702 (patch)
tree4d3c3b5b692937fc40e2fed20aaa1b7afd3ba56e /pp_pack.c
parent51d89e3583b4182c42c21b343376f2286f67fc3b (diff)
downloadperl-147e38468b8279e26a0ca11e4efd8492016f2702.tar.gz
Change white space to avoid C++ deprecation warning
C++11 requires 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 warning when there isn't a space (presumably so that future versions can support C++11). Unfortunately there are many such instances in the perl core. This commit fixes those, including those in ext/, but individual commits will be used for the other modules, those in dist/ and cpan/. This commit also inserts space at the end of a macro before a string literal, even though that is not deprecated, and removes useless "" literals following a macro (instead of inserting a blank). The result is easier to read, making the macro stand out, and be clearer as to the intention. 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.
Diffstat (limited to 'pp_pack.c')
-rw-r--r--pp_pack.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/pp_pack.c b/pp_pack.c
index 7e6dc4d423..a75229acca 100644
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -1585,7 +1585,8 @@ S_unpack_rec(pTHX_ tempsym_t* symptr, const char *s, const char *strbeg, const c
if (++bytes >= sizeof(UV)) { /* promote to string */
const char *t;
- sv = Perl_newSVpvf(aTHX_ "%.*"UVuf, (int)TYPE_DIGITS(UV), auv);
+ sv = Perl_newSVpvf(aTHX_ "%.*" UVuf,
+ (int)TYPE_DIGITS(UV), auv);
while (s < strend) {
ch = SHIFT_BYTE(utf8, s, strend, datumtype);
sv = mul128(sv, (U8)(ch & 0x7f));
@@ -2063,9 +2064,9 @@ S_sv_check_infnan(pTHX_ SV *sv, I32 datumtype)
const I32 c = TYPE_NO_MODIFIERS(datumtype);
const NV nv = SvNV_nomg(sv);
if (c == 'w')
- Perl_croak(aTHX_ "Cannot compress %"NVgf" in pack", nv);
+ Perl_croak(aTHX_ "Cannot compress %" NVgf " in pack", nv);
else
- Perl_croak(aTHX_ "Cannot pack %"NVgf" with '%c'", nv, (int) c);
+ Perl_croak(aTHX_ "Cannot pack %" NVgf " with '%c'", nv, (int) c);
}
return sv;
}
@@ -2355,7 +2356,7 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist )
if (!S_utf8_to_bytes(aTHX_ &aptr, end, cur, fromlen,
datumtype | TYPE_IS_PACK))
Perl_croak(aTHX_ "panic: predicted utf8 length not available, "
- "for '%c', aptr=%p end=%p cur=%p, fromlen=%"UVuf,
+ "for '%c', aptr=%p end=%p cur=%p, fromlen=%" UVuf,
(int)datumtype, aptr, end, cur, (UV)fromlen);
cur += fromlen;
len -= fromlen;