In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/2acdbac104deb9113282247f3dbee83c4705a525?hp=a4df5da1fe962395b9ad9ab6a0922d022fdb809c>

- Log -----------------------------------------------------------------
commit 2acdbac104deb9113282247f3dbee83c4705a525
Author: Nicholas Clark <[email protected]>
Date:   Tue Oct 13 11:05:49 2009 +0100

    Replace Perl_deprecate() with a macro that calls Perl_ck_warner()
    
    Perl_deprecate was not part of the public API, and did not have a 
deprecate()
    shortcut macro defined without -DPERL_CORE. Neither codesearch.google.com 
nor
    CPAN::Unpack show any users outside the core.

M       embed.fnc
M       embed.h
M       handy.h
M       proto.h
M       toke.c

commit 8290c3237cb4f93c9895ceba724c626dd529346f
Author: Nicholas Clark <[email protected]>
Date:   Tue Oct 13 10:27:36 2009 +0100

    Move the code related to deprecate("comma-less variable list") into a 
function.
    
    This makes all calls to deprecate() string constants.

M       embed.fnc
M       embed.h
M       proto.h
M       toke.c
-----------------------------------------------------------------------

Summary of changes:
 embed.fnc |    3 +--
 embed.h   |    4 ++--
 handy.h   |    7 +++++++
 proto.h   |    6 +-----
 toke.c    |   32 ++++++++++----------------------
 5 files changed, 21 insertions(+), 31 deletions(-)

diff --git a/embed.fnc b/embed.fnc
index 7e4ce51..ef0692d 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -213,8 +213,6 @@ Anp |char*  |delimcpy       |NN char* to|NN const char* 
toend|NN const char* from \
                                |NN const char* fromend|int delim|NN I32* retlen
 : Used in op.c, perl.c
 pM     |void   |delete_eval_scope
-: Used in various files
-p      |void   |deprecate      |NN const char *const s
 Afp    |OP*    |die            |NULLOK const char* pat|...
 #if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT)
 s      |OP*    |vdie           |NULLOK const char* pat|NULLOK va_list* args
@@ -1812,6 +1810,7 @@ so        |SV*    |new_constant   |NULLOK const char 
*s|STRLEN len \
                                |NN const char *key|STRLEN keylen|NN SV *sv \
                                |NULLOK SV *pv|NULLOK const char *type \
                                |STRLEN typelen
+s      |int    |deprecate_commaless_var_list
 s      |int    |ao             |int toketype
 #  if defined(PERL_CR_FILTER)
 s      |I32    |cr_textfilter  |int idx|NULLOK SV *sv|int maxlen
diff --git a/embed.h b/embed.h
index 59e8174..fa90193 100644
--- a/embed.h
+++ b/embed.h
@@ -150,7 +150,6 @@
 #define delimcpy               Perl_delimcpy
 #ifdef PERL_CORE
 #define delete_eval_scope      Perl_delete_eval_scope
-#define deprecate              Perl_deprecate
 #endif
 #define die                    Perl_die
 #if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT)
@@ -1593,6 +1592,7 @@
 #define tokenize_use           S_tokenize_use
 #endif
 #ifdef PERL_CORE
+#define deprecate_commaless_var_list   S_deprecate_commaless_var_list
 #define ao                     S_ao
 #endif
 #  if defined(PERL_CR_FILTER)
@@ -2488,7 +2488,6 @@
 #define delimcpy               Perl_delimcpy
 #ifdef PERL_CORE
 #define delete_eval_scope()    Perl_delete_eval_scope(aTHX)
-#define deprecate(a)           Perl_deprecate(aTHX_ a)
 #endif
 #if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT)
 #ifdef PERL_CORE
@@ -3947,6 +3946,7 @@
 #define filter_gets(a,b,c)     S_filter_gets(aTHX_ a,b,c)
 #define find_in_my_stash(a,b)  S_find_in_my_stash(aTHX_ a,b)
 #define tokenize_use(a,b)      S_tokenize_use(aTHX_ a,b)
+#define deprecate_commaless_var_list() S_deprecate_commaless_var_list(aTHX)
 #define ao(a)                  S_ao(aTHX_ a)
 #endif
 #  if defined(PERL_CR_FILTER)
