Here's a rundown:

sv.c: Consting & localizing

embed.fnc: More flags for non-null parms and having to check return
codes.  One of them  (gv_init, I believe) causes a warning under GCC
that says that we could be passing a null pointer when we shouldn't be.
I'm going to investigate.  Also, all the *_dup functions are now flagged
as returning malloced pointers.

gv.c: Quieted an unused arg warning.  Some consting.

mg.c: Quieted an unused arg warning.  Some consting.

perl.h & XSUB.h: Renamed LINT_UNUSED_ARG() to PERL_UNUSED_ARG().

sv.c: Consting.  Some localizing.  Quieted an unused arg warning.

universal.c: Lots of localizing.  Switching to PERL_UNUSED_ARG() rather
than naked (void)x.

xoxo,
Andy


-- 
Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance
diff -pur bleadperl/doop.c bw/trunk/doop.c
--- bleadperl/doop.c    2005-06-20 06:06:18.000000000 -0500
+++ bw/trunk/doop.c     2005-06-20 09:58:57.000000000 -0500
@@ -306,8 +306,8 @@ S_do_trans_simple_utf8(pTHX_ SV *sv)
     const I32 grows = PL_op->op_private & OPpTRANS_GROWS;
     STRLEN len;
 
-    SV* rv = (SV*)cSVOP->op_sv;
-    HV* hv = (HV*)SvRV(rv);
+    SV* const  rv = (SV*)cSVOP->op_sv;
+    HV* const  hv = (HV*)SvRV(rv);
     SV** svp = hv_fetch(hv, "NONE", 4, FALSE);
     const UV none = svp ? SvUV(*svp) : 0x7fffffff;
     const UV extra = none + 1;
@@ -400,9 +400,9 @@ S_do_trans_count_utf8(pTHX_ SV *sv)
     I32 matches = 0;
     STRLEN len;
 
-    SV* rv = (SV*)cSVOP->op_sv;
-    HV* hv = (HV*)SvRV(rv);
-    SV** svp = hv_fetch(hv, "NONE", 4, FALSE);
+    SV* const rv = (SV*)cSVOP->op_sv;
+    HV* const hv = (HV*)SvRV(rv);
+    SV** const svp = hv_fetch(hv, "NONE", 4, FALSE);
     const UV none = svp ? SvUV(*svp) : 0x7fffffff;
     const UV extra = none + 1;
     U8 hibit = 0;
@@ -442,8 +442,8 @@ S_do_trans_complex_utf8(pTHX_ SV *sv)
     const I32 squash   = PL_op->op_private & OPpTRANS_SQUASH;
     const I32 del      = PL_op->op_private & OPpTRANS_DELETE;
     const I32 grows    = PL_op->op_private & OPpTRANS_GROWS;
-    SV* rv = (SV*)cSVOP->op_sv;
-    HV* hv = (HV*)SvRV(rv);
+    SV * const rv = (SV*)cSVOP->op_sv;
+    HV * const hv = (HV*)SvRV(rv);
     SV** svp = hv_fetch(hv, "NONE", 4, FALSE);
     const UV none = svp ? SvUV(*svp) : 0x7fffffff;
     const UV extra = none + 1;
