This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Add a const to a function parameter
authorKarl Williamson <khw@cpan.org>
Thu, 9 Jun 2016 21:55:39 +0000 (15:55 -0600)
committerKarl Williamson <khw@cpan.org>
Wed, 22 Jun 2016 00:10:38 +0000 (18:10 -0600)
This value isn't changed by the function

embed.fnc
proto.h
regexec.c

index 967fdfc..f8c01e6 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -2350,7 +2350,7 @@ Es        |void   |regcppop       |NN regexp *rex\
 ERsn   |U8*    |reghop3        |NN U8 *s|SSize_t off|NN const U8 *lim
 ERsn   |U8*    |reghop4        |NN U8 *s|SSize_t off|NN const U8 *llim \
                                |NN const U8 *rlim
-ERsn   |U8*    |reghopmaybe3   |NN U8 *s|SSize_t off|NN const U8 *lim
+ERsn   |U8*    |reghopmaybe3   |NN U8 *s|SSize_t off|NN const U8 * const lim
 ERs    |char*  |find_byclass   |NN regexp * prog|NN const regnode *c \
                                |NN char *s|NN const char *strend \
                                |NULLOK regmatch_info *reginfo
diff --git a/proto.h b/proto.h
index 4ad4b93..8b81e50 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -5286,7 +5286,7 @@ STATIC U8*        S_reghop4(U8 *s, SSize_t off, const U8 *llim, const U8 *rlim)
 #define PERL_ARGS_ASSERT_REGHOP4       \
        assert(s); assert(llim); assert(rlim)
 
-STATIC U8*     S_reghopmaybe3(U8 *s, SSize_t off, const U8 *lim)
+STATIC U8*     S_reghopmaybe3(U8 *s, SSize_t off, const U8 * const lim)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_REGHOPMAYBE3  \
        assert(s); assert(lim)
index 2822dff..fdcffc5 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -9263,7 +9263,7 @@ S_reghop4(U8 *s, SSize_t off, const U8* llim, const U8* rlim)
  * char pos */
 
 STATIC U8 *
-S_reghopmaybe3(U8* s, SSize_t off, const U8* lim)
+S_reghopmaybe3(U8* s, SSize_t off, const U8* const lim)
 {
     PERL_ARGS_ASSERT_REGHOPMAYBE3;