# define DO_BO_PACK_N(var, type)
# define DO_BO_UNPACK_P(var)
# define DO_BO_PACK_P(var)
+# define DO_BO_UNPACK_PC(var)
+# define DO_BO_PACK_PC(var)
#else /* PERL_PACK_CAN_BYTEORDER */
# else
# define DO_BO_UNPACK_P(var) BO_CANT_DOIT(unpack, pointer)
# define DO_BO_PACK_P(var) BO_CANT_DOIT(pack, pointer)
+# define DO_BO_UNPACK_PC(var) BO_CANT_DOIT(unpack, pointer)
+# define DO_BO_PACK_PC(var) BO_CANT_DOIT(pack, pointer)
# endif
# if defined(my_htolen) && defined(my_letohn) && \
typedef U8 packprops_t;
#if 'J'-'I' == 1
/* ASCII */
-const packprops_t packprops[512] = {
+STATIC const packprops_t packprops[512] = {
/* normal */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
#else
/* EBCDIC (or bust) */
-const packprops_t packprops[512] = {
+STATIC const packprops_t packprops[512] = {
/* normal */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
The engine implementing pack() Perl function. Note: parameters next_in_list and
flags are not used. This call should not be used; use packlist instead.
-=cut */
-
+=cut
+*/
void
Perl_pack_cat(pTHX_ SV *cat, const char *pat, const char *patend, register SV **beglist, SV **endlist, SV ***next_in_list, U32 flags)
The engine implementing pack() Perl function.
-=cut */
-
+=cut
+*/
void
Perl_packlist(pTHX_ SV *cat, const char *pat, const char *patend, register SV **beglist, SV **endlist )
/* We're going to do changes through SvPVX(cat). Make sure it's valid.
Also make sure any UTF8 flag is loaded */
SvPV_force(cat, no_len);
- if (DO_UTF8(cat)) sym.flags |= FLAG_PARSE_UTF8 | FLAG_DO_UTF8;
+ if (DO_UTF8(cat))
+ sym.flags |= FLAG_PARSE_UTF8 | FLAG_DO_UTF8;
(void)pack_rec( cat, &sym, beglist, endlist );
}
ckWARN(WARN_PACK))
Perl_warner(aTHX_ packWARN(WARN_PACK),
"Character in 'c' format wrapped in pack");
- PUSH_BYTE(utf8, cur, aiv & 0xff);
+ PUSH_BYTE(utf8, cur, (U8)(aiv & 0xff));
}
break;
case 'C':
ckWARN(WARN_PACK))
Perl_warner(aTHX_ packWARN(WARN_PACK),
"Character in 'C' format wrapped in pack");
- *cur++ = aiv & 0xff;
+ *cur++ = (char)(aiv & 0xff);
}
break;
case 'W': {
SvGETMAGIC(fromstr);
if (!SvOK(fromstr)) aptr = NULL;
else {
- STRLEN n_a;
/* XXX better yet, could spirit away the string to
* a safe spot and hang on to it until the result
* of pack() (and all copies of the result) are
"Attempt to pack pointer to temporary value");
}
if (SvPOK(fromstr) || SvNIOK(fromstr))
- aptr = SvPV_nomg_const(fromstr, n_a);
+ aptr = SvPV_nomg_const_nolen(fromstr);
else
- aptr = SvPV_force_flags(fromstr, n_a, 0);
+ aptr = SvPV_force_flags_nolen(fromstr, 0);
}
DO_BO_PACK_PC(aptr);
PUSH_VAR(utf8, cur, aptr);