@@ -456,7 +456,8 @@ S_do_trans_complex_utf8(pTHX_ SV *sv)
     U8 *s = (U8*)SvPV(sv, len);
     const I32 isutf8 = SvUTF8(sv);
     if (!isutf8) {
-       const U8 *t = s, *e = s + len;
+       const U8 *t = s;
+       const U8 * const e = s + len;
        while (t < e) {
            const U8 ch = *t++;
            if ((hibit = !NATIVE_IS_INVARIANT(ch)))
@@ -643,7 +644,7 @@ Perl_do_trans(pTHX_ SV *sv)
 void
 Perl_do_join(pTHX_ register SV *sv, SV *del, register SV **mark, register SV 
**sp)
 {
-    SV **oldmark = mark;
+    SV ** const oldmark = mark;
     register I32 items = sp - mark;
     register STRLEN len;
     STRLEN delimlen;
@@ -700,7 +701,7 @@ void
 Perl_do_sprintf(pTHX_ SV *sv, I32 len, SV **sarg)
 {
     STRLEN patlen;
-    const char *pat = SvPV_const(*sarg, patlen);
+    const char * const pat = SvPV_const(*sarg, patlen);
     bool do_taint = FALSE;
 
     SvUTF8_off(sv);
diff -pur bleadperl/embed.fnc bw/trunk/embed.fnc
--- bleadperl/embed.fnc 2005-06-20 05:16:05.000000000 -0500
+++ bw/trunk/embed.fnc  2005-06-20 09:44:18.000000000 -0500
@@ -114,14 +114,14 @@ p |void   |boot_core_UNIVERSAL
 p      |void   |boot_core_PerlIO
 Ap     |void   |call_list      |I32 oldscope|NN AV* av_list
 pR     |bool   |cando          |Mode_t mode|Uid_t effective|NN const Stat_t* 
statbufp
-Ap     |U32    |cast_ulong     |NV f
-Ap     |I32    |cast_i32       |NV f
-Ap     |IV     |cast_iv        |NV f
-Ap     |UV     |cast_uv        |NV f
+ApR    |U32    |cast_ulong     |NV f
+ApR    |I32    |cast_i32       |NV f
+ApR    |IV     |cast_iv        |NV f
+ApR    |UV     |cast_uv        |NV f
 #if !defined(HAS_TRUNCATE) && !defined(HAS_CHSIZE) && defined(F_FREESP)
-Ap     |I32    |my_chsize      |int fd|Off_t length
+ApR    |I32    |my_chsize      |int fd|Off_t length
 #endif
-p      |OP*    |convert        |I32 optype|I32 flags|OP* o
+pR     |OP*    |convert        |I32 optype|I32 flags|OP* o
 Afprd  |void   |croak          |const char* pat|...
 Apr    |void   |vcroak         |const char* pat|va_list* args
 #if defined(PERL_IMPLICIT_CONTEXT)
@@ -245,15 +245,15 @@ p |char*  |getenv_len     |const char* key|un
 #endif
 Ap     |void   |gp_free        |GV* gv
 Ap     |GP*    |gp_ref         |GP* gp
-Ap     |GV*    |gv_AVadd       |GV* gv
-Ap     |GV*    |gv_HVadd       |GV* gv
-Ap     |GV*    |gv_IOadd       |GV* gv
+Ap     |GV*    |gv_AVadd       |NN GV* gv
+Ap     |GV*    |gv_HVadd       |NN GV* gv
+Ap     |GV*    |gv_IOadd       |NN GV* gv
 ApR    |GV*    |gv_autoload4   |HV* stash|NN const char* name|STRLEN len|I32 
method
 Ap     |void   |gv_check       |HV* stash
 Ap     |void   |gv_efullname   |SV* sv|const GV* gv
 Apmb   |void   |gv_efullname3  |SV* sv|const GV* gv|const char* prefix
 Ap     |void   |gv_efullname4  |SV* sv|const GV* gv|const char* prefix|bool 
keepmain
-Ap     |GV*    |gv_fetchfile   |const char* name
+Ap     |GV*    |gv_fetchfile   |NN const char* name
 Apd    |GV*    |gv_fetchmeth   |HV* stash|const char* name|STRLEN len \
                                |I32 level
 Apd    |GV*    |gv_fetchmeth_autoload  |HV* stash|const char* name|STRLEN len \
@@ -265,7 +265,7 @@ Ap  |GV*    |gv_fetchpv     |const char* name|I3
 Ap     |void   |gv_fullname    |SV* sv|const GV* gv
 Apmb   |void   |gv_fullname3   |SV* sv|const GV* gv|const char* prefix
 Ap     |void   |gv_fullname4   |SV* sv|const GV* gv|const char* prefix|bool 
keepmain
-Ap     |void   |gv_init        |GV* gv|HV* stash|const char* name \
+Ap     |void   |gv_init        |NN GV* gv|NN HV* stash|NN const char* name \
                                |STRLEN len|int multi
 Apd    |HV*    |gv_stashpv     |const char* name|I32 create
 Apd    |HV*    |gv_stashpvn    |const char* name|U32 namelen|I32 create
@@ -639,9 +639,10 @@ p  |void   |rxres_save     |NN void** rsp|NN RE
 #if !defined(HAS_RENAME)
 p      |I32    |same_dirent    |NN const char* a|NN const char* b
 #endif
-Apd    |char*  |savepv         |const char* pv
-Apd    |char*  |savesharedpv   |const char* pv
-Apd    |char*  |savepvn        |const char* pv|I32 len
+Apda   |char*  |savepv         |NN const char* pv
+Apda   |char*  |savepvn        |NN const char* pv|I32 len
+Apda   |char*  |savesharedpv   |const char* pv
+Apda   |char*  |savesvpv       |NN SV* sv
 Ap     |void   |savestack_grow
 Ap     |void   |savestack_grow_cnt     |I32 need
 Ap     |void   |save_aelem     |const AV* av|I32 idx|SV **sptr
@@ -934,22 +935,22 @@ Apr       |void   |newMYSUB       |I32 floor|OP *o|OP 
 p      |OP *   |my_attrs       |NN OP *o|OP *attrs
 p      |void   |boot_core_xsutils
 #if defined(USE_ITHREADS)
-Ap     |PERL_CONTEXT*|cx_dup   |PERL_CONTEXT* cx|I32 ix|I32 max|CLONE_PARAMS* 
param
-Ap     |PERL_SI*|si_dup        |PERL_SI* si|CLONE_PARAMS* param
-Ap     |ANY*   |ss_dup         |PerlInterpreter* proto_perl|CLONE_PARAMS* param
-Ap     |void*  |any_dup        |void* v|PerlInterpreter* proto_perl
-Ap     |HE*    |he_dup         |HE* e|bool shared|CLONE_PARAMS* param
-Ap     |HEK*   |hek_dup        |HEK* e|CLONE_PARAMS* param
-Ap     |REGEXP*|re_dup         |REGEXP* r|CLONE_PARAMS* param
-Ap     |PerlIO*|fp_dup         |PerlIO* fp|char type|CLONE_PARAMS* param
-Ap     |DIR*   |dirp_dup       |DIR* dp
-Ap     |GP*    |gp_dup         |GP* gp|CLONE_PARAMS* param
-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
-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
+Apa    |PERL_CONTEXT*|cx_dup   |PERL_CONTEXT* cx|I32 ix|I32 max|CLONE_PARAMS* 
param
+Apa    |PERL_SI*|si_dup        |PERL_SI* si|CLONE_PARAMS* param
+Apa    |ANY*   |ss_dup         |NN PerlInterpreter* proto_perl|CLONE_PARAMS* 
param
+Apa    |void*  |any_dup        |void* v|NN const PerlInterpreter* proto_perl
+Apa    |HE*    |he_dup         |HE* e|bool shared|CLONE_PARAMS* param
+Apa    |HEK*   |hek_dup        |HEK* e|CLONE_PARAMS* param
+Apa    |REGEXP*|re_dup         |const REGEXP* r|CLONE_PARAMS* param
+Apa    |PerlIO*|fp_dup         |PerlIO* fp|char type|CLONE_PARAMS* param
+Apa    |DIR*   |dirp_dup       |DIR* dp
+Apa    |GP*    |gp_dup         |GP* gp|CLONE_PARAMS* param
+Apa    |MAGIC* |mg_dup         |NN MAGIC* mg|CLONE_PARAMS* param
+Apa    |SV*    |sv_dup         |NN SV* sstr|CLONE_PARAMS* param
+Ap     |void   |rvpv_dup       |NN SV* dstr|NN SV *sstr|CLONE_PARAMS* param
+Apa    |PTR_TBL_t*|ptr_table_new
+Apa    |void*  |ptr_table_fetch|NN PTR_TBL_t *tbl|NN const void *sv
+Ap     |void   |ptr_table_store|NN PTR_TBL_t *tbl|const void *oldsv|NN 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
@@ -962,8 +963,8 @@ Ap  |void   |sys_intern_clear
 Ap     |void   |sys_intern_init
 #endif
 
-Ap     |char * |custom_op_name |NN const OP* op
-Ap     |char * |custom_op_desc |NN const OP* op
+ApR    |char * |custom_op_name |NN const OP* op
+ApR    |char * |custom_op_desc |NN const OP* op
 
 #if defined(PERL_OLD_COPY_ON_WRITE)
 pMX    |int    |sv_release_IVX |SV *sv
@@ -977,30 +978,30 @@ Adp       |int    |nothreadhook
 END_EXTERN_C
 
 #if defined(PERL_IN_DOOP_C) || defined(PERL_DECL_PROT)
-s      |I32    |do_trans_simple        |NN SV *sv
-s      |I32    |do_trans_count         |NN SV *sv
-s      |I32    |do_trans_complex       |NN SV *sv
-s      |I32    |do_trans_simple_utf8   |NN SV *sv
-s      |I32    |do_trans_count_utf8    |NN SV *sv
-s      |I32    |do_trans_complex_utf8  |NN SV *sv
+sR     |I32    |do_trans_simple        |NN SV *sv
+sR     |I32    |do_trans_count         |NN SV *sv
+sR     |I32    |do_trans_complex       |NN SV *sv
+sR     |I32    |do_trans_simple_utf8   |NN SV *sv
+sR     |I32    |do_trans_count_utf8    |NN SV *sv
+sR     |I32    |do_trans_complex_utf8  |NN SV *sv
 #endif
 
 #if defined(PERL_IN_GV_C) || defined(PERL_DECL_PROT)
-s      |void   |gv_init_sv     |GV *gv|I32 sv_type
+s      |void   |gv_init_sv     |NN GV *gv|I32 sv_type
 s      |void   |require_errno  |NN GV *gv
 #endif
 
 #if defined(PERL_IN_HV_C) || defined(PERL_DECL_PROT)
-s      |void   |hsplit         |HV *hv
+s      |void   |hsplit         |NN HV *hv
 s      |void   |hfreeentries   |HV *hv
-sR     |HE*    |new_he
+sa     |HE*    |new_he
 s      |void   |del_he         |NN HE *p
-sR     |HEK*   |save_hek_flags |NN const char *str|I32 len|U32 hash|int flags
+sa     |HEK*   |save_hek_flags |NN const char *str|I32 len|U32 hash|int flags
 s      |void   |hv_magic_check |NN HV *hv|NN bool *needs_copy|NN bool 
*needs_store
 s      |void   |unshare_hek_or_pvn|const HEK* hek|const char* str|I32 len|U32 
hash
 sR     |HEK*   |share_hek_flags|const char* sv|I32 len|U32 hash|int flags
 rs     |void   |hv_notallowed  |int flags|NN const char *key|I32 klen|NN const 
char *msg
-s      |struct xpvhv_aux*|hv_auxinit|HV *hv
+s      |struct xpvhv_aux*|hv_auxinit|NN HV *hv
 sM     |SV*    |hv_delete_common|HV* tb|SV* key_sv|const char* key|STRLEN 
klen|int k_flags|I32 d_flags|U32 hash
 sM     |HE*    |hv_fetch_common|HV* tb|SV* key_sv|const char* key|STRLEN 
klen|int flags|int action|SV* val|U32 hash
 #endif
@@ -1507,7 +1508,6 @@ Ap        |GV*    |gv_fetchpvn_flags|const char* n
 Ap     |GV*    |gv_fetchsv|SV *name|I32 flags|I32 sv_type
 dpR    |bool   |is_gv_magical_sv|SV *name|U32 flags
 
-Apda   |char*  |savesvpv       |NN SV* sv
 ApR    |bool   |stashpv_hvname_match|NN const COP *cop|NN const HV *hv
 
 END_EXTERN_C
diff -pur bleadperl/gv.c bw/trunk/gv.c
--- bleadperl/gv.c      2005-06-20 06:31:38.000000000 -0500
+++ bw/trunk/gv.c       2005-06-20 09:18:22.000000000 -0500
@@ -1327,13 +1327,13 @@ Perl_gp_free(pTHX_ GV *gv)
 int
 Perl_magic_freeovrld(pTHX_ SV *sv, MAGIC *mg)
 {
-    AMT *amtp = (AMT*)mg->mg_ptr;
-    (void)sv;
+    AMT * const amtp = (AMT*)mg->mg_ptr;
+    PERL_UNUSED_ARG(sv);
 
     if (amtp && AMT_AMAGIC(amtp)) {
        int i;
        for (i = 1; i < NofAMmeth; i++) {
-           CV *cv = amtp->table[i];
+           CV * const cv = amtp->table[i];
            if (cv != Nullcv) {
                SvREFCNT_dec((SV *) cv);
                amtp->table[i] = Nullcv;
@@ -1348,10 +1348,8 @@ Perl_magic_freeovrld(pTHX_ SV *sv, MAGIC
 bool
 Perl_Gv_AMupdate(pTHX_ HV *stash)
 {
-  GV* gv;
-  CV* cv;
-  MAGIC* mg=mg_find((SV*)stash, PERL_MAGIC_overload_table);
-  AMT *amtp = (mg) ? (AMT*)mg->mg_ptr: (AMT *) NULL;
+  MAGIC* const mg = mg_find((SV*)stash, PERL_MAGIC_overload_table);
+  AMT * const amtp = (mg) ? (AMT*)mg->mg_ptr: (AMT *) NULL;
   AMT amt;
 
   if (mg && amtp->was_ok_am == PL_amagic_generation
@@ -1370,14 +1368,13 @@ Perl_Gv_AMupdate(pTHX_ HV *stash)
   {
     int filled = 0, have_ovl = 0;
     int i, lim = 1;
-    SV* sv = NULL;
 
     /* Work with "fallback" key, which we assume to be first in PL_AMG_names */
 
     /* Try to find via inheritance. */
-    gv = gv_fetchmeth(stash, PL_AMG_names[0], 2, -1);
-    if (gv)
-       sv = GvSV(gv);
+    GV *gv = gv_fetchmeth(stash, PL_AMG_names[0], 2, -1);
+    SV * const sv = gv ? GvSV(gv) : NULL;
+    CV* cv;
 
     if (!gv)
        lim = DESTROY_amg;              /* Skip overloading entries. */
diff -pur bleadperl/mg.c bw/trunk/mg.c
--- bleadperl/mg.c      2005-06-20 06:31:38.000000000 -0500
+++ bw/trunk/mg.c       2005-06-20 09:18:22.000000000 -0500
@@ -1670,6 +1670,7 @@ Perl_magic_setarylen(pTHX_ SV *sv, MAGIC
 int
 Perl_magic_freearylen_p(pTHX_ SV *sv, MAGIC *mg)
 {
+    PERL_UNUSED_ARG(sv);
     /* during global destruction, mg_obj may already have been freed */
     if (PL_in_clean_all)
        return 0;
diff -pur bleadperl/pad.c bw/trunk/pad.c
--- bleadperl/pad.c     2005-06-08 05:38:07.000000000 -0500
+++ bw/trunk/pad.c      2005-06-20 10:03:17.000000000 -0500
@@ -248,12 +248,12 @@ Perl_pad_undef(pTHX_ CV* cv)
      * children, or integrate this loop with general cleanup */
 
     if (!PL_dirty) { /* don't bother during global destruction */
-       CV *outercv = CvOUTSIDE(cv);
+       CV * const outercv = CvOUTSIDE(cv);
         const U32 seq = CvOUTSIDE_SEQ(cv);
-       AV *comppad_name = (AV*)AvARRAY(padlist)[0];
-       SV **namepad = AvARRAY(comppad_name);
-       AV *comppad = (AV*)AvARRAY(padlist)[1];
-       SV **curpad = AvARRAY(comppad);
+       AV *  const comppad_name = (AV*)AvARRAY(padlist)[0];
+       SV ** const namepad = AvARRAY(comppad_name);
+       AV *  const comppad = (AV*)AvARRAY(padlist)[1];
+       SV ** const curpad = AvARRAY(comppad);
        for (ix = AvFILLp(comppad_name); ix > 0; ix--) {
            SV * const namesv = namepad[ix];
            if (namesv && namesv != &PL_sv_undef
@@ -293,7 +293,7 @@ Perl_pad_undef(pTHX_ CV* cv)
 
     ix = AvFILLp(padlist);
     while (ix >= 0) {
-       SV* sv = AvARRAY(padlist)[ix--];
+       SV* const sv = AvARRAY(padlist)[ix--];
        if (!sv)
            continue;
        if (sv == (SV*)PL_comppad_name)
@@ -330,7 +330,7 @@ PADOFFSET
 Perl_pad_add_name(pTHX_ const char *name, HV* typestash, HV* ourstash, bool 
fake)
 {
     const PADOFFSET offset = pad_alloc(OP_PADSV, SVs_PADMY);
-    SV* namesv = NEWSV(1102, 0);
+    SV* const namesv = NEWSV(1102, 0);
 
     ASSERT_CURPAD_ACTIVE("pad_add_name");
 
@@ -411,7 +411,7 @@ Perl_pad_alloc(pTHX_ I32 optype, U32 tmp
        retval = AvFILLp(PL_comppad);
     }
     else {
-       SV **names = AvARRAY(PL_comppad_name);
+       SV ** const names = AvARRAY(PL_comppad_name);
         const SSize_t names_fill = AvFILLp(PL_comppad_name);
        for (;;) {
            /*
@@ -498,7 +498,7 @@ C<is_our> indicates that the name to che
 void
 Perl_pad_check_dup(pTHX_ const char *name, bool is_our, const HV *ourstash)
 {
-    SV         **svp, *sv;
+    SV         **svp;
     PADOFFSET  top, off;
 
     ASSERT_CURPAD_ACTIVE("pad_check_dup");
@@ -511,7 +511,8 @@ Perl_pad_check_dup(pTHX_ const char *nam
     /* XXX DAPM - why the (I32) cast - shouldn't we ensure they're the same
      * type ? */
     for (off = top; (I32)off > PL_comppad_name_floor; off--) {
-       if ((sv = svp[off])
+       SV * const sv = svp[off];
+       if (sv
            && sv != &PL_sv_undef
            && !SvFAKE(sv)
            && (SvIVX(sv) == PAD_MAX || SvIVX(sv) == 0)
@@ -531,7 +532,8 @@ Perl_pad_check_dup(pTHX_ const char *nam
     /* check the rest of the pad */
     if (is_our) {
        do {
-           if ((sv = svp[off])
+           SV * const sv = svp[off];
+           if (sv
                && sv != &PL_sv_undef
                && !SvFAKE(sv)
                && (SvIVX(sv) == PAD_MAX || SvIVX(sv) == 0)
@@ -809,8 +811,8 @@ S_pad_findlex(pTHX_ const char *name, co
 
     {
        SV *new_namesv;
-       AV *ocomppad_name = PL_comppad_name;
-       PAD *ocomppad = PL_comppad;
+       AV *  const ocomppad_name = PL_comppad_name;
+       PAD * const ocomppad = PL_comppad;
        PL_comppad_name = (AV*)AvARRAY(padlist)[0];
        PL_comppad = (AV*)AvARRAY(padlist)[1];
        PL_curpad = AvARRAY(PL_comppad);
@@ -950,7 +952,6 @@ U32
 Perl_intro_my(pTHX)
 {
     SV **svp;
-    SV *sv;
     I32 i;
 
     ASSERT_CURPAD_ACTIVE("intro_my");
@@ -959,9 +960,9 @@ Perl_intro_my(pTHX)
 
     svp = AvARRAY(PL_comppad_name);
     for (i = PL_min_intro_pending; i <= PL_max_intro_pending; i++) {
-       if ((sv = svp[i]) && sv != &PL_sv_undef
-               && !SvFAKE(sv) && !SvIVX(sv))
-       {
+       SV * const sv = svp[i];
+
+       if (sv && sv != &PL_sv_undef && !SvFAKE(sv) && !SvIVX(sv)) {
            SvIV_set(sv, PAD_MAX);      /* Don't know scope end yet. */
            SvNV_set(sv, (NV)PL_cop_seqmax);
            DEBUG_Xv(PerlIO_printf(Perl_debug_log,
@@ -992,15 +993,15 @@ void
 Perl_pad_leavemy(pTHX)
 {
     I32 off;
-    SV **svp = AvARRAY(PL_comppad_name);
+    SV ** const svp = AvARRAY(PL_comppad_name);
 
     PL_pad_reset_pending = FALSE;
 
     ASSERT_CURPAD_ACTIVE("pad_leavemy");
     if (PL_min_intro_pending && PL_comppad_name_fill < PL_min_intro_pending) {
        for (off = PL_max_intro_pending; off >= PL_min_intro_pending; off--) {
-            const SV *sv;
-           if ((sv = svp[off]) && sv != &PL_sv_undef
+           const SV * const sv = svp[off];
+           if (sv && sv != &PL_sv_undef
                    && !SvFAKE(sv) && ckWARN_d(WARN_INTERNAL))
                Perl_warner(aTHX_ packWARN(WARN_INTERNAL),
                                        "%"SVf" never introduced", sv);
@@ -1008,10 +1009,8 @@ Perl_pad_leavemy(pTHX)
     }
     /* "Deintroduce" my variables that are leaving with this scope. */
     for (off = AvFILLp(PL_comppad_name); off > PL_comppad_name_fill; off--) {
-        const SV *sv;
-       if ((sv = svp[off]) && sv != &PL_sv_undef
-               && !SvFAKE(sv) && SvIVX(sv) == PAD_MAX)
-       {
+       const SV * const sv = svp[off];
+       if (sv && sv != &PL_sv_undef && !SvFAKE(sv) && SvIVX(sv) == PAD_MAX) {
            SvIV_set(sv, PL_cop_seqmax);
            DEBUG_Xv(PerlIO_printf(Perl_debug_log,
                "Pad leavemy: %ld \"%s\", (%ld,%ld)\n",
@@ -1153,7 +1152,7 @@ Perl_pad_tidy(pTHX_ padtidy_type type)
        av_store(PL_comppad_name, AvFILLp(PL_comppad), Nullsv);
 
     if (type == padtidy_SUBCLONE) {
-       SV **namep = AvARRAY(PL_comppad_name);
+       SV ** const namep = AvARRAY(PL_comppad_name);
        PADOFFSET ix;
 
        for (ix = AvFILLp(PL_comppad); ix > 0; ix--) {
@@ -1177,7 +1176,7 @@ Perl_pad_tidy(pTHX_ padtidy_type type)
     }
     else if (type == padtidy_SUB) {
        /* XXX DAPM this same bit of code keeps appearing !!! Rationalise? */
-       AV *av = newAV();                       /* Will be @_ */
+       AV * const av = newAV();                        /* Will be @_ */
        av_extend(av, 0);
        av_store(PL_comppad, 0, (SV*)av);
        AvREIFY_only(av);
@@ -1332,8 +1331,8 @@ dump the contents of a CV
 STATIC void
 S_cv_dump(pTHX_ const CV *cv, const char *title)
 {
-    const CV *outside = CvOUTSIDE(cv);
-    AV* padlist = CvPADLIST(cv);
+    const CV * const outside = CvOUTSIDE(cv);
+    AV* const padlist = CvPADLIST(cv);
 
     PerlIO_printf(Perl_debug_log,
                  "  %s: CV=0x%"UVxf" (%s), OUTSIDE=0x%"UVxf" (%s)\n",
@@ -1376,11 +1375,11 @@ Perl_cv_clone(pTHX_ CV *proto)
 {
     dVAR;
     I32 ix;
-    AV* protopadlist = CvPADLIST(proto);
-    const AV* protopad_name = (AV*)*av_fetch(protopadlist, 0, FALSE);
-    const AV* protopad = (AV*)*av_fetch(protopadlist, 1, FALSE);
-    SV** pname = AvARRAY(protopad_name);
-    SV** ppad = AvARRAY(protopad);
+    AV* const protopadlist = CvPADLIST(proto);
+    const AV* const protopad_name = (AV*)*av_fetch(protopadlist, 0, FALSE);
+    const AV* const protopad = (AV*)*av_fetch(protopadlist, 1, FALSE);
+    SV** const pname = AvARRAY(protopad_name);
+    SV** const ppad = AvARRAY(protopad);
     const I32 fname = AvFILLp(protopad_name);
     const I32 fpad = AvFILLp(protopad);
     CV* cv;
@@ -1440,7 +1439,7 @@ Perl_cv_clone(pTHX_ CV *proto)
     outpad = AvARRAY(AvARRAY(CvPADLIST(outside))[depth]);
 
     for (ix = fpad; ix > 0; ix--) {
-       SV* namesv = (ix <= fname) ? pname[ix] : Nullsv;
+       SV* const namesv = (ix <= fname) ? pname[ix] : Nullsv;
        SV *sv = Nullsv;
        if (namesv && namesv != &PL_sv_undef) { /* lexical */
            if (SvFAKE(namesv)) {   /* lexical from outside? */
@@ -1526,8 +1525,8 @@ Perl_pad_fixup_inner_anons(pTHX_ PADLIST
     I32 ix;
     AV * const comppad_name = (AV*)AvARRAY(padlist)[0];
     AV * const comppad = (AV*)AvARRAY(padlist)[1];
-    SV **namepad = AvARRAY(comppad_name);
-    SV **curpad = AvARRAY(comppad);
+    SV ** const namepad = AvARRAY(comppad_name);
+    SV ** const curpad = AvARRAY(comppad);
     for (ix = AvFILLp(comppad_name); ix > 0; ix--) {
         const SV *namesv = namepad[ix];
        if (namesv && namesv != &PL_sv_undef
diff -pur bleadperl/perl.h bw/trunk/perl.h
--- bleadperl/perl.h    2005-06-18 12:03:29.000000000 -0500
+++ bw/trunk/perl.h     2005-06-18 23:34:36.000000000 -0500
@@ -210,16 +210,17 @@
  * for silencing unused variables that are actually used most of the time,
  * but we cannot quite get rid of, such as "ax" in PPCODE+noargs xsubs
  */
-#define PERL_UNUSED_VAR(var) ((void)var)
-
-#ifndef LINT_UNUSED_ARG
+#ifndef PERL_UNUSED_ARG
 #  ifdef lint
 #    include <note.h>
-#    define LINT_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
+#    define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
 #  else
-#    define LINT_UNUSED_ARG(x)
+#    define PERL_UNUSED_ARG(x) ((void)x)
 #  endif
 #endif
+#ifndef PERL_UNUSED_VAR
+#  define PERL_UNUSED_VAR(x) ((void)x)
+#endif
 
 #define NOOP (void)0
 #define dNOOP extern int Perl___notused PERL_UNUSED_DECL
@@ -2825,7 +2826,7 @@ typedef I32 CHECKPOINT;
    body arenas  */
 struct ptr_tbl_ent {
     struct ptr_tbl_ent*                next;
-    void*                      oldval;
+    const void*                        oldval;
     void*                      newval;
 };
 
diff -pur bleadperl/sv.c bw/trunk/sv.c
--- bleadperl/sv.c      2005-06-20 06:31:38.000000000 -0500
+++ bw/trunk/sv.c       2005-06-20 10:06:49.000000000 -0500
@@ -286,8 +286,8 @@ S_del_sv(pTHX_ SV *p)
        SV* sva;
        bool ok = 0;
        for (sva = PL_sv_arenaroot; sva; sva = (SV *) SvANY(sva)) {
-           SV *sv = sva + 1;
-           SV *svend = &sva[SvREFCNT(sva)];
+           const SV * const sv = sva + 1;
+           const SV * const svend = &sva[SvREFCNT(sva)];
            if (p >= sv && p < svend) {
                ok = 1;
                break;
@@ -366,7 +366,7 @@ S_visit(pTHX_ SVFUNC_t f, U32 flags, U32
     I32 visited = 0;
 
     for (sva = PL_sv_arenaroot; sva; sva = (SV*)SvANY(sva)) {
-       register SV * const svend = &sva[SvREFCNT(sva)];
+       register const SV * const svend = &sva[SvREFCNT(sva)];
        register SV* sv;
        for (sv = sva + 1; sv < svend; ++sv) {
            if (SvTYPE(sv) != SVTYPEMASK
@@ -674,8 +674,6 @@ STATIC SV*
 S_varname(pTHX_ GV *gv, const char *gvtype, PADOFFSET targ,
        SV* keyname, I32 aindex, int subscript_type)
 {
-    AV *av;
-    SV *sv;
 
     SV * const name = sv_newmortal();
     if (gv) {
@@ -685,7 +683,7 @@ S_varname(pTHX_ GV *gv, const char *gvty
         * directly */
 
        const char *p;
-       HV *hv = GvSTASH(gv);
+       HV * const hv = GvSTASH(gv);
        sv_setpv(name, gvtype);
        if (!hv)
            p = "???";
@@ -705,8 +703,11 @@ S_varname(pTHX_ GV *gv, const char *gvty
            sv_catpvn(name,GvNAME(gv),GvNAMELEN(gv));
     }
     else {
-       U32 u;
-       CV *cv = find_runcv(&u);
+       U32 unused;
+       CV * const cv = find_runcv(&unused);
+       SV *sv;
+       AV *av;
+
        if (!cv || !CvPADLIST(cv))
            return Nullsv;;
        av = (AV*)(*av_fetch(CvPADLIST(cv), 0, FALSE));
@@ -716,6 +717,7 @@ S_varname(pTHX_ GV *gv, const char *gvty
     }
 
     if (subscript_type == FUV_SUBSCRIPT_HASH) {
+       SV *sv;
        *SvPVX(name) = '$';
        sv = NEWSV(0,0);
        Perl_sv_catpvf(aTHX_ name, "{%s}",
@@ -919,7 +921,7 @@ S_find_uninit_var(pTHX_ OP* obase, SV* u
            /* index is an expression;
             * attempt to find a match within the aggregate */
            if (obase->op_type == OP_HELEM) {
-               SV *keysv = S_find_hash_subscript(aTHX_ (HV*)sv, uninit_sv);
+               SV * const keysv = S_find_hash_subscript(aTHX_ (HV*)sv, 
uninit_sv);
                if (keysv)
                    return S_varname(aTHX_ gv, "%", o->op_targ,
                                                keysv, 0, FUV_SUBSCRIPT_HASH);
@@ -1079,7 +1081,7 @@ S_more_bodies (pTHX_ void **arena_root, 
 {
     char *start;
     const char *end;
-    size_t count = PERL_ARENA_SIZE/size;
+    const size_t count = PERL_ARENA_SIZE/size;
     New(0, start, count*size, char);
     *((void **) start) = *arena_root;
     *arena_root = (void *)start;
@@ -1094,7 +1096,7 @@ S_more_bodies (pTHX_ void **arena_root, 
     *root = (void *)start;
 
     while (start < end) {
-       char *next = start + size;
+       char * const next = start + size;
        *(void**) start = (void *)next;
        start = next;
     }
@@ -1285,7 +1287,7 @@ Perl_sv_upgrade(pTHX_ register SV *sv, U
     size_t     new_body_offset;
     void**     new_body_arena;
     void**     new_body_arenaroot;
-    U32                old_type = SvTYPE(sv);
+    const U32  old_type = SvTYPE(sv);
 
     if (mt != SVt_PV && SvIsCOW(sv)) {
        sv_force_normal_flags(sv, 0);
@@ -1598,7 +1600,7 @@ Perl_sv_backoff(pTHX_ register SV *sv)
     assert(SvTYPE(sv) != SVt_PVHV);
     assert(SvTYPE(sv) != SVt_PVAV);
     if (SvIVX(sv)) {
-       const char *s = SvPVX_const(sv);
+       const char * const s = SvPVX_const(sv);
        SvLEN_set(sv, SvLEN(sv) + SvIVX(sv));
        SvPV_set(sv, SvPVX(sv) - SvIVX(sv));
        SvIV_set(sv, 0);
@@ -3347,8 +3349,7 @@ void
 Perl_sv_copypv(pTHX_ SV *dsv, register SV *ssv)
 {
     STRLEN len;
-    const char *s;
-    s = SvPV_const(ssv,len);
+    const char * const s = SvPV_const(ssv,len);
     sv_setpvn(dsv,s,len);
     if (SvUTF8(ssv))
        SvUTF8_on(dsv);
@@ -3452,8 +3453,8 @@ Perl_sv_2bool(pTHX_ register SV *sv)
       return SvRV(sv) != 0;
     }
     if (SvPOKp(sv)) {
-       register XPV* Xpvtmp;
-       if ((Xpvtmp = (XPV*)SvANY(sv)) &&
+       register XPV* const Xpvtmp = (XPV*)SvANY(sv);
+       if (Xpvtmp &&
                (*sv->sv_u.svu_pv > '0' ||
                Xpvtmp->xpv_cur > 1 ||
                (Xpvtmp->xpv_cur && *sv->sv_u.svu_pv != '0')))
@@ -3547,13 +3548,13 @@ Perl_sv_utf8_upgrade_flags(pTHX_ registe
        int hibit = 0;
        
        while (t < e) {
-           U8 ch = *t++;
+           const U8 ch = *t++;
            if ((hibit = !NATIVE_IS_INVARIANT(ch)))
                break;
        }
        if (hibit) {
            STRLEN len = SvCUR(sv) + 1; /* Plus the \0 */
-           U8 *recoded = bytes_to_utf8((U8*)s, &len);
+           U8 * const recoded = bytes_to_utf8((U8*)s, &len);
 
            SvPV_free(sv); /* No longer using what was there before. */
 
@@ -8832,6 +8833,8 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const cha
     /* large enough for "%#.#f" --chip */
     /* what about long double NVs? --jhi */
 
+    PERL_UNUSED_ARG(maybe_tainted);
+
     /* no matter what, this is a string now */
     (void)SvPV_force(sv, origlen);
 
@@ -8840,7 +8843,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const cha
        return;
     if (patlen == 2 && pat[0] == '%' && pat[1] == 's') {
            if (args) {
-                const char *s = va_arg(*args, char*);
+               const char * const s = va_arg(*args, char*);
                sv_catpv(sv, s ? s : nullstr);
            }
            else if (svix < svmax) {
@@ -9728,7 +9731,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const cha
                       sv_utf8_upgrade(sv);
             }
             else {
-                 SV *nsv = sv_2mortal(newSVpvn(eptr, elen));
+                 SV * const nsv = sv_2mortal(newSVpvn(eptr, elen));
                  sv_utf8_upgrade(nsv);
                  eptr = SvPVX_const(nsv);
                  elen = SvCUR(nsv);
@@ -9744,6 +9747,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const cha
        SvGROW(sv, SvCUR(sv) + need + dotstrlen + 1);
        p = SvEND(sv);
        if (esignlen && fill == '0') {
+           int i;
            for (i = 0; i < (int)esignlen; i++)
                *p++ = esignbuf[i];
        }
@@ -9752,10 +9756,12 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const cha
            p += gap;
        }
        if (esignlen && fill != '0') {
+           int i;
            for (i = 0; i < (int)esignlen; i++)
                *p++ = esignbuf[i];
        }
        if (zeros) {
+           int i;
            for (i = zeros; i; i--)
                *p++ = '0';
        }
@@ -9831,7 +9837,7 @@ ptr_table_* functions.
    regcomp.c. AMS 20010712 */
 
 REGEXP *
-Perl_re_dup(pTHX_ REGEXP *r, CLONE_PARAMS *param)
+Perl_re_dup(pTHX_ const REGEXP *r, CLONE_PARAMS *param)
 {
     dVAR;
     REGEXP *ret;
@@ -9867,6 +9873,7 @@ Perl_re_dup(pTHX_ REGEXP *r, CLONE_PARAM
     if (r->data) {
        struct reg_data *d;
         const int count = r->data->count;
+       int i;
 
        Newc(0, d, sizeof(struct reg_data) + count*sizeof(void *),
                char, struct reg_data);
@@ -9949,7 +9956,8 @@ PerlIO *
 Perl_fp_dup(pTHX_ PerlIO *fp, char type, CLONE_PARAMS *param)
 {
     PerlIO *ret;
-    (void)type;
+
+    PERL_UNUSED_ARG(type);
 
     if (!fp)
        return (PerlIO*)NULL;
@@ -10108,7 +10116,7 @@ Perl_ptr_table_new(pTHX)
 /* map an existing pointer using a table */
 
 void *
-Perl_ptr_table_fetch(pTHX_ PTR_TBL_t *tbl, void *sv)
+Perl_ptr_table_fetch(pTHX_ PTR_TBL_t *tbl, const void *sv)
 {
     PTR_TBL_ENT_t *tblent;
     const UV hash = PTR_TABLE_HASH(sv);
@@ -10124,7 +10132,7 @@ Perl_ptr_table_fetch(pTHX_ PTR_TBL_t *tb
 /* add a new entry to a pointer-mapping table */
 
 void
-Perl_ptr_table_store(pTHX_ PTR_TBL_t *tbl, void *oldv, void *newv)
+Perl_ptr_table_store(pTHX_ PTR_TBL_t *tbl, const void *oldv, void *newv)
 {
     PTR_TBL_ENT_t *tblent, **otblent;
     /* XXX this may be pessimal on platforms where pointers aren't good
@@ -10854,7 +10862,7 @@ Perl_si_dup(pTHX_ PERL_SI *si, CLONE_PAR
  */
 
 void *
-Perl_any_dup(pTHX_ void *v, PerlInterpreter *proto_perl)
+Perl_any_dup(pTHX_ void *v, const PerlInterpreter *proto_perl)
 {
     void *ret;
 
@@ -10881,9 +10889,9 @@ Perl_any_dup(pTHX_ void *v, PerlInterpre
 ANY *
 Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param)
 {
-    ANY *ss    = proto_perl->Tsavestack;
-    I32 ix     = proto_perl->Tsavestack_ix;
-    I32 max    = proto_perl->Tsavestack_max;
+    ANY * const ss     = proto_perl->Tsavestack;
+    const I32 max      = proto_perl->Tsavestack_max;
+    I32 ix             = proto_perl->Tsavestack_ix;
     ANY *nss;
     SV *sv;
     GV *gv;
@@ -10897,7 +10905,6 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto
     char *c = NULL;
     void (*dptr) (void*);
     void (*dxptr) (pTHX_ void*);
-    OP *o;
 
     Newz(54, nss, max, ANY);
 
@@ -11030,6 +11037,7 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto
            ptr = POPPTR(ss,ix);
            if (ptr && (((OP*)ptr)->op_private & OPpREFCOUNTED)) {
                /* these are assumed to be refcounted properly */
+               OP *o;
                switch (((OP*)ptr)->op_type) {
                case OP_LEAVESUB:
                case OP_LEAVESUBLV:
@@ -11157,9 +11165,9 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto
 static void
 do_mark_cloneable_stash(pTHX_ SV *sv)
 {
-    const HEK *hvname = HvNAME_HEK((HV*)sv);
+    const HEK * const hvname = HvNAME_HEK((HV*)sv);
     if (hvname) {
-       GV* cloner = gv_fetchmethod_autoload((HV*)sv, "CLONE_SKIP", 0);
+       GV* const cloner = gv_fetchmethod_autoload((HV*)sv, "CLONE_SKIP", 0);
        SvFLAGS(sv) |= SVphv_CLONEABLE; /* clone objects by default */
        if (cloner && GvCV(cloner)) {
            dSP;
@@ -11485,7 +11493,7 @@ perl_clone_using(PerlInterpreter *proto_
     PL_regex_padav = newAV();
     {
        const I32 len = av_len((AV*)proto_perl->Iregex_padav);
-       SV** regexen = AvARRAY((AV*)proto_perl->Iregex_padav);
+       SV** const regexen = AvARRAY((AV*)proto_perl->Iregex_padav);
        IV i;
        av_push(PL_regex_padav,
                sv_dup_inc(regexen[0],param));
@@ -12007,8 +12015,8 @@ perl_clone_using(PerlInterpreter *proto_
        identified by sv_dup() above.
     */
     while(av_len(param->stashes) != -1) {
-        HV* stash = (HV*) av_shift(param->stashes);
-       GV* cloner = gv_fetchmethod_autoload(stash, "CLONE", 0);
+       HV* const stash = (HV*) av_shift(param->stashes);
+       GV* const cloner = gv_fetchmethod_autoload(stash, "CLONE", 0);
        if (cloner && GvCV(cloner)) {
            dSP;
            ENTER;
diff -pur bleadperl/universal.c bw/trunk/universal.c
--- bleadperl/universal.c       2005-06-16 10:03:38.000000000 -0500
+++ bw/trunk/universal.c        2005-06-17 11:00:35.000000000 -0500
@@ -819,7 +819,7 @@ XS(XS_Internals_hv_clear_placehold)
 
 XS(XS_Regexp_DESTROY)
 {
-    LINT_UNUSED_ARG(cv)
+    PERL_UNUSED_ARG(cv);
 }
 
 XS(XS_PerlIO_get_layers)
@@ -952,7 +952,7 @@ XS(XS_Internals_hash_seed)
     /* Using dXSARGS would also have dITEM and dSP,
      * which define 2 unused local variables.  */
     dAXMARK;
-    LINT_UNUSED_ARG(cv)
+    PERL_UNUSED_ARG(cv);
     PERL_UNUSED_VAR(mark);
     XSRETURN_UV(PERL_HASH_SEED);
 }
@@ -962,7 +962,7 @@ XS(XS_Internals_rehash_seed)
     /* Using dXSARGS would also have dITEM and dSP,
      * which define 2 unused local variables.  */
     dAXMARK;
-    LINT_UNUSED_ARG(cv)
+    PERL_UNUSED_ARG(cv);
     PERL_UNUSED_VAR(mark);
     XSRETURN_UV(PL_rehash_seed);
 }
diff -pur bleadperl/util.c bw/trunk/util.c
--- bleadperl/util.c    2005-06-16 10:38:46.000000000 -0500
+++ bw/trunk/util.c     2005-06-19 23:08:44.000000000 -0500
@@ -1051,9 +1051,9 @@ Perl_write_to_stderr(pTHX_ const char* m
     else {
 #ifdef USE_SFIO
        /* SFIO can really mess with your errno */
-       int e = errno;
+       const int e = errno;
 #endif
-       PerlIO *serr = Perl_error_log;
+       PerlIO * const serr = Perl_error_log;
 
        PERL_WRITE_MSG_TO_CONSOLE(serr, message, msglen);
        (void)PerlIO_flush(serr);
@@ -1254,21 +1254,18 @@ void
 Perl_vwarn(pTHX_ const char* pat, va_list *args)
 {
     dVAR;
-    const char *message;
-    HV *stash;
-    GV *gv;
-    CV *cv;
-    SV *msv;
     STRLEN msglen;
-    I32 utf8 = 0;
-
-    msv = vmess(pat, args);
-    utf8 = SvUTF8(msv);
-    message = SvPV_const(msv, msglen);
+    SV * const msv = vmess(pat, args);
+    const I32 utf8 = SvUTF8(msv);
+    const char * const message = SvPV_const(msv, msglen);
 
     if (PL_warnhook) {
        /* sv_2cv might call Perl_warn() */
-       SV *oldwarnhook = PL_warnhook;
+       SV * const oldwarnhook = PL_warnhook;
+       CV * cv;
+       HV * stash;
+       GV * gv;
+
        ENTER;
        SAVESPTR(PL_warnhook);
        PL_warnhook = Nullsv;
@@ -1446,7 +1443,8 @@ Perl_my_setenv(pTHX_ const char *nam, co
     setenv(nam, val, 1);
 #   else
     char *new_env;
-    int nlen = strlen(nam), vlen;
+    const int nlen = strlen(nam);
+    int vlen;
     if (!val) {
        val = "";
     }
@@ -1488,7 +1486,8 @@ Perl_my_setenv(pTHX_ const char *nam, co
 I32
 Perl_setenv_getix(pTHX_ const char *nam)
 {
-    register I32 i, len = strlen(nam);
+    register I32 i;
+    const register I32 len = strlen(nam);
 
     for (i = 0; environ[i]; i++) {
        if (
@@ -2758,7 +2757,7 @@ Perl_find_script(pTHX_ const char *scrip
     int extidx = 0, i = 0;
     const char *curext = Nullch;
 #else
-    (void)search_ext;
+    PERL_UNUSED_ARG(search_ext);
 #  define MAX_EXT_LEN 0
 #endif
 
@@ -3986,10 +3985,10 @@ Perl_new_version(pTHX_ SV *ver)
     if ( sv_derived_from(ver,"version") ) /* can just copy directly */
     {
        I32 key;
-       AV *av = newAV();
+       AV * const av = newAV();
        AV *sav;
        /* This will get reblessed later if a derived class*/
-       SV* hv = newSVrv(rv, "version"); 
+       SV*  const hv = newSVrv(rv, "version"); 
        (void)sv_upgrade(hv, SVt_PVHV); /* needs to be an HV type */
 #ifndef NODEFAULT_SHAREKEYS
        HvSHAREKEYS_on(hv);         /* key-sharing on by default */
@@ -4007,7 +4006,7 @@ Perl_new_version(pTHX_ SV *ver)
        
        if ( hv_exists((HV*)ver, "width", 5 ) )
        {
-           I32 width = SvIV(*hv_fetch((HV*)ver, "width", 5, FALSE));
+           const I32 width = SvIV(*hv_fetch((HV*)ver, "width", 5, FALSE));
            hv_store((HV *)hv, "width", 5, newSViv(width), 0);
        }
 
@@ -4101,7 +4100,7 @@ Perl_vnumify(pTHX_ SV *vs)
     I32 i, len, digit;
     int width;
     bool alpha = FALSE;
-    SV *sv = newSV(0);
+    SV * const sv = newSV(0);
     AV *av;
     if ( SvROK(vs) )
        vs = SvRV(vs);
@@ -4117,7 +4116,7 @@ Perl_vnumify(pTHX_ SV *vs)
 
     /* attempt to retrieve the version array */
     if ( !(av = (AV *)*hv_fetch((HV*)vs, "version", 7, FALSE) ) ) {
-       Perl_sv_catpv(aTHX_ sv,"0");
+       sv_catpvn(sv,"0",1);
        return sv;
     }
 
@@ -4134,8 +4133,8 @@ Perl_vnumify(pTHX_ SV *vs)
     {
        digit = SvIV(*av_fetch(av, i, 0));
        if ( width < 3 ) {
-           int denom = (int)pow(10,(3-width));
-           div_t term = div((int)PERL_ABS(digit),denom);
+           const int denom = (int)pow(10,(3-width));
+           const div_t term = div((int)PERL_ABS(digit),denom);
            Perl_sv_catpvf(aTHX_ sv,"%0*d_%d", width, term.quot, term.rem);
        }
        else {
@@ -4605,7 +4604,7 @@ some level of strict-ness.
 void
 Perl_sv_nosharing(pTHX_ SV *sv)
 {
-    (void)sv;
+    PERL_UNUSED_ARG(sv);
 }
 
 /*
@@ -4621,7 +4620,7 @@ some level of strict-ness.
 void
 Perl_sv_nolocking(pTHX_ SV *sv)
 {
-    (void)sv;
+    PERL_UNUSED_ARG(sv);
 }
 
 
@@ -4638,7 +4637,7 @@ some level of strict-ness.
 void
 Perl_sv_nounlocking(pTHX_ SV *sv)
 {
-    (void)sv;
+    PERL_UNUSED_ARG(sv);
 }
 
 U32
diff -pur bleadperl/XSUB.h bw/trunk/XSUB.h
--- bleadperl/XSUB.h    2005-06-16 10:03:38.000000000 -0500
+++ bw/trunk/XSUB.h     2005-06-17 23:17:05.000000000 -0500
@@ -82,14 +82,17 @@ is a lexical $_ in scope.
 =cut
 */
 
-#ifndef LINT_UNUSED_ARG
+#ifndef PERL_UNUSED_ARG
 #  ifdef lint
 #    include <note.h>
-#    define LINT_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
+#    define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
 #  else
-#    define LINT_UNUSED_ARG(x)
+#    define PERL_UNUSED_ARG(x) ((void)x)
 #  endif
 #endif
+#ifndef PERL_UNUSED_VAR
+#  define PERL_UNUSED_VAR(x) ((void)x)
+#endif
 
 #define ST(off) PL_stack_base[ax + (off)]
 
@@ -116,9 +119,14 @@ is a lexical $_ in scope.
 
 #define dITEMS I32 items = SP - MARK
 
-#define dXSARGS \
-       LINT_UNUSED_ARG(cv) \
+#ifdef lint
+#  define dXSARGS \
+       NOTE(ARGUNUSED(cv)) \
+       dSP; dAXMARK; dITEMS
+#else
+#  define dXSARGS \
        dSP; dAXMARK; dITEMS
+#endif
 
 #define dXSTARG SV * const targ = ((PL_op->op_private & OPpENTERSUB_HASTARG) \
                             ? PAD_SV(PL_op->op_targ) : sv_newmortal())

Reply via email to