diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-04-10 20:02:39 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-04-10 20:02:39 -0400 |
| commit | 11a655032400fda22132c54131546f3e671476a9 (patch) | |
| tree | 929648da483a3ec3693299e9f6aa8108a120ca09 /src/c_tokenizer.cpp | |
| parent | 34eff503265834172f89a8635e49e9f4d124db51 (diff) | |
| download | zig-11a655032400fda22132c54131546f3e671476a9.tar.gz zig-11a655032400fda22132c54131546f3e671476a9.zip | |
fix some -Wconversion errors
Diffstat (limited to 'src/c_tokenizer.cpp')
| -rw-r--r-- | src/c_tokenizer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/c_tokenizer.cpp b/src/c_tokenizer.cpp index e29cf485e6..3532e7db91 100644 --- a/src/c_tokenizer.cpp +++ b/src/c_tokenizer.cpp @@ -548,7 +548,7 @@ void tokenize_c_macro(CTokenize *ctok, const uint8_t *c) { case '6': case '7': ctok->state = CTokStateStrOctal; - ctok->cur_char = *c - '0'; + ctok->cur_char = (uint8_t)(*c - '0'); ctok->octal_index = 1; break; case 'x': @@ -578,12 +578,12 @@ void tokenize_c_macro(CTokenize *ctok, const uint8_t *c) { if (((long)ctok->cur_char) * 8 >= 256) { zig_panic("TODO"); } - ctok->cur_char *= 8; + ctok->cur_char = (uint8_t)(ctok->cur_char * (uint8_t)8); // TODO @add_with_overflow if (((long)ctok->cur_char) + (long)(*c - '0') >= 256) { zig_panic("TODO"); } - ctok->cur_char += *c - '0'; + ctok->cur_char = (uint8_t)(ctok->cur_char + (uint8_t)(*c - '0')); ctok->octal_index += 1; if (ctok->octal_index == 3) { if (ctok->cur_tok->id == CTokIdStrLit) { |
