Fix idiocy in previous patch
Thorsten Glaser
tg@66h.42h.de
Sun Jul 17 14:23:00 GMT 2005
More information about the Binutils mailing list
Sun Jul 17 14:23:00 GMT 2005
- Previous message (by thread): Fix idiocy in previous patch
- Next message (by thread): How to reclaim .rela.dyn entries for symbols that become hidden?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Alexandre Oliva dixit:
>You can do that in C. Just make the cases the `then' part of if(0)s:
>
>switch (foo)
> {
> case 0: prefix="hi";
> if (0) { case 1: prefix="bye"; }
> if (0) { case 2: prefix="ciao"; }
> strcpy (buffer, "%s Nick", prefix);
> break;
> }
>
>then hope nobody ever has to look at this piece of code again :-)
evilwm does it like this.
>From event.c:
if (c) {
switch (key) {
/* Sorry about all these if (0)s, but they actually
* *do* do something useful... */
[...]
break;
case KEY_SLEFT:
c->width -= c->width_inc; if (0)
case KEY_SDOWN:
c->height += c->height_inc; if (0)
case KEY_SUP:
c->height -= c->height_inc; if (0)
case KEY_SRIGHT:
c->width += c->width_inc;
if (c->width < 1)
c->width = 1;
if (c->height < 1)
c->height = 1;
moveresize(c);
break;
[...]
//mirabile
--
I believe no one can invent an algorithm. One just happens to hit upon it
when God enlightens him. Or only God invents algorithms, we merely copy them.
If you don't believe in God, just consider God as Nature if you won't deny
existence. -- Coywolf Qi Hunt
- Previous message (by thread): Fix idiocy in previous patch
- Next message (by thread): How to reclaim .rela.dyn entries for symbols that become hidden?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list