From fnaumann@mail.cs.uni-magdeburg.de Mon Dec 8 11:27:29 2003 Date: Mon, 8 Dec 2003 11:22:56 +0100 (CET) From: Standa Opichal To: MiNT Mailing List Subject: [MiNT] gemlib OBSPEC & TEDINFO problem Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Delivered-To: mint@fishpool.com Delivered-To: mint@lists.fishpool.fi X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: opichals@seznam.cz Precedence: bulk List-help: List-unsubscribe: List-ID: X-List-ID: 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