summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-compiler
diff options
context:
space:
mode:
authorLothar Scholz <[email protected]>2017-12-23 01:10:43 +0100
committerLothar Scholz <[email protected]>2017-12-23 01:10:43 +0100
commit06f90a3b45fa4f241bbc43e91287aa9a127dc8c3 (patch)
tree46ab4c39e6784ac4bb6efbe4af28bfd6653d5f8c /mrbgems/mruby-compiler
parent100f0e6759be8e439e586acf01032d2b8b96c6bd (diff)
downloadmruby-06f90a3b45fa4f241bbc43e91287aa9a127dc8c3.tar.gz
mruby-06f90a3b45fa4f241bbc43e91287aa9a127dc8c3.zip
Make source compilable with C++17
Changes applied: - Removing "register" keyword - Fixing const pointer to pointer assignments - Adding type casts to rb_malloc calls
Diffstat (limited to 'mrbgems/mruby-compiler')
-rw-r--r--mrbgems/mruby-compiler/core/lex.def11
1 files changed, 5 insertions, 6 deletions
diff --git a/mrbgems/mruby-compiler/core/lex.def b/mrbgems/mruby-compiler/core/lex.def
index 58e302965..2ff266481 100644
--- a/mrbgems/mruby-compiler/core/lex.def
+++ b/mrbgems/mruby-compiler/core/lex.def
@@ -52,7 +52,7 @@ inline
#endif
#endif
static unsigned int
-hash (register const char *str, register unsigned int len)
+hash (const char *str, unsigned int len)
{
static const unsigned char asso_values[] =
{
@@ -83,7 +83,7 @@ hash (register const char *str, register unsigned int len)
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51
};
- register int hval = len;
+ int hval = len;
switch (hval)
{
@@ -105,7 +105,7 @@ __attribute__ ((__gnu_inline__))
#endif
#endif
const struct kwtable *
-mrb_reserved_word (register const char *str, register unsigned int len)
+mrb_reserved_word (const char *str, unsigned int len)
{
static const struct kwtable wordlist[] =
{
@@ -196,11 +196,11 @@ mrb_reserved_word (register const char *str, register unsigned int len)
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
- register int key = hash (str, len);
+ int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
- register const char *s = wordlist[key].name;
+ const char *s = wordlist[key].name;
if (*str == *s && !strcmp (str + 1, s + 1))
return &wordlist[key];
@@ -209,4 +209,3 @@ mrb_reserved_word (register const char *str, register unsigned int len)
return 0;
}
#line 50 "/home/matz/work/mruby/mrbgems/mruby-compiler/core/keywords"
-