Skip to content

Commit

Permalink
Fix some printf format type specifiers
Browse files Browse the repository at this point in the history
Fix two in main.c that were causing warnings on clang. Fix some others
that were not giving warnings, but should have been specified as
unsigned, though they should never become big enough for that to
actually matter.
  • Loading branch information
samcv committed Sep 30, 2018
1 parent adef080 commit e218368
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/core/validation.c
Expand Up @@ -219,10 +219,10 @@ static void validate_literal_operand(Validator *val, MVMuint32 flags) {

case MVM_operand_obj:
case MVM_operand_type_var:
fail(val, MSG(val, "operand type %i can't be a literal"), type);
fail(val, MSG(val, "operand type %"PRIu32" can't be a literal"), type);

default:
fail(val, MSG(val, "unknown operand type %i"), type);
fail(val, MSG(val, "unknown operand type %"PRIu32), type);
}

ensure_bytes(val, size);
Expand Down Expand Up @@ -292,7 +292,7 @@ static void validate_reg_operand(Validator *val, MVMuint32 flags) {
}

if (reg_type != operand_type)
fail(val, MSG(val, "operand type %i does not match register type %i"),
fail(val, MSG(val, "operand type %"PRIu32" does not match register type %"PRIu32),
operand_type, reg_type);

next_operand:
Expand Down Expand Up @@ -343,7 +343,7 @@ static void validate_lex_operand(Validator *val, MVMuint32 flags) {
}

if (lex_type != operand_type)
fail(val, MSG(val, "operand type %i does not match lexical type %i"),
fail(val, MSG(val, "operand type %"PRIu32" does not match lexical type %"PRIu32),
operand_type, lex_type);

next_operand:
Expand All @@ -370,7 +370,7 @@ static void validate_operand(Validator *val, MVMuint32 flags) {
break;

default:
fail(val, MSG(val, "invalid instruction rw flag %i"), rw);
fail(val, MSG(val, "invalid instruction rw flag %"PRIu32), rw);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/moar.c
Expand Up @@ -270,7 +270,7 @@ MVMInstance * MVM_vm_create_instance(void) {
if (jit_perf_map && *jit_perf_map) {
char perf_map_filename[32];
snprintf(perf_map_filename, sizeof(perf_map_filename),
"/tmp/perf-%d.map", MVM_proc_getpid(NULL));
"/tmp/perf-%"PRIi64".map", MVM_proc_getpid(NULL));
instance->jit_perf_map = fopen(perf_map_filename, "w");
}
}
Expand All @@ -285,7 +285,7 @@ MVMInstance * MVM_vm_create_instance(void) {
uv_fs_t req;
uv_os_tmpdir(tmpdir, &len);
jit_bytecode_dir = MVM_malloc(len + 32);
snprintf(jit_bytecode_dir, len+32, "%s/moar-jit.%d",
snprintf(jit_bytecode_dir, len+32, "%s/moar-jit.%"PRIi64,
tmpdir, MVM_proc_getpid(NULL));
if (uv_fs_mkdir(NULL, &req, jit_bytecode_dir, 0755, NULL) == 0) {
instance->jit_bytecode_dir = jit_bytecode_dir;
Expand Down

0 comments on commit e218368

Please sign in to comment.