Thread (4 messages) 4 messages, 3 authors, 2000-08-06

Re: a GCC question

flat view

From: David Edelsohn <hidden>
Date: 2000-08-06 02:31:57

	I would guess that for smaller numbers of cases, GCC is deciding
that it is more efficient to use a series of "if" statements for a
decision tree instead of a switch statement.  You can explicitly code it
as such, e.g.,

if (bi->dispDeviceDepth == 32)
...
else if (bi-dispDeviceDepth == 16)
...
else if
...
else abort();

(BTW you do not provide a default case for some illegal value in your
switch statement.)

David

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help