mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00: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:
committed by
Michael Tokarev
parent
b031f413b9
commit
dfc6f86567
@@ -360,7 +360,7 @@ static BusState *qbus_find(const char *path)
|
||||
|
||||
/* find device */
|
||||
if (sscanf(path+pos, "%127[^/]%n", elem, &len) != 1) {
|
||||
assert(0);
|
||||
g_assert_not_reached();
|
||||
elem[0] = len = 0;
|
||||
}
|
||||
pos += len;
|
||||
@@ -397,7 +397,7 @@ static BusState *qbus_find(const char *path)
|
||||
|
||||
/* find bus */
|
||||
if (sscanf(path+pos, "%127[^/]%n", elem, &len) != 1) {
|
||||
assert(0);
|
||||
g_assert_not_reached();
|
||||
elem[0] = len = 0;
|
||||
}
|
||||
pos += len;
|
||||
|
||||
Reference in New Issue
Block a user