These should be two separate patches, but there's too much overlap.
* Added more NN flags to functions in embed.fnc
* Rearranged some funcs to reduce the number of #ifdefs
* Added definitions for all the Perl_ck_* functions in op.c.
* In op.c renamed static handle_constructor to is_handle_constructor
* Removed commented out function Perl_ck_gvconst, which has been
commented out since 1998.
* Consting and localizing in pad.c
* Squashed a compiler warning in perlio.c
* Changed many SvPVX calls to SvPVX_const in pp_ctl.c, sv.c and utf8.c
* Consting and localizing in regcomp.c
make regen will need to be rerun after this.
xoxo,
Andy
--
Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance
diff -ur /home/alester/bleadperl/embed.fnc /home/alester/bw/trunk/embed.fnc
--- /home/alester/bleadperl/embed.fnc 2005-05-16 12:23:31.000000000 -0500
+++ /home/alester/bw/trunk/embed.fnc 2005-05-20 21:37:30.000000000 -0500
@@ -413,9 +413,6 @@
p |int |magic_setarylen|SV* sv|MAGIC* mg
p |int |magic_setbm |SV* sv|MAGIC* mg
p |int |magic_setdbline|SV* sv|MAGIC* mg
-#if defined(USE_LOCALE_COLLATE)
-p |int |magic_setcollxfrm|SV* sv|MAGIC* mg
-#endif
p |int |magic_setdefelem|SV* sv|MAGIC* mg
p |int |magic_setenv |SV* sv|MAGIC* mg
p |int |magic_setfm |SV* sv|MAGIC* mg
@@ -438,6 +435,7 @@
p |void |magicname |const char* sym|const char* name|I32 namlen
Ap |void |markstack_grow
#if defined(USE_LOCALE_COLLATE)
+p |int |magic_setcollxfrm|SV* sv|MAGIC* mg
p |char* |mem_collxfrm |const char* s|STRLEN len|STRLEN* xlen
#endif
Afp |SV* |mess |const char* pat|...
@@ -780,11 +778,11 @@
ApdR |char* |sv_reftype |NN const SV* sv|int ob
Apd |void |sv_replace |NN SV* sv|NN SV* nsv
Apd |void |sv_report_used
-Apd |void |sv_reset |const char* s|HV* stash
+Apd |void |sv_reset |NN const char* s|HV* stash
Afpd |void |sv_setpvf |SV* sv|const char* pat|...
Apd |void |sv_vsetpvf |SV* sv|const char* pat|va_list* args
Apd |void |sv_setiv |SV* sv|IV num
-Apdb |void |sv_setpviv |SV* sv|IV num
+Apdb |void |sv_setpviv |NN SV* sv|IV num
Apd |void |sv_setuv |SV* sv|UV num
Apd |void |sv_setnv |SV* sv|NV num
Apd |SV* |sv_setref_iv |SV* rv|const char* classname|IV iv
@@ -889,7 +887,7 @@
Afpd |void |sv_setpvf_mg |SV *sv|const char* pat|...
Apd |void |sv_vsetpvf_mg |SV* sv|const char* pat|va_list* args
Apd |void |sv_setiv_mg |SV *sv|IV i
-Apdb |void |sv_setpviv_mg |SV *sv|IV iv
+Apdb |void |sv_setpviv_mg |NN SV *sv|IV iv
Apd |void |sv_setuv_mg |SV *sv|UV u
Apd |void |sv_setnv_mg |SV *sv|NV num
Apd |void |sv_setpv_mg |SV *sv|const char *ptr
@@ -946,20 +944,17 @@
Ap |MAGIC* |mg_dup |MAGIC* mg|CLONE_PARAMS* param
Ap |SV* |sv_dup |SV* sstr|CLONE_PARAMS* param
Ap |void |rvpv_dup |SV* dstr|SV *sstr|CLONE_PARAMS* param
-#if defined(HAVE_INTERP_INTERN)
-Ap |void |sys_intern_dup |struct interp_intern* src \
- |struct interp_intern* dst
-#endif
Ap |PTR_TBL_t*|ptr_table_new
Ap |void* |ptr_table_fetch|NN PTR_TBL_t *tbl|NN void *sv
Ap |void |ptr_table_store|NN PTR_TBL_t *tbl|void *oldsv|void *newsv
Ap |void |ptr_table_split|NN PTR_TBL_t *tbl
Ap |void |ptr_table_clear|PTR_TBL_t *tbl
Ap |void |ptr_table_free|PTR_TBL_t *tbl
-#endif
-#if defined(HAVE_INTERP_INTERN)
+# if defined(HAVE_INTERP_INTERN)
+Ap |void |sys_intern_dup |NN struct interp_intern* src|NN struct
interp_intern* dst
Ap |void |sys_intern_clear
Ap |void |sys_intern_init
+# endif
#endif
Ap |char * |custom_op_name |NN const OP* op
@@ -1003,35 +998,76 @@
#endif
#if defined(PERL_IN_MG_C) || defined(PERL_DECL_PROT)
-s |void |save_magic |I32 mgs_ix|SV *sv
-s |int |magic_methpack |SV *sv|const MAGIC *mg|const char *meth
-s |int |magic_methcall |SV *sv|const MAGIC *mg|const char *meth|I32 f \
+s |void |save_magic |I32 mgs_ix|NN SV *sv
+s |int |magic_methpack |NN SV *sv|NN const MAGIC *mg|NN const char
*meth
+s |int |magic_methcall |NN SV *sv|NN const MAGIC *mg|NN const char
*meth|I32 f \
|int n|SV *val
#endif
#if defined(PERL_IN_OP_C) || defined(PERL_DECL_PROT)
-s |I32 |list_assignment|const OP *o
-s |void |bad_type |I32 n|const char *t|const char *name|const OP
*kid
-s |void |cop_free |COP *cop
+ApR |OP* |ck_anoncode |NN OP *o
+ApR |OP* |ck_bitop |NN OP *o
+ApR |OP* |ck_concat |NN OP *o
+ApR |OP* |ck_defined |NN OP *o
+ApR |OP* |ck_delete |NN OP *o
+ApR |OP* |ck_die |NN OP *o
+ApR |OP* |ck_eof |NN OP *o
+ApR |OP* |ck_eval |NN OP *o
+ApR |OP* |ck_exec |NN OP *o
+ApR |OP* |ck_exists |NN OP *o
+ApR |OP* |ck_exit |NN OP *o
+ApR |OP* |ck_ftst |NN OP *o
+ApR |OP* |ck_fun |NN OP *o
+ApR |OP* |ck_glob |NN OP *o
+ApR |OP* |ck_grep |NN OP *o
+ApR |OP* |ck_index |NN OP *o
+ApR |OP* |ck_join |NN OP *o
+ApR |OP* |ck_lengthconst |NN OP *o
+ApR |OP* |ck_lfun |NN OP *o
+ApR |OP* |ck_listiob |NN OP *o
+ApR |OP* |ck_match |NN OP *o
+ApR |OP* |ck_method |NN OP *o
+ApR |OP* |ck_null |NN OP *o
+ApR |OP* |ck_open |NN OP *o
+ApR |OP* |ck_repeat |NN OP *o
+ApR |OP* |ck_require |NN OP *o
+ApR |OP* |ck_retarget |NN OP *o
+ApR |OP* |ck_return |NN OP *o
+ApR |OP* |ck_rfun |NN OP *o
+ApR |OP* |ck_rvconst |NN OP *o
+ApR |OP* |ck_sassign |NN OP *o
+ApR |OP* |ck_select |NN OP *o
+ApR |OP* |ck_shift |NN OP *o
+ApR |OP* |ck_sort |NN OP *o
+ApR |OP* |ck_spair |NN OP *o
+ApR |OP* |ck_split |NN OP *o
+ApR |OP* |ck_subr |NN OP *o
+ApR |OP* |ck_substr |NN OP *o
+ApR |OP* |ck_svconst |NN OP *o
+ApR |OP* |ck_trunc |NN OP *o
+ApR |OP* |ck_unpack |NN OP *o
+sR |bool |is_handle_constructor|NN const OP *o|I32 numargs
+sR |I32 |is_list_assignment|const OP *o
+s |void |cop_free |NN COP *cop
s |OP* |modkids |OP *o|I32 type
-s |void |no_bareword_allowed|const OP *o
-s |OP* |no_fh_allowed |OP *o
-s |OP* |scalarboolean |OP *o
-s |OP* |too_few_arguments|OP *o|const char* name
-s |OP* |too_many_arguments|OP *o|const char* name
-s |OP* |newDEFSVOP
-s |OP* |new_logop |I32 type|I32 flags|OP **firstp|OP **otherp
-s |void |simplify_sort |OP *o
-s |bool |is_handle_constructor |const OP *o|I32 argnum
+s |OP* |scalarboolean |NN OP *o
+sR |OP* |newDEFSVOP
+sR |OP* |new_logop |I32 type|I32 flags|NN OP **firstp|NN OP
**otherp
+s |void |simplify_sort |NN OP *o
s |char* |gv_ename |GV *gv
s |bool |scalar_mod_type|const OP *o|I32 type
s |OP * |my_kid |OP *o|OP *attrs|OP **imopsp
s |OP * |dup_attrlist |OP *o
s |void |apply_attrs |HV *stash|SV *target|OP *attrs|bool for_my
s |void |apply_attrs_my |HV *stash|OP *target|OP *attrs|OP **imopsp
+s |void |bad_type |I32 n|NN const char *t|NN const char *name|NN
const OP *kid
+s |void |no_bareword_allowed|NN const OP *o
+sR |OP* |no_fh_allowed|NN OP *o
+sR |OP* |too_few_arguments|NN OP *o|NN const char* name
+sR |OP* |too_many_arguments|NN OP *o|NN const char* name
#endif
#if defined(PL_OP_SLAB_ALLOC)
-Ap |void* |Slab_Alloc |int m|size_t sz
+ApR |void* |Slab_Alloc |int m|size_t sz
Ap |void |Slab_Free |void *op
#endif
@@ -1120,12 +1156,12 @@
Es |void |reginsert |struct RExC_state_t*|U8|regnode *
Es |void |regoptail |struct RExC_state_t*|regnode *|regnode *
Es |void |regtail |struct RExC_state_t*|regnode *|regnode *
-Es |char*|regwhite |char *|char *
-Es |char*|nextchar |struct RExC_state_t*
+Es |char* |regwhite |char *p|const char *e
+Es |char* |nextchar |struct RExC_state_t*
# ifdef DEBUGGING
Es |regnode*|dumpuntil |regnode *start|regnode *node \
|regnode *last|SV* sv|I32 l
-Es |void |put_byte |SV* sv|int c
+Es |void |put_byte |NN SV* sv|int c
# endif
Es |void |scan_commit |struct RExC_state_t*|struct scan_data_t *data
Es |void |cl_anything |struct RExC_state_t*|struct
regnode_charclass_class *cl
diff -ur /home/alester/bleadperl/op.c /home/alester/bw/trunk/op.c
--- /home/alester/bleadperl/op.c 2005-05-20 22:25:40.000000000 -0500
+++ /home/alester/bw/trunk/op.c 2005-05-20 22:39:10.000000000 -0500
@@ -1379,12 +1379,12 @@
}
STATIC bool
-S_is_handle_constructor(pTHX_ const OP *o, I32 argnum)
+S_is_handle_constructor(pTHX_ const OP *o, I32 numargs)
{
switch (o->op_type) {
case OP_PIPE_OP:
case OP_SOCKPAIR:
- if (argnum == 2)
+ if (numargs == 2)
return TRUE;
/* FALL THROUGH */
case OP_SYSOPEN:
@@ -1393,7 +1393,7 @@
case OP_SOCKET:
case OP_OPEN_DIR:
case OP_ACCEPT:
- if (argnum == 1)
+ if (numargs == 1)
return TRUE;
/* FALL THROUGH */
default:
@@ -1543,9 +1543,8 @@
#define ATTRSMODULE_PM "attributes.pm"
if (for_my) {
- SV **svp;
/* Don't force the C<use> if we don't need it. */
- svp = hv_fetch(GvHVn(PL_incgv), ATTRSMODULE_PM,
+ SV **svp = hv_fetch(GvHVn(PL_incgv), ATTRSMODULE_PM,
sizeof(ATTRSMODULE_PM)-1, 0);
if (svp && *svp != &PL_sv_undef)
; /* already in %INC */
@@ -3226,7 +3225,7 @@
}
STATIC I32
-S_list_assignment(pTHX_ register const OP *o)
+S_is_list_assignment(pTHX_ register const OP *o)
{
if (!o)
return TRUE;
@@ -3235,8 +3234,8 @@
o = cUNOPo->op_first;
if (o->op_type == OP_COND_EXPR) {
- const I32 t = list_assignment(cLOGOPo->op_first->op_sibling);
- const I32 f =
list_assignment(cLOGOPo->op_first->op_sibling->op_sibling);
+ const I32 t = is_list_assignment(cLOGOPo->op_first->op_sibling);
+ const I32 f =
is_list_assignment(cLOGOPo->op_first->op_sibling->op_sibling);
if (t && f)
return TRUE;
@@ -3281,7 +3280,7 @@
}
}
- if (list_assignment(left)) {
+ if (is_list_assignment(left)) {
OP *curop;
PL_modcount = 0;
@@ -5162,17 +5161,6 @@
return o;
}
-#if 0
-OP *
-Perl_ck_gvconst(pTHX_ register OP *o)
-{
- o = fold_constants(o);
- if (o->op_type == OP_CONST)
- o->op_type = OP_GV;
- return o;
-}
-#endif
-
OP *
Perl_ck_rvconst(pTHX_ register OP *o)
{
@@ -5183,12 +5171,12 @@
if (kid->op_type == OP_CONST) {
int iscv;
GV *gv;
- SV *kidsv = kid->op_sv;
+ SV * const kidsv = kid->op_sv;
/* Is it a constant from cv_const_sv()? */
if (SvROK(kidsv) && SvREADONLY(kidsv)) {
SV *rsv = SvRV(kidsv);
- int svtype = SvTYPE(rsv);
+ const int svtype = SvTYPE(rsv);
const char *badtype = Nullch;
switch (o->op_type) {
diff -ur /home/alester/bleadperl/pad.c /home/alester/bw/trunk/pad.c
--- /home/alester/bleadperl/pad.c 2005-05-20 22:25:40.000000000 -0500
+++ /home/alester/bw/trunk/pad.c 2005-05-20 23:56:47.000000000 -0500
@@ -255,7 +255,7 @@
AV *comppad = (AV*)AvARRAY(padlist)[1];
SV **curpad = AvARRAY(comppad);
for (ix = AvFILLp(comppad_name); ix > 0; ix--) {
- SV *namesv = namepad[ix];
+ SV * const namesv = namepad[ix];
if (namesv && namesv != &PL_sv_undef
&& *SvPVX_const(namesv) == '&')
{
@@ -329,7 +329,7 @@
PADOFFSET
Perl_pad_add_name(pTHX_ const char *name, HV* typestash, HV* ourstash, bool
fake)
{
- PADOFFSET offset = pad_alloc(OP_PADSV, SVs_PADMY);
+ const PADOFFSET offset = pad_alloc(OP_PADSV, SVs_PADMY);
SV* namesv = NEWSV(1102, 0);
ASSERT_CURPAD_ACTIVE("pad_add_name");
@@ -1123,7 +1123,6 @@
Perl_pad_tidy(pTHX_ padtidy_type type)
{
dVAR;
- PADOFFSET ix;
ASSERT_CURPAD_ACTIVE("pad_tidy");
@@ -1155,6 +1154,7 @@
if (type == padtidy_SUBCLONE) {
SV **namep = AvARRAY(PL_comppad_name);
+ PADOFFSET ix;
for (ix = AvFILLp(PL_comppad); ix > 0; ix--) {
SV *namesv;
@@ -1186,6 +1186,7 @@
/* XXX DAPM rationalise these two similar branches */
if (type == padtidy_SUB) {
+ PADOFFSET ix;
for (ix = AvFILLp(PL_comppad); ix > 0; ix--) {
if (SvIMMORTAL(PL_curpad[ix]) || IS_PADGV(PL_curpad[ix]) ||
IS_PADCONST(PL_curpad[ix]))
continue;
@@ -1194,6 +1195,7 @@
}
}
else if (type == padtidy_FORMAT) {
+ PADOFFSET ix;
for (ix = AvFILLp(PL_comppad); ix > 0; ix--) {
if (!SvPADMY(PL_curpad[ix]) && !SvIMMORTAL(PL_curpad[ix]))
SvPADTMP_on(PL_curpad[ix]);
diff -ur /home/alester/bleadperl/perlio.c /home/alester/bw/trunk/perlio.c
--- /home/alester/bleadperl/perlio.c 2005-05-20 22:25:40.000000000 -0500
+++ /home/alester/bw/trunk/perlio.c 2005-05-20 23:43:36.000000000 -0500
@@ -270,7 +270,7 @@
return win32_fdupopen(f);
#else
if (f) {
- int fd = PerlLIO_dup(PerlIO_fileno(f));
+ const int fd = PerlLIO_dup(PerlIO_fileno(f));
if (fd >= 0) {
char mode[8];
int omode = fcntl(fd, F_GETFL);
@@ -763,7 +763,7 @@
SAVEINT(PL_in_load_module);
if (cv) {
SAVEGENERICSV(PL_warnhook);
- SvREFCNT_inc(cv);
+ (void)SvREFCNT_inc(cv);
PL_warnhook = (SV *) cv;
}
PL_in_load_module++;
diff -ur /home/alester/bleadperl/pp_ctl.c /home/alester/bw/trunk/pp_ctl.c
--- /home/alester/bleadperl/pp_ctl.c 2005-05-20 22:25:40.000000000 -0500
+++ /home/alester/bw/trunk/pp_ctl.c 2005-05-20 22:42:45.000000000 -0500
@@ -1409,7 +1409,7 @@
sv_catpvn(err, prefix, sizeof(prefix)-1);
sv_catpvn(err, message, msglen);
if (ckWARN(WARN_MISC)) {
- STRLEN start = SvCUR(err)-msglen-sizeof(prefix)+1;
+ const STRLEN start = SvCUR(err)-msglen-sizeof(prefix)+1;
Perl_warner(aTHX_ packWARN(WARN_MISC),
SvPVX_const(err)+start);
}
}
@@ -2658,9 +2658,9 @@
STATIC void
S_save_lines(pTHX_ AV *array, SV *sv)
{
- register const char *s = SvPVX_const(sv);
- register const char *send = SvPVX_const(sv) + SvCUR(sv);
- register I32 line = 1;
+ const char *s = SvPVX_const(sv);
+ const char *send = SvPVX_const(sv) + SvCUR(sv);
+ I32 line = 1;
while (s && s < send) {
const char *t;
@@ -2941,8 +2941,8 @@
LEAVE;
if (optype == OP_REQUIRE) {
const char* msg = SvPVx(ERRSV, n_a);
- SV *nsv = cx->blk_eval.old_namesv;
- (void)hv_store(GvHVn(PL_incgv), SvPVX_const(nsv), SvCUR(nsv),
+ SV *nsv = cx->blk_eval.old_namesv;
+ (void)hv_store(GvHVn(PL_incgv), SvPVX_const(nsv), SvCUR(nsv),
&PL_sv_undef, 0);
DIE(aTHX_ "%sCompilation failed in require",
*msg ? msg : "Unknown error\n");
@@ -3854,7 +3854,7 @@
{
dVAR;
SV *datasv = FILTER_DATA(idx);
- int filter_has_file = IoLINES(datasv);
+ const int filter_has_file = IoLINES(datasv);
GV *filter_child_proc = (GV *)IoFMT_GV(datasv);
SV *filter_state = (SV *)IoTOP_GV(datasv);
SV *filter_sub = (SV *)IoBOTTOM_GV(datasv);
diff -ur /home/alester/bleadperl/pp_hot.c /home/alester/bw/trunk/pp_hot.c
--- /home/alester/bleadperl/pp_hot.c 2005-05-16 12:23:32.000000000 -0500
+++ /home/alester/bw/trunk/pp_hot.c 2005-05-20 22:09:34.000000000 -0500
@@ -2690,8 +2690,6 @@
if (hasargs)
{
AV* av;
- SV** ary;
-
#if 0
DEBUG_S(PerlIO_printf(Perl_debug_log,
"%p entersub preparing @_\n", thr));
@@ -2711,7 +2709,7 @@
++MARK;
if (items > AvMAX(av) + 1) {
- ary = AvALLOC(av);
+ SV **ary = AvALLOC(av);
if (AvARRAY(av) != ary) {
AvMAX(av) += AvARRAY(av) - AvALLOC(av);
SvPV_set(av, (char*)ary);
diff -ur /home/alester/bleadperl/pp_sys.c /home/alester/bw/trunk/pp_sys.c
--- /home/alester/bleadperl/pp_sys.c 2005-05-11 03:24:14.000000000 -0500
+++ /home/alester/bw/trunk/pp_sys.c 2005-05-20 21:40:03.000000000 -0500
@@ -1358,7 +1358,7 @@
}
if (IoFLAGS(io) & IOf_DIDTOP) { /* Oh dear. It still doesn't fit. */
I32 lines = IoLINES_LEFT(io);
- const char *s = SvPVX(PL_formtarget);
+ const char *s = SvPVX_const(PL_formtarget);
if (lines <= 0) /* Yow, header didn't even fit!!! */
goto forget_top;
while (lines-- > 0) {
diff -ur /home/alester/bleadperl/regcomp.c /home/alester/bw/trunk/regcomp.c
--- /home/alester/bleadperl/regcomp.c 2005-05-16 12:23:32.000000000 -0500
+++ /home/alester/bw/trunk/regcomp.c 2005-05-21 00:14:03.000000000 -0500
@@ -4443,7 +4443,7 @@
}
STATIC char *
-S_regwhite(pTHX_ char *p, char *e)
+S_regwhite(pTHX_ char *p, const char *e)
{
while (p < e) {
if (isSPACE(*p))
@@ -5468,10 +5468,9 @@
STATIC regnode * /* Location. */
S_reg_node(pTHX_ RExC_state_t *pRExC_state, U8 op)
{
- register regnode *ret;
register regnode *ptr;
+ regnode * const ret = RExC_emit;
- ret = RExC_emit;
if (SIZE_ONLY) {
SIZE_ALIGN(RExC_size);
RExC_size += 1;
@@ -5504,10 +5503,9 @@
STATIC regnode * /* Location. */
S_reganode(pTHX_ RExC_state_t *pRExC_state, U8 op, U32 arg)
{
- register regnode *ret;
register regnode *ptr;
+ regnode * const ret = RExC_emit;
- ret = RExC_emit;
if (SIZE_ONLY) {
SIZE_ALIGN(RExC_size);
RExC_size += 2;
@@ -5555,7 +5553,7 @@
register regnode *src;
register regnode *dst;
register regnode *place;
- register int offset = regarglen[(U8)op];
+ const int offset = regarglen[(U8)op];
/* (PL_regkind[(U8)op] == CURLY ? EXTRA_STEP_2ARGS : 0); */
@@ -5611,7 +5609,6 @@
S_regtail(pTHX_ RExC_state_t *pRExC_state, regnode *p, regnode *val)
{
register regnode *scan;
- register regnode *temp;
if (SIZE_ONLY)
return;
@@ -5619,7 +5616,7 @@
/* Find last node. */
scan = p;
for (;;) {
- temp = regnext(scan);
+ regnode * const temp = regnext(scan);
if (temp == NULL)
break;
scan = temp;
diff -ur /home/alester/bleadperl/sv.c /home/alester/bw/trunk/sv.c
--- /home/alester/bleadperl/sv.c 2005-05-20 18:20:27.000000000 -0500
+++ /home/alester/bw/trunk/sv.c 2005-05-20 22:39:05.000000000 -0500
@@ -2709,7 +2709,7 @@
}
else if (SvPOKp(sv) && SvLEN(sv)) {
UV value;
- const int numtype = grok_number(SvPVX(sv), SvCUR(sv), &value);
+ const int numtype = grok_number(SvPVX_const(sv), SvCUR(sv), &value);
/* We want to avoid a possible problem when we cache an IV which
may be later translated to an NV, and the resulting NV is not
the same as the direct translation of the initial string
@@ -3012,7 +3012,7 @@
}
else if (SvPOKp(sv) && SvLEN(sv)) {
UV value;
- const int numtype = grok_number(SvPVX(sv), SvCUR(sv), &value);
+ const int numtype = grok_number(SvPVX_const(sv), SvCUR(sv), &value);
/* We want to avoid a possible problem when we cache a UV which
may be later translated to an NV, and the resulting NV is not
@@ -3184,7 +3184,7 @@
return SvNVX(sv);
if (SvPOKp(sv) && SvLEN(sv)) {
if (ckWARN(WARN_NUMERIC) && !SvIOKp(sv) &&
- !grok_number(SvPVX(sv), SvCUR(sv), NULL))
+ !grok_number(SvPVX_const(sv), SvCUR(sv), NULL))
not_a_number(sv);
return Atof(SvPVX(sv));
}
@@ -3406,7 +3406,7 @@
S_asUV(pTHX_ SV *sv)
{
UV value;
- int numtype = grok_number(SvPVX(sv), SvCUR(sv), &value);
+ const int numtype = grok_number(SvPVX_const(sv), SvCUR(sv), &value);
if ((numtype & (IS_NUMBER_IN_UV | IS_NUMBER_NOT_INT))
== IS_NUMBER_IN_UV) {
@@ -7394,7 +7394,7 @@
/* Got to punt this as an integer if needs be, but we don't issue
warnings. Probably ought to make the sv_iv_please() that does
the conversion if possible, and silently. */
- int numtype = grok_number(SvPVX(sv), SvCUR(sv), NULL);
+ const int numtype = grok_number(SvPVX_const(sv), SvCUR(sv), NULL);
if (numtype && !(numtype & IS_NUMBER_INFINITY)) {
/* Need to try really hard to see if it's an integer.
9.22337203685478e+18 is an integer.
@@ -7542,7 +7542,7 @@
}
#ifdef PERL_PRESERVE_IVUV
{
- int numtype = grok_number(SvPVX(sv), SvCUR(sv), NULL);
+ const int numtype = grok_number(SvPVX_const(sv), SvCUR(sv), NULL);
if (numtype && !(numtype & IS_NUMBER_INFINITY)) {
/* Need to try really hard to see if it's an integer.
9.22337203685478e+18 is an integer.
diff -ur /home/alester/bleadperl/toke.c /home/alester/bw/trunk/toke.c
--- /home/alester/bleadperl/toke.c 2005-05-20 04:53:31.000000000 -0500
+++ /home/alester/bw/trunk/toke.c 2005-05-20 22:58:17.000000000 -0500
@@ -978,7 +978,7 @@
STRLEN len;
const char *start = SvPVx(sv,len);
const char *end = start + len;
- bool utf = SvUTF8(sv) ? TRUE : FALSE;
+ const bool utf = SvUTF8(sv) ? TRUE : FALSE;
while (start < end) {
STRLEN skip;
UV n;
diff -ur /home/alester/bleadperl/utf8.c /home/alester/bw/trunk/utf8.c
--- /home/alester/bleadperl/utf8.c 2005-05-16 12:23:32.000000000 -0500
+++ /home/alester/bw/trunk/utf8.c 2005-05-20 13:34:52.000000000 -0500
@@ -521,7 +521,7 @@
}
if (warning) {
- char *s = SvPVX(sv);
+ const char *s = SvPVX_const(sv);
if (PL_op)
Perl_warner(aTHX_ packWARN(WARN_UTF8),