From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15420 invoked by alias); 1 Aug 2002 22:35:53 -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 15412 invoked from network); 1 Aug 2002 22:35:52 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by sources.redhat.com with SMTP; 1 Aug 2002 22:35:52 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id g71MZqp08225; Thu, 1 Aug 2002 15:35:52 -0700 From: david carlton MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15689.47047.286781.306836@jackfruit.Stanford.EDU> Date: Thu, 01 Aug 2002 15:35:00 -0000 To: gdb-patches@sources.redhat.com Subject: superfluous line in hpread.c Cc: carlton@math.stanford.edu X-SW-Source: 2002-08/txt/msg00033.txt.bz2 While in the middle of trying to track down a bug involving static data members, I noticed that hpread.c(hpread_read_struct_type) contains the consecutive lines FIELD_BITSIZE (list->field) = -1; /* indicates static member */ SET_FIELD_PHYSNAME (list->field, 0); /* initialize to empty */ Given the following definitions from gdbtypes.h: #define FIELD_BITSIZE(thisfld) ((thisfld).bitsize) #define SET_FIELD_PHYSNAME(thisfld, name) \ ((thisfld).bitsize = -1, FIELD_PHYSNAME(thisfld) = (name)) the first of those lines is completely superfluous and potentially a bit confusing (e.g. to somebody either trying to track down a bug involving static members or one involving bitfields). Here's a patch that deletes it. No, I haven't tested it (I don't have access to an appropriate machine), but it really does follow from the definitions of the macros that that first line does nothing that the second line doesn't also do. David Carlton carlton@math.stanford.edu 2002-08-01 david carlton * hpread.c (hpread_read_struct_type): Deleted superfluous setting of FIELD_BITSIZE. Index: hpread.c =================================================================== RCS file: /cvs/src/src/gdb/hpread.c,v retrieving revision 1.21 diff -c -p -r1.21 hpread.c *** hpread.c 14 Jun 2002 14:34:25 -0000 1.21 --- hpread.c 1 Aug 2002 22:25:48 -0000 *************** hpread_read_struct_type (dnttpointer hp_ *** 4038,4044 **** list = new; list->field.name = VT (objfile) + fn_fieldp->dsvar.name; - FIELD_BITSIZE (list->field) = -1; /* indicates static member */ SET_FIELD_PHYSNAME (list->field, 0); /* initialize to empty */ memtype = hpread_type_lookup (fn_fieldp->dsvar.type, objfile); --- 4038,4043 ----