Skip to content

Commit

Permalink
Fix warnings about unhandled enumeration values
Browse files Browse the repository at this point in the history
Simply adding a default to the switch statement makes it clear that the other
values don't need special treatment. Makes the compiler specific pragmas
obsolete.
  • Loading branch information
niner committed Nov 29, 2019
1 parent 13b618c commit 8ac4ac2
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/spesh/arg_guard.c
Expand Up @@ -531,15 +531,13 @@ void MVM_spesh_arg_guard_gc_mark(MVMThreadContext *tc, MVMSpeshArgGuard *ag,
if (ag) {
MVMuint32 i;
for (i = 0; i < ag->used_nodes; i++) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wswitch"
switch (ag->nodes[i].op) {
switch (ag->nodes[i].op)
case MVM_SPESH_GUARD_OP_STABLE_CONC:
case MVM_SPESH_GUARD_OP_STABLE_TYPE:
case MVM_SPESH_GUARD_OP_STABLE_TYPE: {
MVM_gc_worklist_add(tc, worklist, &(ag->nodes[i].st));
break;
default: break;
}
#pragma clang diagnostic pop
}
}
}
Expand All @@ -549,16 +547,14 @@ void MVM_spesh_arg_guard_gc_describe(MVMThreadContext *tc, MVMHeapSnapshotState
if (ag) {
MVMuint32 i;
for (i = 0; i < ag->used_nodes; i++) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wswitch"
switch (ag->nodes[i].op) {
case MVM_SPESH_GUARD_OP_STABLE_CONC:
case MVM_SPESH_GUARD_OP_STABLE_TYPE:
MVM_profile_heap_add_collectable_rel_idx(tc, ss,
(MVMCollectable*)(ag->nodes[i].st), i);
break;
default: break;
}
#pragma clang diagnostic pop
}
}
}
Expand Down

0 comments on commit 8ac4ac2

Please sign in to comment.