This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
const sausage const const bacon const tomato and const
authorNicholas Clark <nick@ccl4.org>
Mon, 26 Sep 2005 17:54:06 +0000 (17:54 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 26 Sep 2005 17:54:06 +0000 (17:54 +0000)
The search_ext parameter to find_script can be a little more const.

p4raw-id: //depot/perl@25605

embed.fnc
proto.h
util.c

index 0903c89..6c0b1e8 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -238,7 +238,7 @@ Apd |void   |fbm_compile    |NN SV* sv|U32 flags
 ApdR   |char*  |fbm_instr      |NN unsigned char* big|NN unsigned char* bigend \
                                |NN SV* littlesv|U32 flags
 p      |char*  |find_script    |const char *scriptname|bool dosearch \
-                               |const char **search_ext|I32 flags
+                               |const char *const *const search_ext|I32 flags
 p      |OP*    |force_list     |NULLOK OP* arg
 p      |OP*    |fold_constants |NN OP* arg
 Afpd   |char*  |form           |NN const char* pat|...
diff --git a/proto.h b/proto.h
index cc4b7db..0fbe1df 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -483,7 +483,7 @@ PERL_CALLCONV char* Perl_fbm_instr(pTHX_ unsigned char* big, unsigned char* bige
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);
 
-PERL_CALLCONV char*    Perl_find_script(pTHX_ const char *scriptname, bool dosearch, const char **search_ext, I32 flags);
+PERL_CALLCONV char*    Perl_find_script(pTHX_ const char *scriptname, bool dosearch, const char *const *const search_ext, I32 flags);
 PERL_CALLCONV OP*      Perl_force_list(pTHX_ OP* arg);
 PERL_CALLCONV OP*      Perl_fold_constants(pTHX_ OP* arg)
                        __attribute__nonnull__(pTHX_1);
diff --git a/util.c b/util.c
index 6e39cb6..ccbb7f9 100644 (file)
--- a/util.c
+++ b/util.c
@@ -2786,7 +2786,8 @@ Perl_same_dirent(pTHX_ const char *a, const char *b)
 #endif /* !HAS_RENAME */
 
 char*
-Perl_find_script(pTHX_ const char *scriptname, bool dosearch, const char **search_ext, I32 flags)
+Perl_find_script(pTHX_ const char *scriptname, bool dosearch,
+                const char *const *const search_ext, I32 flags)
 {
     const char *xfound = Nullch;
     char *xfailed = Nullch;
@@ -2808,8 +2809,8 @@ Perl_find_script(pTHX_ const char *scriptname, bool dosearch, const char **searc
 #endif
     /* additional extensions to try in each dir if scriptname not found */
 #ifdef SEARCH_EXTS
-    const char *exts[] = { SEARCH_EXTS };
-    const char **ext = search_ext ? search_ext : exts;
+    const char *const exts[] = { SEARCH_EXTS };
+    const char *const *const ext = search_ext ? search_ext : exts;
     int extidx = 0, i = 0;
     const char *curext = Nullch;
 #else