Change 33231 by [EMAIL PROTECTED] on 2008/02/04 13:30:22

        Subject: [PATCH] sv.c: consting
        From: Steven Schubiger <[EMAIL PROTECTED]>
        Date: Sun, 3 Feb 2008 19:53:16 +0100
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/embed.fnc#569 edit
... //depot/perl/pod/perlintern.pod#71 edit
... //depot/perl/proto.h#903 edit
... //depot/perl/sv.c#1502 edit

Differences ...

==== //depot/perl/embed.fnc#569 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#568~33228~   2008-02-03 07:04:41.000000000 -0800
+++ perl/embed.fnc      2008-02-04 05:30:22.000000000 -0800
@@ -831,7 +831,7 @@
 Apd    |char*  |sv_pvutf8n     |NN SV *sv|NN STRLEN *len
 Apd    |char*  |sv_pvbyten     |NN SV *sv|NN STRLEN *len
 Apd    |I32    |sv_true        |NULLOK SV *sv
-pd     |void   |sv_add_arena   |NN char* ptr|U32 size|U32 flags
+pd     |void   |sv_add_arena   |NN char *const ptr|const U32 size|const U32 
flags
 Apd    |int    |sv_backoff     |NN SV* sv
 Apd    |SV*    |sv_bless       |NN SV* sv|NN HV* stash
 Afpd   |void   |sv_catpvf      |NN SV* sv|NN const char* pat|...
@@ -1143,7 +1143,7 @@
 #endif
 
 : #if defined(PERL_IN_HV_C) || defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
-paRxo  |void*  |get_arena      |size_t svtype|U32 misc
+paRxo  |void*  |get_arena      |const size_t svtype|const U32 misc
 : #endif
 
 #if defined(PERL_IN_HV_C) || defined(PERL_DECL_PROT)
@@ -1495,7 +1495,7 @@
 nsR    |char * |uiv_2buf       |NN char *buf|IV iv|UV uv|int is_uv|NN char 
**peob
 s      |void   |sv_unglob      |NN SV* sv
 s      |void   |not_a_number   |NN SV *sv
-s      |I32    |visit          |NN SVFUNC_t f|U32 flags|U32 mask
+s      |I32    |visit          |NN SVFUNC_t f|const U32 flags|const U32 mask
 s      |void   |sv_del_backref |NN SV *target|NN SV *ref
 sR     |SV *   |varname        |NULLOK GV *gv|const char gvtype|PADOFFSET targ 
\
                                |NULLOK SV *keyname|I32 aindex|int 
subscript_type
@@ -1527,7 +1527,7 @@
 sM     |void   |sv_release_COW |NN SV *sv|NN const char *pvx|NN SV *after
 #  endif
 s      |SV *   |more_sv
-s      |void * |more_bodies    |svtype sv_type
+s      |void * |more_bodies    |const svtype sv_type
 s      |bool   |sv_2iuv_common |NN SV *sv
 s      |void   |glob_assign_glob|NN SV *dstr|NN SV *sstr|const int dtype
 s      |void   |glob_assign_ref|NN SV *dstr|NN SV *sstr
@@ -1819,7 +1819,7 @@
 XEopMa |STRLEN *|new_warnings_bitfield|NULLOK STRLEN *buffer \
                                |NN const char *const bits|STRLEN size
 
-p      |void   |offer_nice_chunk       |NN void *chunk|U32 chunk_size
+p      |void   |offer_nice_chunk       |NN void *const chunk|const U32 
chunk_size
 
 #ifndef SPRINTF_RETURNS_STRLEN
 Apnod  |int    |my_sprintf     |NN char *buffer|NN const char *pat|...

==== //depot/perl/pod/perlintern.pod#71 (text+w) ====
Index: perl/pod/perlintern.pod
--- perl/pod/perlintern.pod#70~33050~   2008-01-23 01:20:56.000000000 -0800
+++ perl/pod/perlintern.pod     2008-02-04 05:30:22.000000000 -0800
@@ -998,7 +998,7 @@
 Given a chunk of memory, link it to the head of the list of arenas,
 and split it into a list of free SVs.
 
-       void    sv_add_arena(char* ptr, U32 size, U32 flags)
+       void    sv_add_arena(char *const ptr, const U32 size, const U32 flags)
 
 =for hackers
 Found in file sv.c

==== //depot/perl/proto.h#903 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#902~33228~     2008-02-03 07:04:41.000000000 -0800
+++ perl/proto.h        2008-02-04 05:30:22.000000000 -0800
@@ -2223,7 +2223,7 @@
                        __attribute__nonnull__(pTHX_2);
 
 PERL_CALLCONV I32      Perl_sv_true(pTHX_ SV *sv);
