diff options
author | Yves Orton <demerphq@gmail.com> | 2022-04-17 14:43:00 +0200 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-04-19 05:41:19 -0600 |
commit | 19ad8281cb889184f365a02bd4c1193d351cc418 (patch) | |
tree | 13043f759bd3e4f0a525792feedbc7bf72f3cbe0 | |
parent | a6dd039a1d2cd561a5f76c031dff15237f991c15 (diff) | |
download | perl-19ad8281cb889184f365a02bd4c1193d351cc418.tar.gz |
regen/mph.pl - tweaks to generated code, put type on its own line
All the C code we have puts the type on its own line separate from
the function parameter declaration, so follow that style in our
generated file too.
Also show the generator script in the comment that contains metadata
about the file.
-rw-r--r-- | regen/mph.pl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/regen/mph.pl b/regen/mph.pl index 502903b80e..3cc5c01e57 100644 --- a/regen/mph.pl +++ b/regen/mph.pl @@ -594,6 +594,7 @@ sub make_algo { my @code= "#define ${prefix}_VALt I16\n\n"; push @code, "/*\n"; + push @code, sprintf "generator script: %s\n", $0; push @code, sprintf "rows: %s\n", $n; push @code, sprintf "seed: %s\n", $seed1; push @code, sprintf "full length of keys: %d\n", $length_all_keys; @@ -628,7 +629,8 @@ EOF_CODE "STATIC const struct $struct_name $table_name\[${prefix}_BUCKETS] = {\n", join(",\n", @$rows) . "\n};\n\n"; push @code, <<"EOF_CODE"; -${prefix}_VALt $match_name( const unsigned char * const key, const U16 key_len ) { +${prefix}_VALt +$match_name( const unsigned char * const key, const U16 key_len ) { const unsigned char * ptr= key; const unsigned char * ptr_end= key + key_len; U32 h= ${prefix}_SEED1; |