gperf.sed: static declarations

* tool/gperf.sed: comment out arguments part only, to keep the
  following declarations static.  [Feature #13883]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-12-15 14:42:43 +00:00
parent a9419fbd4f
commit 7c4306e6e9
9 changed files with 10 additions and 10 deletions

View File

@ -2,7 +2,7 @@
struct kwtable {int name, id[2], state;}; struct kwtable {int name, id[2], state;};
const struct kwtable *rb_reserved_word(const char *, unsigned int); const struct kwtable *rb_reserved_word(const char *, unsigned int);
#ifndef RIPPER #ifndef RIPPER
/*!ANSI*/static const struct kwtable *reserved_word(const char *, unsigned int); static const struct kwtable *reserved_word(/*!ANSI{*/const char *, unsigned int/*}!ANSI*/);
#define rb_reserved_word(str, len) reserved_word(str, len) #define rb_reserved_word(str, len) reserved_word(str, len)
%} %}

View File

@ -2,7 +2,7 @@
struct kwtable {int name, id[2], state;}; struct kwtable {int name, id[2], state;};
const struct kwtable *rb_reserved_word(const char *, unsigned int); const struct kwtable *rb_reserved_word(const char *, unsigned int);
#ifndef RIPPER #ifndef RIPPER
/*!ANSI*/static const struct kwtable *reserved_word(const char *, unsigned int); static const struct kwtable *reserved_word(/*!ANSI{*/const char *, unsigned int/*}!ANSI*/);
#define rb_reserved_word(str, len) reserved_word(str, len) #define rb_reserved_word(str, len) reserved_word(str, len)
%} %}

View File

@ -69,7 +69,7 @@ struct enc_property {
unsigned char ctype; unsigned char ctype;
}; };
/*static const struct enc_property *onig_jis_property(const char *str, unsigned int len);*/ static const struct enc_property *onig_jis_property(/*const char *str, unsigned int len*/);
#line 43 "enc/jis/props.kwd" #line 43 "enc/jis/props.kwd"
struct enc_property; struct enc_property;

View File

@ -37,7 +37,7 @@ struct enc_property {
unsigned char ctype; unsigned char ctype;
}; };
/*!ANSI*/static const struct enc_property *onig_jis_property(const char *str, unsigned int len); static const struct enc_property *onig_jis_property(/*!ANSI{*/const char *str, unsigned int len/*}!ANSI*/);
%} %}
struct enc_property; struct enc_property;

View File

@ -37,7 +37,7 @@ struct enc_property {
unsigned char ctype; unsigned char ctype;
}; };
/*!ANSI*/static const struct enc_property *onig_jis_property(const char *str, unsigned int len); static const struct enc_property *onig_jis_property(/*!ANSI{*/const char *str, unsigned int len/*}!ANSI*/);
%} %}
struct enc_property; struct enc_property;

View File

@ -513,7 +513,7 @@
#line 1 "win32_vk.list" #line 1 "win32_vk.list"
struct vktable {short ofs; unsigned short vk;}; struct vktable {short ofs; unsigned short vk;};
/*static const struct vktable *console_win32_vk(const char *, unsigned int);*/ static const struct vktable *console_win32_vk(/*const char *, unsigned int*/);
#line 5 "win32_vk.list" #line 5 "win32_vk.list"
struct vktable; struct vktable;
/* maximum key range = 245, duplicates = 0 */ /* maximum key range = 245, duplicates = 0 */

View File

@ -1,6 +1,6 @@
%{ %{
struct vktable {short ofs; unsigned short vk;}; struct vktable {short ofs; unsigned short vk;};
/*!ANSI*/static const struct vktable *console_win32_vk(const char *, unsigned int); static const struct vktable *console_win32_vk(/*!ANSI{*/const char *, unsigned int/*}!ANSI*/);
%} %}
struct vktable struct vktable
%% %%

View File

@ -34,7 +34,7 @@
struct kwtable {int name, id[2], state;}; struct kwtable {int name, id[2], state;};
const struct kwtable *rb_reserved_word(const char *, unsigned int); const struct kwtable *rb_reserved_word(const char *, unsigned int);
#ifndef RIPPER #ifndef RIPPER
/*static const struct kwtable *reserved_word(const char *, unsigned int);*/ static const struct kwtable *reserved_word(/*const char *, unsigned int*/);
#define rb_reserved_word(str, len) reserved_word(str, len) #define rb_reserved_word(str, len) reserved_word(str, len)
#line 9 "defs/keywords" #line 9 "defs/keywords"
struct kwtable; struct kwtable;

View File

@ -3,9 +3,9 @@
s/.*/ANSI:offset:/ s/.*/ANSI:offset:/
x x
} }
/^\/\*!ANSI\*\//{ /\/\*!ANSI{\*\//{
G G
s/^\/\*!ANSI\*\/\(.*\)\nANSI:.*/\/\*\1\*\// s/\/\*!ANSI{\*\/\(.*\)\/\*}!ANSI\*\/\(.*\)\nANSI:.*/\/\*\1\*\/\2/
} }
s/(int)([a-z_]*)&((struct \([a-zA-Z_0-9][a-zA-Z_0-9]*\)_t *\*)0)->\1_str\([1-9][0-9]*\),/gperf_offsetof(\1, \2),/g s/(int)([a-z_]*)&((struct \([a-zA-Z_0-9][a-zA-Z_0-9]*\)_t *\*)0)->\1_str\([1-9][0-9]*\),/gperf_offsetof(\1, \2),/g
/^#line/{ /^#line/{