Change 33103 by [EMAIL PROTECTED] on 2008/01/29 10:53:24

        Subject: [PATCH] toke.c/universal.c: consting
        From: Steven Schubiger <[EMAIL PROTECTED]>
        Date: Mon, 28 Jan 2008 13:57:41 +0100
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/embed.fnc#565 edit
... //depot/perl/pod/perlapi.pod#315 edit
... //depot/perl/proto.h#899 edit
... //depot/perl/toke.c#815 edit
... //depot/perl/universal.c#185 edit

Differences ...

==== //depot/perl/embed.fnc#565 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#564~33089~   2008-01-28 05:32:40.000000000 -0800
+++ perl/embed.fnc      2008-01-29 02:53:24.000000000 -0800
@@ -183,8 +183,8 @@
 Ap     |char*  |delimcpy       |NN char* to|NN const char* toend|NN const 
char* from \
                                |NN const char* fromend|int delim|NN I32* retlen
 pM     |void   |delete_eval_scope
-p      |void   |deprecate      |NN const char* s
-p      |void   |deprecate_old  |NN const char* s
+p      |void   |deprecate      |NN const char *const s
+p      |void   |deprecate_old  |NN const char *const s
 Afp    |OP*    |die            |NULLOK const char* pat|...
 p      |OP*    |vdie           |NULLOK const char* pat|NULLOK va_list* args
 p      |OP*    |die_where      |NULLOK const char* message|STRLEN msglen
@@ -604,7 +604,7 @@
                                |I32 whileline|NULLOK OP* expr|NULLOK OP* 
block|NULLOK OP* cont \
                                |I32 has_my
 Apa    |PERL_SI*|new_stackinfo|I32 stitems|I32 cxitems
-Ap     |char*  |scan_vstring   |NN const char *vstr|NN const char *end|NN SV 
*sv
+Ap     |char*  |scan_vstring   |NN const char *vstr|NN const char *const 
end|NN SV *sv
 Apd    |const char*    |scan_version   |NN const char *vstr|NN SV *sv|bool qv
 Apd    |SV*    |new_version    |NN SV *ver
 Apd    |SV*    |upg_version    |NN SV *ver|bool qv
@@ -852,8 +852,8 @@
 Apd    |int    |getcwd_sv      |NN SV* sv
 Apd    |void   |sv_dec         |NN SV* sv
 Ap     |void   |sv_dump        |NN SV* sv
-ApdR   |bool   |sv_derived_from|NN SV* sv|NN const char* name
-ApdR   |bool   |sv_does        |NN SV* sv|NN const char* name
+ApdR   |bool   |sv_derived_from|NN SV* sv|NN const char *const name
+ApdR   |bool   |sv_does        |NN SV* sv|NN const char *const name
 Apd    |I32    |sv_eq          |NULLOK SV* sv1|NULLOK SV* sv2
 Apd    |void   |sv_free        |NULLOK SV* sv
 poMX   |void   |sv_free2       |NN SV* sv
@@ -989,11 +989,11 @@
 p      |void   |watch          |NN char** addr
 Ap     |I32    |whichsig       |NN const char* sig
 p      |void   |write_to_stderr|NN const char* message|int msglen
-p      |int    |yyerror        |NN const char* s
+p      |int    |yyerror        |NN const char *const s
 EXp    |int    |yylex
 p      |int    |yyparse
 p      |void   |parser_free    |NN const yy_parser *
-p      |int    |yywarn         |NN const char* s
+p      |int    |yywarn         |NN const char *const s
 #if defined(MYMALLOC)
 Ap     |void   |dump_mstats    |NN char* s
 Ap     |int    |get_mstats     |NN perl_mstats_t *buf|int buflen|int level
@@ -1555,19 +1555,19 @@
 s      |char*  |scan_word      |NN char *s|NN char *dest|STRLEN destlen \
                                |int allow_package|NN STRLEN *slp
 s      |void   |update_debugger_info|NULLOK SV *orig_sv \
