Re: [gtk-list] Re: ItemFactory anyone?



> Jan Kratochvil wrote:
> > > If you already know what the menu items are going to be and they won't
> > > change at runtime you can just use a case statement in your callback.
> > 
> >   Oh my god, why just don't cast the needed pointer (it WILL be probably pointer),
> > to "guint"? Like in the following example:
> 
> Oh my god, why don't you just go break your code on the Alpha then?  :)
> You'll get a friendly little "segmentation fault" when you assign a
> 64-bit
> pointer to a 32-bit guint.
>
> Shaw Terwilliger

  At first I should say that I'm in no way an Alpha expert or multi-platform geek
(only x86 unfortunately, only some shared access to Linux/Sparc). But:
 
  a) I expect that guint/gint maps to "unsigned int"/"int" on all platforms.
  b) I somewhere heard that GCC relies on the fact that (void *) fits in an "int"
     datatype anyway.
  c) Alpha really should have int/gint 64-bits wide. It's pure 64-bit CPU/system
     so why it would mess with anything smaller?

  But I agree that it maybe isn't the strict all-world portable solution. But
on all normally used machines does this cast causes any problems? I don't know
about any platfowm but read my first sentence. :-)


     					Lace



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]