Make prototypes and declarations for Perl_pad_add_name_{pv,pvn,sv} agree.
authorNicholas Clark <nick@ccl4.org>
Thu, 14 Jul 2011 16:02:55 +0000 (18:02 +0200)
committerNicholas Clark <nick@ccl4.org>
Thu, 14 Jul 2011 16:02:55 +0000 (18:02 +0200)
cc76b5cc1552a605 added all 3 functions to the API, but declared prototypes
with const U32 flags, whilst the definitions had that parameter non-const.
Some compilers issue warnings about this inconsistency.

embed.fnc
pad.c
proto.h

index 925eee7..e787f10 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -2122,13 +2122,13 @@ s       |PADOFFSET|pad_alloc_name|NN SV *namesv|U32 flags \
                                |NULLOK HV *typestash|NULLOK HV *ourstash
 #endif
 Apd    |PADOFFSET|pad_add_name_pvn|NN const char *namepv|STRLEN namelen\
-                               |const U32 flags|NULLOK HV *typestash\
+                               |U32 flags|NULLOK HV *typestash\
                                |NULLOK HV *ourstash
 Apd    |PADOFFSET|pad_add_name_pv|NN const char *name\
                                |const U32 flags|NULLOK HV *typestash\
                                |NULLOK HV *ourstash
 Apd    |PADOFFSET|pad_add_name_sv|NN SV *name\
-                               |const U32 flags|NULLOK HV *typestash\
+                               |U32 flags|NULLOK HV *typestash\
                                |NULLOK HV *ourstash
 AMpd   |PADOFFSET|pad_alloc    |I32 optype|U32 tmptype
 Apd    |PADOFFSET|pad_add_anon |NN CV* func|I32 optype
diff --git a/pad.c b/pad.c
index 7e9dcc0..52bf354 100644 (file)
--- a/pad.c
+++ b/pad.c
@@ -605,7 +605,7 @@ instead of a string/length pair.
 
 PADOFFSET
 Perl_pad_add_name_pv(pTHX_ const char *name,
-               U32 flags, HV *typestash, HV *ourstash)
+                    const U32 flags, HV *typestash, HV *ourstash)
 {
     PERL_ARGS_ASSERT_PAD_ADD_NAME_PV;
     return pad_add_name_pvn(name, strlen(name), flags, typestash, ourstash);
diff --git a/proto.h b/proto.h
index 2164152..50040b5 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -2797,12 +2797,12 @@ PERL_CALLCONV PADOFFSET Perl_pad_add_name_pv(pTHX_ const char *name, const U32 f
 #define PERL_ARGS_ASSERT_PAD_ADD_NAME_PV       \
        assert(name)
 
-PERL_CALLCONV PADOFFSET        Perl_pad_add_name_pvn(pTHX_ const char *namepv, STRLEN namelen, const U32 flags, HV *typestash, HV *ourstash)
+PERL_CALLCONV PADOFFSET        Perl_pad_add_name_pvn(pTHX_ const char *namepv, STRLEN namelen, U32 flags, HV *typestash, HV *ourstash)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_PAD_ADD_NAME_PVN      \
        assert(namepv)
 
-PERL_CALLCONV PADOFFSET        Perl_pad_add_name_sv(pTHX_ SV *name, const U32 flags, HV *typestash, HV *ourstash)
+PERL_CALLCONV PADOFFSET        Perl_pad_add_name_sv(pTHX_ SV *name, U32 flags, HV *typestash, HV *ourstash)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_PAD_ADD_NAME_SV       \
        assert(name)