diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-06-15 15:56:42 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 16:21:12 +0900 |
| commit | d2f267a13dcce67e45ef358e1f133362b0a1c12e (patch) | |
| tree | c6583467439c7943a16f68707da589da8baa7292 /mrbgems/mruby-compiler | |
| parent | a4a1e01e8123928057dff9b43e034c1dd137af81 (diff) | |
| download | mruby-d2f267a13dcce67e45ef358e1f133362b0a1c12e.tar.gz mruby-d2f267a13dcce67e45ef358e1f133362b0a1c12e.zip | |
Add casts to silence warnings.
Diffstat (limited to 'mrbgems/mruby-compiler')
| -rw-r--r-- | mrbgems/mruby-compiler/core/codegen.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c index 25e157736..14b53d073 100644 --- a/mrbgems/mruby-compiler/core/codegen.c +++ b/mrbgems/mruby-compiler/core/codegen.c @@ -6,6 +6,7 @@ #include <ctype.h> #include <limits.h> +#include <stdint.h> #include <stdlib.h> #include <string.h> #include <math.h> @@ -612,13 +613,13 @@ new_lit(codegen_scope *s, mrb_value val) switch (mrb_type(val)) { case MRB_TT_STRING: if (RSTR_NOFREE_P(RSTRING(val))) { - pv->tt = (RSTRING_LEN(val)<<2) | IREP_TT_SSTR; + pv->tt = (uint32_t)(RSTRING_LEN(val)<<2) | IREP_TT_SSTR; pv->u.str = RSTRING_PTR(val); } else { char *p; mrb_int len = RSTRING_LEN(val); - pv->tt = (len<<2) | IREP_TT_STR; + pv->tt = (uint32_t)(len<<2) | IREP_TT_STR; p = (char*)codegen_realloc(s, NULL, len+1); memcpy(p, RSTRING_PTR(val), len); p[len] = '\0'; |
