> I think g++ can be convinced to make the object 4 bytes in size and
> allocated on 4 byte boundaries but I am unsure about others.
>
> In general I agree it would be better to use a structure, so using your
> idea is good as long as we have proof that an array of them can be made
> equivalent to an ARGB image array.
Ah, I was (optimistically) assuming that 'struct { t v; }' is
guaranteed to have the same runtime representation as 't v'. But if
this is not the case, then I concede that for efficiency's sake an
untyped representation is necessary.
I think if it were my own code I would treat the packed form as its
own type and extract Colors with various methods. Now that I think of
it, there's something to be said for this: on systems that take this
approach with strings, the library is free to experiment with utf8,
utf16, or 32 bit internal representations for efficiency while the
calling code deals only with unicode code points. Users of 'char *',
however, are faced with a lot of bother when changing encodings---as
some people on this list have personal experience with :)
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev