mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13: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
|
@ -1357,7 +1357,7 @@ static void ehci_execute_complete(EHCIQueue *q)
|
|||
default:
|
||||
/* should not be triggerable */
|
||||
fprintf(stderr, "USB invalid response %d\n", p->packet.status);
|
||||
assert(0);
|
||||
g_assert_not_reached();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2142,7 +2142,7 @@ static void ehci_advance_state(EHCIState *ehci, int async)
|
|||
default:
|
||||
fprintf(stderr, "Bad state!\n");
|
||||
again = -1;
|
||||
assert(0);
|
||||
g_assert_not_reached();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2206,7 +2206,7 @@ static void ehci_advance_async_state(EHCIState *ehci)
|
|||
/* this should only be due to a developer mistake */
|
||||
fprintf(stderr, "ehci: Bad asynchronous state %d. "
|
||||
"Resetting to active\n", ehci->astate);
|
||||
assert(0);
|
||||
g_assert_not_reached();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2256,7 +2256,7 @@ static void ehci_advance_periodic_state(EHCIState *ehci)
|
|||
/* this should only be due to a developer mistake */
|
||||
fprintf(stderr, "ehci: Bad periodic state %d. "
|
||||
"Resetting to active\n", ehci->pstate);
|
||||
assert(0);
|
||||
g_assert_not_reached();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue