1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

reserved_word: just use gperf 3.1 declaration

The reason why this was commented out was because of gperf 3.0 vs 3.1
differences (see [Feature #13883]).  Five years passed, I am pretty
confident that we can drop support of old versions here.

Ditto for uniname2ctype_p(), onig_jis_property(), and zonetab().
This commit is contained in:
卜部昌平 2022-09-16 15:14:05 +09:00
parent 77c61ae3ab
commit 45741918e1
Notes: git 2022-09-21 11:44:33 +09:00
10 changed files with 11 additions and 19 deletions

View file

@ -2,7 +2,7 @@
struct kwtable {short name, id[2], state;}; struct kwtable {short 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(/*!ANSI{*/const char *, unsigned int/*}!ANSI*/); static const struct kwtable *reserved_word(register const char *str, register size_t len);
#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 {short name, id[2], state;}; struct kwtable {short 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(/*!ANSI{*/const char *, unsigned int/*}!ANSI*/); static const struct kwtable *reserved_word(register const char *str, register size_t len);
#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(register const char *str, register size_t len);
#line 43 "enc/jis/props.kwd" #line 43 "enc/jis/props.kwd"
struct enc_property; struct enc_property;
@ -82,7 +82,7 @@ struct enc_property;
#ifndef GPERF_DOWNCASE #ifndef GPERF_DOWNCASE
#define GPERF_DOWNCASE 1 #define GPERF_DOWNCASE 1
static unsigned char gperf_downcase[256] = static const unsigned char gperf_downcase[256] =
{ {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

View file

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

View file

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

View file

@ -40642,11 +40642,7 @@ struct uniname2ctype_struct {
}; };
#define uniname2ctype_offset(str) offsetof(struct uniname2ctype_pool_t, uniname2ctype_pool_##str) #define uniname2ctype_offset(str) offsetof(struct uniname2ctype_pool_t, uniname2ctype_pool_##str)
static const struct uniname2ctype_struct *uniname2ctype_p( static const struct uniname2ctype_struct *uniname2ctype_p(register const char *str, register size_t len);
#if !(1+0) /* if ANSI, old style not to conflict with generated prototype */
const char *, unsigned int
#endif
);
#ifndef USE_UNICODE_PROPERTIES #ifndef USE_UNICODE_PROPERTIES
#define TOTAL_KEYWORDS 15 #define TOTAL_KEYWORDS 15

View file

@ -36,7 +36,7 @@ struct zone {
int name; int name;
int offset; int offset;
}; };
static const struct zone *zonetab(); static const struct zone *zonetab(register const char *str, register size_t len);
#line 9 "zonetab.list" #line 9 "zonetab.list"
struct zone; struct zone;

View file

@ -3,7 +3,7 @@ struct zone {
int name; int name;
int offset; int offset;
}; };
static const struct zone *zonetab(); static const struct zone *zonetab(register const char *str, register size_t len);
%} %}
struct zone; struct zone;

View file

@ -34,7 +34,7 @@
struct kwtable {short name, id[2], state;}; struct kwtable {short 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(register const char *str, register size_t len);
#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

@ -465,11 +465,7 @@ struct uniname2ctype_struct {
}; };
#define uniname2ctype_offset(str) offsetof(struct uniname2ctype_pool_t, uniname2ctype_pool_##str) #define uniname2ctype_offset(str) offsetof(struct uniname2ctype_pool_t, uniname2ctype_pool_##str)
static const struct uniname2ctype_struct *uniname2ctype_p( static const struct uniname2ctype_struct *uniname2ctype_p(register const char *str, register size_t len);
#if !(/*ANSI*/+0) /* if ANSI, old style not to conflict with generated prototype */
const char *, unsigned int
#endif
);
%} %}
struct uniname2ctype_struct; struct uniname2ctype_struct;
%% %%