Re: Help with structs



On Aug 27, 10:22 pm, Seebs <usenet-nos...@xxxxxxxxx> wrote:
On 2010-08-28, Jack Trades <jacktradespub...@xxxxxxxxx> wrote:

On Aug 27, 12:27 am, Behind China Blue Eyes <chine.b...@xxxxxxxxx>
wrote:
You can also flatten the switches with something like switch
(100*obj_1->type + obj_2->type).
I'm not quite sure how this would work.  Why multiply by 100?

Imagine that type runs from 1 to 50.

100*type1 + type2 will then run from 101 to 5050, with each
pair unique.  And you can do things like:

        case (TYPE_FLONUM * 100) + TYPE_FIXNUM:
        case (TYPE_FIXNUM * 100) + TYPE_FLONUM:
                /* handle fix/float pair */
                break;

OK. That makes perfect sense now.

Thanks
Jack Trades
.



Relevant Pages

  • Re: The end of Motherhood
    ... future-their countries' and, perhaps, their own. ... to imagine the intense joys and selfish pleasures. ... That makes perfect sense to me. ... That seems to be what most Americans ...
    (soc.men)
  • Re: -naide / -nakute -- whats the difference?
    ... >> imagine that gets my idea across ... > Actually it makes perfect sense. ... something like "Robo is listening without answering." ... the ないで clause is kind of glued onto the main clause ...
    (sci.lang.japan)
  • Re: The end of Motherhood
    ... future-their countries' and, perhaps, their own. ... to imagine the intense joys and selfish pleasures. ... "Replacement only" or declining birthrates can contribute to the ... make perfect sense to you as well? ...
    (soc.men)
  • Re: Help with structs
    ... Imagine that type runs from 1 to 50. ... pair unique. ... Peter Seebach / usenet-nospam@xxxxxxxxx ... I am not speaking for my employer, although they do rent some of my opinions. ...
    (comp.lang.c)
  • Re: Custom Software Development
    ... LMAO. ... Imagine this sentence made perfect sense in the ... OP's native tongue. ...
    (comp.databases.pick)