From: Steve Hay Date: Thu, 6 Mar 2008 13:29:56 +0000 (+0000) Subject: Silence some warnings on Win32 with VC6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=31e9e0a31e04057108f257ef918a257afbb2e038;p=p5sagit%2Fp5-mst-13.2.git Silence some warnings on Win32 with VC6 VC7 onwards didn't seem to mind (perhaps thanks to #33411): http://www.nntp.perl.org/group/perl.daily-build.reports/2008/03/msg54118.html but VC6 wasn't happy: http://www.nntp.perl.org/group/perl.daily-build.reports/2008/03/msg54099.html p4raw-id: //depot/perl@33448 --- diff --git a/embed.fnc b/embed.fnc index 6c727bf..42991ad 100644 --- a/embed.fnc +++ b/embed.fnc @@ -1379,15 +1379,15 @@ sR |SV* |method_common |NN SV* meth|NULLOK U32* hashp #endif #if defined(PERL_IN_PP_SORT_C) || defined(PERL_DECL_PROT) -s |I32 |sv_ncmp |NN SV *a|NN SV *b -s |I32 |sv_i_ncmp |NN SV *a|NN SV *b -s |I32 |amagic_ncmp |NN SV *a|NN SV *b -s |I32 |amagic_i_ncmp |NN SV *a|NN SV *b -s |I32 |amagic_cmp |NN SV *str1|NN SV *str2 -s |I32 |amagic_cmp_locale|NN SV *str1|NN SV *str2 -s |I32 |sortcv |NN SV *a|NN SV *b -s |I32 |sortcv_xsub |NN SV *a|NN SV *b -s |I32 |sortcv_stacked |NN SV *a|NN SV *b +s |I32 |sv_ncmp |NN SV *const a|NN SV *const b +s |I32 |sv_i_ncmp |NN SV *const a|NN SV *const b +s |I32 |amagic_ncmp |NN SV *const a|NN SV *const b +s |I32 |amagic_i_ncmp |NN SV *const a|NN SV *const b +s |I32 |amagic_cmp |NN SV *const str1|NN SV *const str2 +s |I32 |amagic_cmp_locale|NN SV *const str1|NN SV *const str2 +s |I32 |sortcv |NN SV *const a|NN SV *const b +s |I32 |sortcv_xsub |NN SV *const a|NN SV *const b +s |I32 |sortcv_stacked |NN SV *const a|NN SV *const b s |void |qsortsvu |NULLOK SV** array|size_t num_elts|NN SVCOMPARE_t compare #endif diff --git a/perl.h b/perl.h index 65b3a72..87ad969 100644 --- a/perl.h +++ b/perl.h @@ -4649,7 +4649,7 @@ typedef regexp*(CPERLscope(*regdupe_t)) (pTHX_ const regexp* r, CLONE_PARAMS *pa typedef void (*DESTRUCTORFUNC_NOCONTEXT_t) (void*); typedef void (*DESTRUCTORFUNC_t) (pTHX_ void*); typedef void (*SVFUNC_t) (pTHX_ SV* const); -typedef I32 (*SVCOMPARE_t) (pTHX_ SV*, SV*); +typedef I32 (*SVCOMPARE_t) (pTHX_ SV* const, SV* const); typedef void (*XSINIT_t) (pTHX); typedef void (*ATEXIT_t) (pTHX_ void*); typedef void (*XSUBADDR_t) (pTHX_ CV *); diff --git a/pp_sort.c b/pp_sort.c index 1c12014..9fe0dad 100644 --- a/pp_sort.c +++ b/pp_sort.c @@ -340,7 +340,7 @@ typedef struct { static I32 -cmp_desc(pTHX_ gptr a, gptr b) +cmp_desc(pTHX_ gptr const a, gptr const b) { dVAR; return -PL_sort_RealCmp(aTHX_ a, b); @@ -1315,7 +1315,7 @@ S_qsortsvu(pTHX_ SV ** array, size_t num_elts, SVCOMPARE_t compare) static I32 -cmpindir(pTHX_ gptr a, gptr b) +cmpindir(pTHX_ gptr const a, gptr const b) { dVAR; gptr * const ap = (gptr *)a; @@ -1328,7 +1328,7 @@ cmpindir(pTHX_ gptr a, gptr b) } static I32 -cmpindir_desc(pTHX_ gptr a, gptr b) +cmpindir_desc(pTHX_ gptr const a, gptr const b) { dVAR; gptr * const ap = (gptr *)a; @@ -1738,7 +1738,7 @@ PP(pp_sort) } static I32 -S_sortcv(pTHX_ SV *a, SV *b) +S_sortcv(pTHX_ SV *const a, SV *const b) { dVAR; const I32 oldsaveix = PL_savestack_ix; @@ -1765,7 +1765,7 @@ S_sortcv(pTHX_ SV *a, SV *b) } static I32 -S_sortcv_stacked(pTHX_ SV *a, SV *b) +S_sortcv_stacked(pTHX_ SV *const a, SV *const b) { dVAR; const I32 oldsaveix = PL_savestack_ix; @@ -1807,7 +1807,7 @@ S_sortcv_stacked(pTHX_ SV *a, SV *b) } static I32 -S_sortcv_xsub(pTHX_ SV *a, SV *b) +S_sortcv_xsub(pTHX_ SV *const a, SV *const b) { dVAR; dSP; const I32 oldsaveix = PL_savestack_ix; @@ -1838,7 +1838,7 @@ S_sortcv_xsub(pTHX_ SV *a, SV *b) static I32 -S_sv_ncmp(pTHX_ SV *a, SV *b) +S_sv_ncmp(pTHX_ SV *const a, SV *const b) { const NV nv1 = SvNSIV(a); const NV nv2 = SvNSIV(b); @@ -1849,7 +1849,7 @@ S_sv_ncmp(pTHX_ SV *a, SV *b) } static I32 -S_sv_i_ncmp(pTHX_ SV *a, SV *b) +S_sv_i_ncmp(pTHX_ SV *const a, SV *const b) { const IV iv1 = SvIV(a); const IV iv2 = SvIV(b); @@ -1867,7 +1867,7 @@ S_sv_i_ncmp(pTHX_ SV *a, SV *b) #define SORT_NORMAL_RETURN_VALUE(val) (((val) > 0) ? 1 : ((val) ? -1 : 0)) static I32 -S_amagic_ncmp(pTHX_ register SV *a, register SV *b) +S_amagic_ncmp(pTHX_ register SV *const a, register SV *const b) { dVAR; SV * const tmpsv = tryCALL_AMAGICbin(a,b,ncmp); @@ -1888,7 +1888,7 @@ S_amagic_ncmp(pTHX_ register SV *a, register SV *b) } static I32 -S_amagic_i_ncmp(pTHX_ register SV *a, register SV *b) +S_amagic_i_ncmp(pTHX_ register SV *const a, register SV *const b) { dVAR; SV * const tmpsv = tryCALL_AMAGICbin(a,b,ncmp); @@ -1909,7 +1909,7 @@ S_amagic_i_ncmp(pTHX_ register SV *a, register SV *b) } static I32 -S_amagic_cmp(pTHX_ register SV *str1, register SV *str2) +S_amagic_cmp(pTHX_ register SV *const str1, register SV *const str2) { dVAR; SV * const tmpsv = tryCALL_AMAGICbin(str1,str2,scmp); @@ -1930,7 +1930,7 @@ S_amagic_cmp(pTHX_ register SV *str1, register SV *str2) } static I32 -S_amagic_cmp_locale(pTHX_ register SV *str1, register SV *str2) +S_amagic_cmp_locale(pTHX_ register SV *const str1, register SV *const str2) { dVAR; SV * const tmpsv = tryCALL_AMAGICbin(str1,str2,scmp); diff --git a/proto.h b/proto.h index 410b60a..474bec9 100644 --- a/proto.h +++ b/proto.h @@ -5011,55 +5011,55 @@ STATIC SV* S_method_common(pTHX_ SV* meth, U32* hashp) #endif #if defined(PERL_IN_PP_SORT_C) || defined(PERL_DECL_PROT) -STATIC I32 S_sv_ncmp(pTHX_ SV *a, SV *b) +STATIC I32 S_sv_ncmp(pTHX_ SV *const a, SV *const b) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); #define PERL_ARGS_ASSERT_SV_NCMP \ assert(a); assert(b) -STATIC I32 S_sv_i_ncmp(pTHX_ SV *a, SV *b) +STATIC I32 S_sv_i_ncmp(pTHX_ SV *const a, SV *const b) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); #define PERL_ARGS_ASSERT_SV_I_NCMP \ assert(a); assert(b) -STATIC I32 S_amagic_ncmp(pTHX_ SV *a, SV *b) +STATIC I32 S_amagic_ncmp(pTHX_ SV *const a, SV *const b) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); #define PERL_ARGS_ASSERT_AMAGIC_NCMP \ assert(a); assert(b) -STATIC I32 S_amagic_i_ncmp(pTHX_ SV *a, SV *b) +STATIC I32 S_amagic_i_ncmp(pTHX_ SV *const a, SV *const b) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); #define PERL_ARGS_ASSERT_AMAGIC_I_NCMP \ assert(a); assert(b) -STATIC I32 S_amagic_cmp(pTHX_ SV *str1, SV *str2) +STATIC I32 S_amagic_cmp(pTHX_ SV *const str1, SV *const str2) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); #define PERL_ARGS_ASSERT_AMAGIC_CMP \ assert(str1); assert(str2) -STATIC I32 S_amagic_cmp_locale(pTHX_ SV *str1, SV *str2) +STATIC I32 S_amagic_cmp_locale(pTHX_ SV *const str1, SV *const str2) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); #define PERL_ARGS_ASSERT_AMAGIC_CMP_LOCALE \ assert(str1); assert(str2) -STATIC I32 S_sortcv(pTHX_ SV *a, SV *b) +STATIC I32 S_sortcv(pTHX_ SV *const a, SV *const b) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); #define PERL_ARGS_ASSERT_SORTCV \ assert(a); assert(b) -STATIC I32 S_sortcv_xsub(pTHX_ SV *a, SV *b) +STATIC I32 S_sortcv_xsub(pTHX_ SV *const a, SV *const b) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); #define PERL_ARGS_ASSERT_SORTCV_XSUB \ assert(a); assert(b) -STATIC I32 S_sortcv_stacked(pTHX_ SV *a, SV *b) +STATIC I32 S_sortcv_stacked(pTHX_ SV *const a, SV *const b) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); #define PERL_ARGS_ASSERT_SORTCV_STACKED \