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

[MiNT] gemlib OBSPEC & TEDINFO problem



Hi All!

I have some problems here regarding usability of the OBSPEC and TEDINFO
structures.

Though the mt_gem.h defines the OBJC_COLORWORD structure it doesn't use it
at all. The problem is when you need to get this particular structure from
the TEDINFO when you need to cast it.. Elaboration:

This doesn't work due to types incompatibility:
OBJC_COLORWORD c = (OBJC_COLORWORD)tedinfo.te_color

This works as expected, but is a bit worse to read:
OBJC_COLORWORD c = *(OBJC_COLORWORD*)&tedinfo.te_color;

However if you need this iformation from the OBSPEC you need to do this:
OBJC_COLORWORD c = *(OBJC_COLORWORD*)&((short*)obj.ob_spec->obspec)[1];

All of this is unreadable or requires unnecessary casts. :(

Can't we change this to contain the OBJC_COLORWORD structure directly or
at least as some union inside? We already have something like
__GEMLIB_OLDNAMES so why not to define e.g. __GEMLIB_OLDOBJECT.

What do you say? I can do it by myself, but I would like to hear you
opinions before.

Best regards

STan