From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 3794 invoked from network); 17 Nov 1998 00:56:56 -0000 Received: from mail.redhat.com (199.183.24.239) by mail2.redhat.com with SMTP; 17 Nov 1998 00:56:56 -0000 Received: from norad.dodds.net (scorpio@westgate-190-203.res.iastate.edu [129.186.190.203]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id TAA25984 for ; Mon, 16 Nov 1998 19:56:56 -0500 Received: from localhost (scorpio@localhost) by norad.dodds.net (8.8.5/8.8.5) with SMTP id SAA10412; Mon, 16 Nov 1998 18:56:55 -0600 Date: Mon, 16 Nov 1998 18:56:55 -0600 (CST) From: Bibek Sahu To: axp-list@redhat.com cc: sterwill@abisource.com Subject: Re: C++ gurus; AbiWord pointer casting on Alpha In-Reply-To: <19981116104412.A29060@dogbert.io.nu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On a whim, I decided to test this. I compiled and ran the 'testgtk' program that came with gtk+, testing specifically those parts of it that used 'callback_action'. It worked flawlessly. Although I don't know the code well enough to be positive, it appears that 'callback_action' is supposed to be data rather than a function pointer. The 'callback_data' member, defined to be of type gpointer, which is in all the structures that include callback_action might be more appropriate if you need a pointer. - Bob On Mon, 16 Nov 1998, Shaw Terwilliger wrote: > On Sun, Nov 15, 1998 at 10:50:20PM -0500, Michael J. Donahue wrote: > > >> _wd * wd = (_wd *)m_menuFactoryItems[k].callback_action; > > Ulrich's question is the first thing to check. Anyone with experience > > porting 32-bit apps to the Alpha knows that pointer casts are red flags. > > Without even trying the compiler test, I can assure you it's our > casting problem. :) Unfortunately, it's deeper than our code, it's > GTK+. The callback_action member is a "guint", which should be defined > to be sizeof(unsigned int) on your platform. This works on Intels, breaks on > Alphas (and any other platform where sizeof(unsigned int) != > sizeof(unsigned int *)). > > So, now it's time to find out why the GTK+ guys are using guints as > pointer substitutes. I really feel bad for not digging into the code > as soon as Brian put out this message, but I'll soon get to deal with > the Alpha issues every day, thanks to him. :) > > -- > Shaw Terwilliger (twig@advancenet.net sterwill@abisource.com) > > -- > To unsubscribe: send e-mail to axp-list-request@redhat.com with > 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com >