-                               |NULLOK const char *buf|STRLEN len
+                               |NULLOK const char *const buf|STRLEN len
 sR     |char*  |skipspace      |NN char *s
 sR     |char*  |swallow_bom    |NN U8 *s
 s      |void   |checkcomma     |NN const char *s|NN const char *name \
                                |NN const char *what
-s      |bool   |feature_is_enabled|NN const char* name|STRLEN namelen
+s      |bool   |feature_is_enabled|NN const char *const name|STRLEN namelen
 s      |void   |force_ident    |NN const char *s|int kind
 s      |void   |incline        |NN const char *s
 s      |int    |intuit_method  |NN char *s|NULLOK GV *gv|NULLOK CV *cv
 s      |int    |intuit_more    |NN char *s
 s      |I32    |lop            |I32 f|int x|NN char *s
 rs     |void   |missingterm    |NULLOK char *s
-s      |void   |no_op          |NN const char *what|NULLOK char *s
+s      |void   |no_op          |NN const char *const what|NULLOK char *s
 sR     |I32    |sublex_done
 sR     |I32    |sublex_push
 sR     |I32    |sublex_start
@@ -1585,7 +1585,7 @@
 #  endif
 #  if defined(DEBUGGING)
 s      |int    |tokereport     |I32 rv|NN const YYSTYPE* lvalp
-s      |void   |printbuf       |NN const char* fmt|NN const char* s
+s      |void   |printbuf       |NN const char *const fmt|NN const char* s
 #  endif
 #endif
 

==== //depot/perl/pod/perlapi.pod#315 (text+w) ====
Index: perl/pod/perlapi.pod
--- perl/pod/perlapi.pod#314~33051~     2008-01-23 01:22:01.000000000 -0800
+++ perl/pod/perlapi.pod        2008-01-29 02:53:24.000000000 -0800
@@ -5047,7 +5047,7 @@
 I<at the C level>.  To check derivation at the Perl level, call C<isa()> as a
 normal Perl method.
 
-       bool    sv_derived_from(SV* sv, const char* name)
+       bool    sv_derived_from(SV* sv, const char *const name)
 
 =for hackers
 Found in file universal.c
@@ -5058,7 +5058,7 @@
 Returns a boolean indicating whether the SV performs a specific, named role.
 The SV can be a Perl object or the name of a Perl class.
 
-       bool    sv_does(SV* sv, const char* name)
+       bool    sv_does(SV* sv, const char *const name)
 
 =for hackers
 Found in file universal.c

==== //depot/perl/proto.h#899 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#898~33089~     2008-01-28 05:32:40.000000000 -0800
+++ perl/proto.h        2008-01-29 02:53:24.000000000 -0800
@@ -394,10 +394,10 @@
                        __attribute__nonnull__(pTHX_6);
 
 PERL_CALLCONV void     Perl_delete_eval_scope(pTHX);
-PERL_CALLCONV void     Perl_deprecate(pTHX_ const char* s)
+PERL_CALLCONV void     Perl_deprecate(pTHX_ const char *const s)
                        __attribute__nonnull__(pTHX_1);
 
-PERL_CALLCONV void     Perl_deprecate_old(pTHX_ const char* s)
+PERL_CALLCONV void     Perl_deprecate_old(pTHX_ const char *const s)
                        __attribute__nonnull__(pTHX_1);
 
 PERL_CALLCONV OP*      Perl_die(pTHX_ const char* pat, ...)
@@ -1662,7 +1662,7 @@
                        __attribute__malloc__
                        __attribute__warn_unused_result__;
 
-PERL_CALLCONV char*    Perl_scan_vstring(pTHX_ const char *vstr, const char 
*end, SV *sv)
+PERL_CALLCONV char*    Perl_scan_vstring(pTHX_ const char *vstr, const char 
*const end, SV *sv)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);
@@ -2290,12 +2290,12 @@
 PERL_CALLCONV void     Perl_sv_dump(pTHX_ SV* sv)
                        __attribute__nonnull__(pTHX_1);
 