diff --git a/handy.h b/handy.h
index bd58bfe..6c049cb 100644
--- a/handy.h
+++ b/handy.h
@@ -902,6 +902,13 @@ void Perl_mem_log_del_sv(const SV *sv, const char 
*filename, const int linenumbe
 #define pTHX__VALUE
 #endif /* USE_ITHREADS */
 
+/* Perl_deprecate was not part of the public API, and did not have a 
deprecate()
+   shortcut macro defined without -DPERL_CORE. Neither codesearch.google.com 
nor
+   CPAN::Unpack show any users outside the core.  */
+#ifdef PERL_CORE
+#  define deprecate(s) Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED), "Use of 
" s " is deprecated")
+#endif
+
 /*
  * Local variables:
  * c-indentation-style: bsd
diff --git a/proto.h b/proto.h
index c99a25a..28923d0 100644
--- a/proto.h
+++ b/proto.h
@@ -516,11 +516,6 @@ PERL_CALLCONV char*        Perl_delimcpy(char* to, const 
char* toend, const char* from,
        assert(to); assert(toend); assert(from); assert(fromend); assert(retlen)
 
 PERL_CALLCONV void     Perl_delete_eval_scope(pTHX);
-PERL_CALLCONV void     Perl_deprecate(pTHX_ const char *const s)
-                       __attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT_DEPRECATE     \
-       assert(s)
-
 PERL_CALLCONV OP*      Perl_die(pTHX_ const char* pat, ...)
                        
__attribute__format__null_ok__(__printf__,pTHX_1,pTHX_2);
 
@@ -5841,6 +5836,7 @@ STATIC SV*        S_new_constant(pTHX_ const char *s, 
STRLEN len, const char *key, STRL
 #define PERL_ARGS_ASSERT_NEW_CONSTANT  \
        assert(key); assert(sv)
 
+STATIC int     S_deprecate_commaless_var_list(pTHX);
 STATIC int     S_ao(pTHX_ int toketype);
 #  if defined(PERL_CR_FILTER)
 STATIC I32     S_cr_textfilter(pTHX_ int idx, SV *sv, int maxlen);
diff --git a/toke.c b/toke.c
index 03cf6fd..0b4ff5c 100644
--- a/toke.c
+++ b/toke.c
@@ -100,7 +100,6 @@ static int
 S_pending_ident(pTHX);
 
 static const char ident_too_long[] = "Identifier too long";
-static const char commaless_variable_list[] = "comma-less variable list";
 
 #ifndef PERL_NO_UTF16_FILTER
 static I32 utf16_textfilter(pTHX_ int idx, SV *sv, int maxlen);
@@ -451,6 +450,13 @@ S_printbuf(pTHX_ const char *const fmt, const char *const 
s)
 
 #endif
 
+static int
+S_deprecate_commaless_var_list(pTHX) {
+    PL_expect = XTERM;
+    deprecate("comma-less variable list");
+    return REPORT(','); /* grandfather non-comma-format format */
+}
+
 /*
  * S_ao
  *
@@ -585,18 +591,6 @@ S_feature_is_enabled(pTHX_ const char *const name, STRLEN 
namelen)
 }
 
 /*
- * Perl_deprecate
- */
-
-void
-Perl_deprecate(pTHX_ const char *const s)
-{
-    PERL_ARGS_ASSERT_DEPRECATE;
-
-    Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED), "Use of %s is deprecated", 
s);
-}
-
-/*
  * experimental text filters for win32 carriage-returns, utf16-to-utf8 and
  * utf16-to-utf8-reversed.
  */
@@ -4860,9 +4854,7 @@ Perl_yylex(pTHX)
 
        if (PL_expect == XOPERATOR) {
            if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) {
-               PL_expect = XTERM;
-               deprecate(commaless_variable_list);
-               return REPORT(','); /* grandfather non-comma-format format */
+               return deprecate_commaless_var_list();
            }
        }
 
@@ -5118,9 +5110,7 @@ Perl_yylex(pTHX)
        DEBUG_T( { printbuf("### Saw string before %s\n", s); } );
        if (PL_expect == XOPERATOR) {
            if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) {
-               PL_expect = XTERM;
-               deprecate(commaless_variable_list);
-               return REPORT(','); /* grandfather non-comma-format format */
+               return deprecate_commaless_var_list();
            }
            else
                no_op("String",s);
@@ -5135,9 +5125,7 @@ Perl_yylex(pTHX)
        DEBUG_T( { printbuf("### Saw string before %s\n", s); } );
        if (PL_expect == XOPERATOR) {
            if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) {
-               PL_expect = XTERM;
-               deprecate(commaless_variable_list);
-               return REPORT(','); /* grandfather non-comma-format format */
+               return deprecate_commaless_var_list();
            }
            else
                no_op("String",s);

--
Perl5 Master Repository

Reply via email to