mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
misc: Use g_assert_not_reached for code which is expected to be unreachable
The macro g_assert_not_reached is a better self documenting replacement for assert(0) or assert(false). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
b031f413b9
commit
dfc6f86567
10 changed files with 25 additions and 25 deletions
|
@ -136,7 +136,7 @@ static void visit_primitive_type(Visitor *v, void **native, Error **errp)
|
|||
visit_type_int64(v, &pt->value.s64, NULL, errp);
|
||||
break;
|
||||
case PTYPE_EOL:
|
||||
g_assert(false);
|
||||
g_assert_not_reached();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ static void visit_primitive_list(Visitor *v, void **native, Error **errp)
|
|||
visit_type_uint64List(v, &pl->value.u64_integers, NULL, errp);
|
||||
break;
|
||||
default:
|
||||
g_assert(false);
|
||||
g_assert_not_reached();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -500,7 +500,7 @@ static void test_primitive_lists(gconstpointer opaque)
|
|||
break;
|
||||
}
|
||||
default:
|
||||
g_assert(0);
|
||||
g_assert_not_reached();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -656,7 +656,7 @@ static void test_primitive_lists(gconstpointer opaque)
|
|||
break;
|
||||
}
|
||||
default:
|
||||
g_assert(0);
|
||||
g_assert_not_reached();
|
||||
}
|
||||
i++;
|
||||
} while (cur_head);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue