From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30804 invoked by alias); 28 Feb 2003 15:22:58 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 30788 invoked from network); 28 Feb 2003 15:22:58 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by 172.16.49.205 with SMTP; 28 Feb 2003 15:22:58 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18ooEy-00065A-00 for ; Fri, 28 Feb 2003 11:24:08 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18omLg-00062L-00 for ; Fri, 28 Feb 2003 10:22:56 -0500 Date: Fri, 28 Feb 2003 15:22:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [commit] new observer.[hc] files Message-ID: <20030228152256.GB23109@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <20030228072243.GD6112@gnat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030228072243.GD6112@gnat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-02/txt/msg00808.txt.bz2 On Thu, Feb 27, 2003 at 11:22:43PM -0800, Joel Brobecker wrote: > As requested by Andrew in: > http://sources.redhat.com/ml/gdb-patches/2003-02/msg00773.html > > I checked the attached files in. There have slightly been modified from > the file originally sent: added the copyright headers, some documentation, > introduced the notion of subject from the "Design Patterns" book, added > a missing "static" keyword for an internal function, etc. > /* The internal generic observer. */ > > typedef void (generic_observer_notification_ftype) (const void *data, > const void *args); > > struct observer > { > generic_observer_notification_ftype *notify; > /* No memory management needed for the following field for now. */ > void *data; > }; > static void > observer_normal_stop_notification_stub (const void *data, > const void *unused_args) > { > observer_normal_stop_ftype *notify = (observer_normal_stop_ftype *) data; > (*notify) (); > } Is this extra indirection really necessary? Because I'm 99% sure it won't work on several 64-bit platforms. Function pointers and data pointers are not required to have the same size; on IA-64 I believe that a function pointer is 128 bits and a data pointer is 64 bits. Why not require all observer functions to take the same arguments instead? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer