From: Andy Lester Date: Wed, 7 Dec 2005 10:08:18 +0000 (-0600) Subject: All args in embed.fnc should be named X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c48640ec958027811b711ad07ca27c7f6b7ebbe0;p=p5sagit%2Fp5-mst-13.2.git All args in embed.fnc should be named Message-ID: <20051207160818.GA13465@petdance.com> p4raw-id: //depot/perl@26296 --- diff --git a/embed.fnc b/embed.fnc index b420278..0f5d8b9 100644 --- a/embed.fnc +++ b/embed.fnc @@ -724,7 +724,7 @@ Anp |Signal_t |csighandler |int sig|... np |Signal_t |sighandler |int sig Anp |Signal_t |csighandler |int sig #endif -Ap |SV** |stack_grow |NN SV** sp|NN SV**p|int n +Ap |SV** |stack_grow |NN SV** sp|NN SV** p|int n Ap |I32 |start_subparse |I32 is_format|U32 flags p |void |sub_crush_depth|NN CV* cv Apd |bool |sv_2bool |NN SV* sv @@ -1005,9 +1005,9 @@ ApR |char * |custom_op_desc |NN const OP* op pMX |int |sv_release_IVX |NN SV *sv #endif -Adp |void |sv_nosharing |NULLOK SV * -Adpbm |void |sv_nolocking |NULLOK SV * -Adpbm |void |sv_nounlocking |NULLOK SV * +Adp |void |sv_nosharing |NULLOK SV *sv +Adpbm |void |sv_nolocking |NULLOK SV *sv +Adpbm |void |sv_nounlocking |NULLOK SV *sv Adp |int |nothreadhook END_EXTERN_C @@ -1223,30 +1223,30 @@ Es |void |reginsert |NN struct RExC_state_t *state|U8 op|NN regnode *opnd Es |void |regoptail |NN struct RExC_state_t *state|NN regnode *p|NN regnode *val Es |void |regtail |NN struct RExC_state_t *state|NN regnode *p|NN regnode *val Es |char* |regwhite |NN char *p|NN const char *e -Es |char* |nextchar |NN struct RExC_state_t* +Es |char* |nextchar |NN struct RExC_state_t *state # ifdef DEBUGGING Es |regnode*|dumpuntil |NN regnode *start|NN regnode *node \ |NULLOK regnode *last|NN SV* sv|I32 l Es |void |put_byte |NN SV* sv|int c # endif -Es |void |scan_commit |NN struct RExC_state_t*|NN struct scan_data_t *data -Es |void |cl_anything |NN struct RExC_state_t*|NN struct regnode_charclass_class *cl +Es |void |scan_commit |NN struct RExC_state_t* state|NN struct scan_data_t *data +Es |void |cl_anything |NN struct RExC_state_t* state|NN struct regnode_charclass_class *cl Es |int |cl_is_anything |NN const struct regnode_charclass_class *cl -Es |void |cl_init |NN struct RExC_state_t*|NN struct regnode_charclass_class *cl -Es |void |cl_init_zero |NN struct RExC_state_t*|NN struct regnode_charclass_class *cl +Es |void |cl_init |NN struct RExC_state_t* state|NN struct regnode_charclass_class *cl +Es |void |cl_init_zero |NN struct RExC_state_t* state|NN struct regnode_charclass_class *cl Es |void |cl_and |NN struct regnode_charclass_class *cl \ |NN const struct regnode_charclass_class *and_with -Es |void |cl_or |NN struct RExC_state_t*|NN struct regnode_charclass_class *cl \ +Es |void |cl_or |NN struct RExC_state_t* state|NN struct regnode_charclass_class *cl \ |NN const struct regnode_charclass_class *or_with -Es |I32 |study_chunk |NN struct RExC_state_t* pRExC_state|NN regnode **scanp \ +Es |I32 |study_chunk |NN struct RExC_state_t* state|NN regnode **scanp \ |NN I32 *deltap|NN regnode *last|NULLOK struct scan_data_t *data \ |U32 flags|U32 depth -Es |I32 |add_data |NN struct RExC_state_t*|I32 n|NN const char *s +Es |I32 |add_data |NN struct RExC_state_t* state|I32 n|NN const char *s rs |void |re_croak2 |NN const char* pat1|NN const char* pat2|... -Es |I32 |regpposixcc |NN struct RExC_state_t*|I32 value -Es |void |checkposixcc |NN struct RExC_state_t* +Es |I32 |regpposixcc |NN struct RExC_state_t* state|I32 value +Es |void |checkposixcc |NN struct RExC_state_t* state -Es |I32 |make_trie |NN struct RExC_state_t*|NN regnode *startbranch \ +Es |I32 |make_trie |NN struct RExC_state_t* state|NN regnode *startbranch \ |NN regnode *first|NN regnode *last|NN regnode *tail \ |U32 flags #endif @@ -1352,7 +1352,7 @@ sR |I32 |sublex_push sR |I32 |sublex_start sR |char * |filter_gets |NN SV *sv|NN PerlIO *fp|STRLEN append sR |HV * |find_in_my_stash|NN const char *pkgname|I32 len -sR |char * |tokenize_use |int is_use|NN char* +sR |char * |tokenize_use |int is_use|NN char *s s |SV* |new_constant |NULLOK const char *s|STRLEN len|NN const char *key|NN SV *sv \ |NULLOK SV *pv|NULLOK const char *type # if defined(DEBUGGING) diff --git a/embed.pl b/embed.pl index 2ef42aa..1e51aaa 100755 --- a/embed.pl +++ b/embed.pl @@ -124,26 +124,6 @@ sub munge_c_files () { } '/dev/null', '', ''; local $^I = '.bak'; while (<>) { -# if (/^#\s*include\s+"perl.h"/) { -# my $file = uc $ARGV; -# $file =~ s/\./_/g; -# print "#define PERL_IN_$file\n"; -# } -# s{^(\w+)\s*\(} -# { -# my $f = $1; -# my $repl = "$f("; -# if (exists $functions->{$f}) { -# my $flags = $functions->{$f}[0]; -# $repl = "Perl_$repl" if $flags =~ /p/; -# unless ($flags =~ /n/) { -# $repl .= "pTHX"; -# $repl .= "_ " if @{$functions->{$f}} > 3; -# } -# warn("$ARGV:$.:$repl\n"); -# } -# $repl; -# }e; s{(\b(\w+)[ \t]*\([ \t]*(?!aTHX))} { my $repl = $1; @@ -201,6 +181,15 @@ sub write_protos { } push( @nonnull, $n ) if ( $arg =~ s/\s*\bNN\b\s+// ); $arg =~ s/\s*\bNULLOK\b\s+//; # strip NULLOK with no effect + + # Make sure each arg has at least a type and a var name. + # An arg of "int" is valid C, but want it to be "int foo". + my $temp_arg = $arg; + $temp_arg =~ s/\*//g; + $temp_arg =~ s/\s*\bstruct\b\s*/ /g; + if ( ($temp_arg ne "...") && ($temp_arg !~ /\w+\s+\w+/) ) { + warn "$func: $arg doesn't have a name\n"; + } } $ret .= join ", ", @args; } diff --git a/pod/perlapi.pod b/pod/perlapi.pod index be9249b..2f701e5 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -845,7 +845,7 @@ potentially warn under some level of strict-ness. "Superseded" by sv_nosharing(). - void sv_nolocking(SV *) + void sv_nolocking(SV *sv) =for hackers Found in file mathoms.c @@ -859,7 +859,7 @@ potentially warn under some level of strict-ness. "Superseded" by sv_nosharing(). - void sv_nounlocking(SV *) + void sv_nounlocking(SV *sv) =for hackers Found in file mathoms.c @@ -2327,7 +2327,7 @@ Or "locks" it. Or "unlocks" it. In other words, ignores its single SV argument. Exists to avoid test for a NULL function pointer and because it could potentially warn under some level of strict-ness. - void sv_nosharing(SV *) + void sv_nosharing(SV *sv) =for hackers Found in file util.c diff --git a/proto.h b/proto.h index 7c7e2ba..a47102f 100644 --- a/proto.h +++ b/proto.h @@ -1986,7 +1986,7 @@ PERL_CALLCONV Signal_t Perl_csighandler(int sig, ...); PERL_CALLCONV Signal_t Perl_sighandler(int sig); PERL_CALLCONV Signal_t Perl_csighandler(int sig); #endif -PERL_CALLCONV SV** Perl_stack_grow(pTHX_ SV** sp, SV**p, int n) +PERL_CALLCONV SV** Perl_stack_grow(pTHX_ SV** sp, SV** p, int n) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); @@ -2787,9 +2787,9 @@ PERL_CALLCONV int Perl_sv_release_IVX(pTHX_ SV *sv) #endif -PERL_CALLCONV void Perl_sv_nosharing(pTHX_ SV *); -/* PERL_CALLCONV void Perl_sv_nolocking(pTHX_ SV *); */ -/* PERL_CALLCONV void Perl_sv_nounlocking(pTHX_ SV *); */ +PERL_CALLCONV void Perl_sv_nosharing(pTHX_ SV *sv); +/* PERL_CALLCONV void Perl_sv_nolocking(pTHX_ SV *sv); */ +/* PERL_CALLCONV void Perl_sv_nounlocking(pTHX_ SV *sv); */ PERL_CALLCONV int Perl_nothreadhook(pTHX); END_EXTERN_C @@ -3427,7 +3427,7 @@ STATIC char* S_regwhite(pTHX_ char *p, const char *e) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); -STATIC char* S_nextchar(pTHX_ struct RExC_state_t*) +STATIC char* S_nextchar(pTHX_ struct RExC_state_t *state) __attribute__nonnull__(pTHX_1); # ifdef DEBUGGING @@ -3440,22 +3440,22 @@ STATIC void S_put_byte(pTHX_ SV* sv, int c) __attribute__nonnull__(pTHX_1); # endif -STATIC void S_scan_commit(pTHX_ struct RExC_state_t*, struct scan_data_t *data) +STATIC void S_scan_commit(pTHX_ struct RExC_state_t* state, struct scan_data_t *data) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); -STATIC void S_cl_anything(pTHX_ struct RExC_state_t*, struct regnode_charclass_class *cl) +STATIC void S_cl_anything(pTHX_ struct RExC_state_t* state, struct regnode_charclass_class *cl) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); STATIC int S_cl_is_anything(pTHX_ const struct regnode_charclass_class *cl) __attribute__nonnull__(pTHX_1); -STATIC void S_cl_init(pTHX_ struct RExC_state_t*, struct regnode_charclass_class *cl) +STATIC void S_cl_init(pTHX_ struct RExC_state_t* state, struct regnode_charclass_class *cl) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); -STATIC void S_cl_init_zero(pTHX_ struct RExC_state_t*, struct regnode_charclass_class *cl) +STATIC void S_cl_init_zero(pTHX_ struct RExC_state_t* state, struct regnode_charclass_class *cl) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); @@ -3463,18 +3463,18 @@ STATIC void S_cl_and(pTHX_ struct regnode_charclass_class *cl, const struct regn __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); -STATIC void S_cl_or(pTHX_ struct RExC_state_t*, struct regnode_charclass_class *cl, const struct regnode_charclass_class *or_with) +STATIC void S_cl_or(pTHX_ struct RExC_state_t* state, struct regnode_charclass_class *cl, const struct regnode_charclass_class *or_with) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2) __attribute__nonnull__(pTHX_3); -STATIC I32 S_study_chunk(pTHX_ struct RExC_state_t* pRExC_state, regnode **scanp, I32 *deltap, regnode *last, struct scan_data_t *data, U32 flags, U32 depth) +STATIC I32 S_study_chunk(pTHX_ struct RExC_state_t* state, regnode **scanp, I32 *deltap, regnode *last, struct scan_data_t *data, U32 flags, U32 depth) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2) __attribute__nonnull__(pTHX_3) __attribute__nonnull__(pTHX_4); -STATIC I32 S_add_data(pTHX_ struct RExC_state_t*, I32 n, const char *s) +STATIC I32 S_add_data(pTHX_ struct RExC_state_t* state, I32 n, const char *s) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_3); @@ -3483,14 +3483,14 @@ STATIC void S_re_croak2(pTHX_ const char* pat1, const char* pat2, ...) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2); -STATIC I32 S_regpposixcc(pTHX_ struct RExC_state_t*, I32 value) +STATIC I32 S_regpposixcc(pTHX_ struct RExC_state_t* state, I32 value) __attribute__nonnull__(pTHX_1); -STATIC void S_checkposixcc(pTHX_ struct RExC_state_t*) +STATIC void S_checkposixcc(pTHX_ struct RExC_state_t* state) __attribute__nonnull__(pTHX_1); -STATIC I32 S_make_trie(pTHX_ struct RExC_state_t*, regnode *startbranch, regnode *first, regnode *last, regnode *tail, U32 flags) +STATIC I32 S_make_trie(pTHX_ struct RExC_state_t* state, regnode *startbranch, regnode *first, regnode *last, regnode *tail, U32 flags) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2) __attribute__nonnull__(pTHX_3) @@ -3762,7 +3762,7 @@ STATIC HV * S_find_in_my_stash(pTHX_ const char *pkgname, I32 len) __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); -STATIC char * S_tokenize_use(pTHX_ int is_use, char*) +STATIC char * S_tokenize_use(pTHX_ int is_use, char *s) __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_2);