-PERL_CALLCONV void     Perl_sv_add_arena(pTHX_ char* ptr, U32 size, U32 flags)
+PERL_CALLCONV void     Perl_sv_add_arena(pTHX_ char *const ptr, const U32 
size, const U32 flags)
                        __attribute__nonnull__(pTHX_1);
 
 PERL_CALLCONV int      Perl_sv_backoff(pTHX_ SV* sv)
@@ -3023,7 +3023,7 @@
 
 #endif
 
-PERL_CALLCONV void*    Perl_get_arena(pTHX_ size_t svtype, U32 misc)
+PERL_CALLCONV void*    Perl_get_arena(pTHX_ const size_t svtype, const U32 
misc)
                        __attribute__malloc__
                        __attribute__warn_unused_result__;
 
@@ -3956,7 +3956,7 @@
 STATIC void    S_not_a_number(pTHX_ SV *sv)
                        __attribute__nonnull__(pTHX_1);
 
-STATIC I32     S_visit(pTHX_ SVFUNC_t f, U32 flags, U32 mask)
+STATIC I32     S_visit(pTHX_ SVFUNC_t f, const U32 flags, const U32 mask)
                        __attribute__nonnull__(pTHX_1);
 
 STATIC void    S_sv_del_backref(pTHX_ SV *target, SV *ref)
@@ -4022,7 +4022,7 @@
 
 #  endif
 STATIC SV *    S_more_sv(pTHX);
-STATIC void *  S_more_bodies(pTHX_ svtype sv_type);
+STATIC void *  S_more_bodies(pTHX_ const svtype sv_type);
 STATIC bool    S_sv_2iuv_common(pTHX_ SV *sv)
                        __attribute__nonnull__(pTHX_1);
 
@@ -4556,7 +4556,7 @@
                        __attribute__nonnull__(pTHX_2);
 
 
-PERL_CALLCONV void     Perl_offer_nice_chunk(pTHX_ void *chunk, U32 chunk_size)
+PERL_CALLCONV void     Perl_offer_nice_chunk(pTHX_ void *const chunk, const 
U32 chunk_size)
                        __attribute__nonnull__(pTHX_1);
 
 

==== //depot/perl/sv.c#1502 (text) ====
Index: perl/sv.c
--- perl/sv.c#1501~33081~       2008-01-26 13:55:51.000000000 -0800
+++ perl/sv.c   2008-02-04 05:30:22.000000000 -0800
@@ -154,7 +154,7 @@
  */
 
 void
-Perl_offer_nice_chunk(pTHX_ void *chunk, U32 chunk_size)
+Perl_offer_nice_chunk(pTHX_ void *const chunk, const U32 chunk_size)
 {
     dVAR;
     void *new_chunk;
@@ -332,7 +332,7 @@
 */
 
 void
-Perl_sv_add_arena(pTHX_ char *ptr, U32 size, U32 flags)
+Perl_sv_add_arena(pTHX_ char *const ptr, const U32 size, const U32 flags)
 {
     dVAR;
     SV* const sva = (SV*)ptr;
@@ -370,7 +370,7 @@
  * whose flags field matches the flags/mask args. */
 
 STATIC I32
-S_visit(pTHX_ SVFUNC_t f, U32 flags, U32 mask)
+S_visit(pTHX_ SVFUNC_t f, const U32 flags, const U32 mask)
 {
     dVAR;
     SV* sva;
@@ -427,7 +427,7 @@
 /* called by sv_clean_objs() for each live SV */
 
 static void
-do_clean_objs(pTHX_ SV *ref)
+do_clean_objs(pTHX_ SV *const ref)
 {
     dVAR;
     assert (SvROK(ref));
@@ -503,7 +503,7 @@
 /* called by sv_clean_all() for each live SV */
 
 static void
-do_clean_all(pTHX_ SV *sv)
+do_clean_all(pTHX_ SV *const sv)
 {
     dVAR;
     DEBUG_D((PerlIO_printf(Perl_debug_log, "Cleaning loops: SV at 
0x%"UVxf"\n", PTR2UV(sv)) ));
@@ -663,7 +663,7 @@
    TBD: export properly for hv.c: S_more_he().
 */
 void*
-Perl_get_arena(pTHX_ size_t arena_size, U32 misc)
+Perl_get_arena(pTHX_ const size_t arena_size, const U32 misc)
 {
     dVAR;
     struct arena_desc* adesc;
@@ -1027,7 +1027,7 @@
        my_safecalloc((details)->body_size + (details)->offset)
 
 STATIC void *
-S_more_bodies (pTHX_ svtype sv_type)
+S_more_bodies (pTHX_ const svtype sv_type)
 {
     dVAR;
     void ** const root = &PL_body_roots[sv_type];
@@ -1090,7 +1090,7 @@
 #ifndef PURIFY
 
 STATIC void *
-S_new_body(pTHX_ svtype sv_type)
+S_new_body(pTHX_ const svtype sv_type)
 {
     dVAR;
     void *xpv;
End of Patch.

Reply via email to