-PERL_CALLCONV bool     Perl_sv_derived_from(pTHX_ SV* sv, const char* name)
+PERL_CALLCONV bool     Perl_sv_derived_from(pTHX_ SV* sv, const char *const 
name)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
-PERL_CALLCONV bool     Perl_sv_does(pTHX_ SV* sv, const char* name)
+PERL_CALLCONV bool     Perl_sv_does(pTHX_ SV* sv, const char *const name)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
@@ -2658,7 +2658,7 @@
 PERL_CALLCONV void     Perl_write_to_stderr(pTHX_ const char* message, int 
msglen)
                        __attribute__nonnull__(pTHX_1);
 
-PERL_CALLCONV int      Perl_yyerror(pTHX_ const char* s)
+PERL_CALLCONV int      Perl_yyerror(pTHX_ const char *const s)
                        __attribute__nonnull__(pTHX_1);
 
 PERL_CALLCONV int      Perl_yylex(pTHX);
@@ -2666,7 +2666,7 @@
 PERL_CALLCONV void     Perl_parser_free(pTHX_ const yy_parser *)
                        __attribute__nonnull__(pTHX_1);
 
-PERL_CALLCONV int      Perl_yywarn(pTHX_ const char* s)
+PERL_CALLCONV int      Perl_yywarn(pTHX_ const char *const s)
                        __attribute__nonnull__(pTHX_1);
 
 #if defined(MYMALLOC)
@@ -4096,7 +4096,7 @@
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_5);
 
-STATIC void    S_update_debugger_info(pTHX_ SV *orig_sv, const char *buf, 
STRLEN len);
+STATIC void    S_update_debugger_info(pTHX_ SV *orig_sv, const char *const 
buf, STRLEN len);
 STATIC char*   S_skipspace(pTHX_ char *s)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
@@ -4110,7 +4110,7 @@
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);
 
-STATIC bool    S_feature_is_enabled(pTHX_ const char* name, STRLEN namelen)
+STATIC bool    S_feature_is_enabled(pTHX_ const char *const name, STRLEN 
namelen)
                        __attribute__nonnull__(pTHX_1);
 
 STATIC void    S_force_ident(pTHX_ const char *s, int kind)
@@ -4131,7 +4131,7 @@
 STATIC void    S_missingterm(pTHX_ char *s)
                        __attribute__noreturn__;
 
-STATIC void    S_no_op(pTHX_ const char *what, char *s)
+STATIC void    S_no_op(pTHX_ const char *const what, char *s)
                        __attribute__nonnull__(pTHX_1);
 
 STATIC I32     S_sublex_done(pTHX)
@@ -4171,7 +4171,7 @@
 STATIC int     S_tokereport(pTHX_ I32 rv, const YYSTYPE* lvalp)
                        __attribute__nonnull__(pTHX_2);
 
-STATIC void    S_printbuf(pTHX_ const char* fmt, const char* s)
+STATIC void    S_printbuf(pTHX_ const char *const fmt, const char* s)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 

==== //depot/perl/toke.c#815 (text) ====
Index: perl/toke.c
--- perl/toke.c#814~33089~      2008-01-28 05:32:40.000000000 -0800
+++ perl/toke.c 2008-01-29 02:53:24.000000000 -0800
@@ -435,7 +435,7 @@
 /* print the buffer with suitable escapes */
 
 STATIC void
