Fix idiocy in previous patch

Thorsten Glaser tg@66h.42h.de
Sun Jul 17 14:23:00 GMT 2005
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



More information about the Binutils mailing list