-S_printbuf(pTHX_ const char* fmt, const char* s)
+S_printbuf(pTHX_ const char *const fmt, const char *const s)
 {
     SV* const tmp = newSVpvs("");
     PerlIO_printf(Perl_debug_log, fmt, pv_display(tmp, s, strlen(s), 0, 60));
@@ -482,7 +482,7 @@
  */
 
 STATIC void
-S_no_op(pTHX_ const char *what, char *s)
+S_no_op(pTHX_ const char *const what, char *s)
 {
     dVAR;
     char * const oldbp = PL_bufptr;
@@ -567,7 +567,7 @@
  * Check whether the named feature is enabled.
  */
 STATIC bool
-S_feature_is_enabled(pTHX_ const char *name, STRLEN namelen)
+S_feature_is_enabled(pTHX_ const char *const name, STRLEN namelen)
 {
     dVAR;
     HV * const hinthv = GvHV(PL_hintgv);
@@ -583,14 +583,14 @@
  */
 
 void
-Perl_deprecate(pTHX_ const char *s)
+Perl_deprecate(pTHX_ const char *const s)
 {
     if (ckWARN(WARN_DEPRECATED))
        Perl_warner(aTHX_ packWARN(WARN_DEPRECATED), "Use of %s is deprecated", 
s);
 }
 
 void
-Perl_deprecate_old(pTHX_ const char *s)
+Perl_deprecate_old(pTHX_ const char *const s)
 {
     /* This function should NOT be called for any new deprecated warnings */
     /* Use Perl_deprecate instead                                         */
@@ -970,7 +970,7 @@
 #endif
 
 STATIC void
-S_update_debugger_info(pTHX_ SV *orig_sv, const char *buf, STRLEN len)
+S_update_debugger_info(pTHX_ SV *orig_sv, const char *const buf, STRLEN len)
 {
     AV *av = CopFILEAVx(PL_curcop);
     if (av) {
@@ -1348,7 +1348,7 @@
 }
 
 STATIC SV *
-S_newSV_maybe_utf8(pTHX_ const char *start, STRLEN len)
+S_newSV_maybe_utf8(pTHX_ const char *const start, STRLEN len)
 {
     dVAR;
     SV * const sv = newSVpvn_utf8(start, len,
@@ -10800,7 +10800,7 @@
 {
     PERL_UNUSED_CONTEXT;
     if (ch<256) {
-        char c = (char)ch;
+        const char c = (char)ch;
         switch (c) {
             CASE_STD_PMMOD_FLAGS_PARSE_SET(pmfl);
             case GLOBAL_PAT_MOD:    *pmfl |= PMf_GLOBAL; break;
@@ -12429,7 +12429,7 @@
 #pragma segment Perl_yylex
 #endif
 int
-Perl_yywarn(pTHX_ const char *s)
+Perl_yywarn(pTHX_ const char *const s)
 {
     dVAR;
     PL_in_eval |= EVAL_WARNONLY;
@@ -12439,7 +12439,7 @@
 }
 
 int
-Perl_yyerror(pTHX_ const char *s)
+Perl_yyerror(pTHX_ const char *const s)
 {
     dVAR;
     const char *where = NULL;
@@ -12719,7 +12719,7 @@
 */
 
 char *
-Perl_scan_vstring(pTHX_ const char *s, const char *e, SV *sv)
+Perl_scan_vstring(pTHX_ const char *s, const char *const e, SV *sv)
 {
     dVAR;
     const char *pos = s;

==== //depot/perl/universal.c#185 (text) ====
Index: perl/universal.c
--- perl/universal.c#184~32911~ 2008-01-09 02:54:27.000000000 -0800
+++ perl/universal.c    2008-01-29 02:53:24.000000000 -0800
@@ -91,7 +91,7 @@
 */
 
 bool
-Perl_sv_derived_from(pTHX_ SV *sv, const char *name)
+Perl_sv_derived_from(pTHX_ SV *sv, const char *const name)
 {
     dVAR;
     HV *stash;
@@ -131,7 +131,7 @@
 #include "XSUB.h"
 
 bool
-Perl_sv_does(pTHX_ SV *sv, const char *name)
+Perl_sv_does(pTHX_ SV *sv, const char *const name)
 {
     const char *classname;
     bool does_it;
End of Patch.

Reply via email to