This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] nuke CONST_PTR


This patch removes CONST_PTR from the gdb source, fulfilling
PR gdb/92.

  http://sources.redhat.com/cgi-bin/gnatsweb.pl?database=gdb&cmd=view&pr=92
  Nuke CONST_PTR

I'm not sure that gdb is ready for this patch yet.  Here is some
history.

CONST_PTR was introduced in 1996:

  # ChangeLog-1996
  * defs.h:  Define CONST_PTR as blank if compiling with Microsoft
  C, else it's `const'.

In gdb 4.18 and gdb 5.0, CONST_PTR was conditionally defined as nothing
if MSC_VER was defined, and "const" otherwise.  In gdb 5.1 and gdb 5.1.1,
CONST_PTR is always defined to "const".  So CONST_PTR has been
unconditionally defined for only a few months.

However, in gdb 4.18, gdb 5.0, gdb 5.1, and gdb 5.1, c-lang.c has also
contained this line:

  struct type **const (cplus_builtin_types[]) =

So this form has been in gdb source code for four releases already
without drawing complaint.

Testing: I built this on native i686-pc-linux-gnu and ran the test suite.

Okay to apply?

Michael Elizabeth Chastain
<mailto:mec@shout.net>
"love without fear"

===

2002-02-12  Michael Chastain <mec@shout.net>

	* defs.h: Kill CONST_PTR.
	* c-lang.h (c_builtin_types): Change CONST_PTR to simple "const".
	* c-lang.c (c_builtin_types): Likewise.
	* ch-lang.c (ch_builtin_types): Likewise.
	* f-lang.c (f_builtin_types): Likewise.
	* language.c (unknown_builtin_types): Likewise.
	* m2-lang.c (m2_builtin_types): Likewise.
	* p-lang.c (pascal_builtin_types): Likewise.
	* scm-lang.c (c_builtin_types): Likewise.

Index: c-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/c-lang.c,v
retrieving revision 1.9
diff -c -3 -p -r1.9 c-lang.c
*** c-lang.c	2001/12/19 06:29:18	1.9
--- c-lang.c	2002/02/12 10:11:25
***************
*** 1,5 ****
  /* C language support routines for GDB, the GNU debugger.
!    Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000
     Free Software Foundation, Inc.
  
     This file is part of GDB.
--- 1,5 ----
  /* C language support routines for GDB, the GNU debugger.
!    Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002
     Free Software Foundation, Inc.
  
     This file is part of GDB.
*************** const struct op_print c_op_print_tab[] =
*** 385,391 ****
    {NULL, 0, 0, 0}
  };
  
! struct type **CONST_PTR (c_builtin_types[]) =
  {
    &builtin_type_int,
    &builtin_type_long,
--- 385,391 ----
    {NULL, 0, 0, 0}
  };
  
! struct type **const (c_builtin_types[]) =
  {
    &builtin_type_int,
    &builtin_type_long,
Index: c-lang.h
===================================================================
RCS file: /cvs/src/src/gdb/c-lang.h,v
retrieving revision 1.3
diff -c -3 -p -r1.3 c-lang.h
*** c-lang.h	2001/03/06 08:21:06	1.3
--- c-lang.h	2002/02/12 10:11:25
***************
*** 1,5 ****
  /* C language support definitions for GDB, the GNU debugger.
!    Copyright 1992, 1994, 1995, 1996, 1997, 1998, 2000
     Free Software Foundation, Inc.
  
     This file is part of GDB.
--- 1,5 ----
  /* C language support definitions for GDB, the GNU debugger.
!    Copyright 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2002
     Free Software Foundation, Inc.
  
     This file is part of GDB.
*************** extern void c_printstr (struct ui_file *
*** 51,57 ****
  
  extern struct type *c_create_fundamental_type (struct objfile *, int);
  
! extern struct type **CONST_PTR (c_builtin_types[]);
  
  /* These are in c-typeprint.c: */
  
--- 51,57 ----
  
  extern struct type *c_create_fundamental_type (struct objfile *, int);
  
! extern struct type **const (c_builtin_types[]);
  
  /* These are in c-typeprint.c: */
  
Index: ch-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ch-lang.c,v
retrieving revision 1.8
diff -c -3 -p -r1.8 ch-lang.c
*** ch-lang.c	2001/12/25 22:24:38	1.8
--- ch-lang.c	2002/02/12 10:11:26
***************
*** 1,5 ****
  /* Chill language support routines for GDB, the GNU debugger.
!    Copyright 1992, 1993, 1994, 1995, 1996, 2000, 2001
     Free Software Foundation, Inc.
  
     This file is part of GDB.
--- 1,5 ----
  /* Chill language support routines for GDB, the GNU debugger.
!    Copyright 1992, 1993, 1994, 1995, 1996, 2000, 2001, 2002
     Free Software Foundation, Inc.
  
     This file is part of GDB.
*************** struct type *builtin_type_chill_long;
*** 322,328 ****
  struct type *builtin_type_chill_ulong;
  struct type *builtin_type_chill_real;
  
! struct type **CONST_PTR (chill_builtin_types[]) =
  {
    &builtin_type_chill_bool,
      &builtin_type_chill_char,
--- 322,328 ----
  struct type *builtin_type_chill_ulong;
  struct type *builtin_type_chill_real;
  
! struct type **const (chill_builtin_types[]) =
  {
    &builtin_type_chill_bool,
      &builtin_type_chill_char,
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.77
diff -c -3 -p -r1.77 defs.h
*** defs.h	2002/02/10 04:08:41	1.77
--- defs.h	2002/02/12 10:11:29
*************** typedef struct ptid ptid_t;
*** 986,993 ****
  #include "fopen-same.h"
  #endif
  
- #define CONST_PTR const
- 
  /* Defaults for system-wide constants (if not defined by xm.h, we fake it).
     FIXME: Assumes 2's complement arithmetic */
  
--- 986,991 ----
Index: f-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/f-lang.c,v
retrieving revision 1.8
diff -c -3 -p -r1.8 f-lang.c
*** f-lang.c	2001/03/06 08:21:07	1.8
--- f-lang.c	2002/02/12 10:11:30
***************
*** 1,5 ****
  /* Fortran language support routines for GDB, the GNU debugger.
!    Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
     Free Software Foundation, Inc.
     Contributed by Motorola.  Adapted from the C parser by Farooq Butt
     (fmbutt@engage.sps.mot.com).
--- 1,5 ----
  /* Fortran language support routines for GDB, the GNU debugger.
!    Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
     Free Software Foundation, Inc.
     Contributed by Motorola.  Adapted from the C parser by Farooq Butt
     (fmbutt@engage.sps.mot.com).
*************** static const struct op_print f_op_print_
*** 429,435 ****
    {NULL, 0, 0, 0}
  };
  
! struct type **CONST_PTR (f_builtin_types[]) =
  {
    &builtin_type_f_character,
      &builtin_type_f_logical,
--- 429,435 ----
    {NULL, 0, 0, 0}
  };
  
! struct type **const (f_builtin_types[]) =
  {
    &builtin_type_f_character,
      &builtin_type_f_logical,
Index: language.c
===================================================================
RCS file: /cvs/src/src/gdb/language.c,v
retrieving revision 1.21
diff -c -3 -p -r1.21 language.c
*** language.c	2002/02/05 04:37:21	1.21
--- language.c	2002/02/12 10:11:33
***************
*** 1,5 ****
  /* Multiple source language support for GDB.
!    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
     Free Software Foundation, Inc.
     Contributed by the Department of Computer Science at the State University
     of New York at Buffalo.
--- 1,5 ----
  /* Multiple source language support for GDB.
!    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
     Free Software Foundation, Inc.
     Contributed by the Department of Computer Science at the State University
     of New York at Buffalo.
*************** unk_lang_value_print (struct value *val,
*** 1444,1450 ****
    error ("internal error - unimplemented function unk_lang_value_print called.");
  }
  
! static struct type **CONST_PTR (unknown_builtin_types[]) =
  {
    0
  };
--- 1444,1450 ----
    error ("internal error - unimplemented function unk_lang_value_print called.");
  }
  
! static struct type **const (unknown_builtin_types[]) =
  {
    0
  };
Index: m2-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/m2-lang.c,v
retrieving revision 1.6
diff -c -3 -p -r1.6 m2-lang.c
*** m2-lang.c	2001/03/06 08:21:09	1.6
--- m2-lang.c	2002/02/12 10:11:34
***************
*** 1,5 ****
  /* Modula 2 language support routines for GDB, the GNU debugger.
!    Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000
     Free Software Foundation, Inc.
  
     This file is part of GDB.
--- 1,5 ----
  /* Modula 2 language support routines for GDB, the GNU debugger.
!    Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2002
     Free Software Foundation, Inc.
  
     This file is part of GDB.
*************** struct type *builtin_type_m2_card;
*** 398,404 ****
  struct type *builtin_type_m2_real;
  struct type *builtin_type_m2_bool;
  
! struct type **CONST_PTR (m2_builtin_types[]) =
  {
    &builtin_type_m2_char,
      &builtin_type_m2_int,
--- 398,404 ----
  struct type *builtin_type_m2_real;
  struct type *builtin_type_m2_bool;
  
! struct type **const (m2_builtin_types[]) =
  {
    &builtin_type_m2_char,
      &builtin_type_m2_int,
Index: p-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/p-lang.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 p-lang.c
*** p-lang.c	2001/11/09 09:48:09	1.4
--- p-lang.c	2002/02/12 10:11:35
***************
*** 1,5 ****
  /* Pascal language support routines for GDB, the GNU debugger.
!    Copyright 2000 Free Software Foundation, Inc.
  
     This file is part of GDB.
  
--- 1,5 ----
  /* Pascal language support routines for GDB, the GNU debugger.
!    Copyright 2000, 2002 Free Software Foundation, Inc.
  
     This file is part of GDB.
  
*************** const struct op_print pascal_op_print_ta
*** 407,413 ****
    {NULL, 0, 0, 0}
  };
  
! struct type **const /* CONST_PTR v 4.17 */ (pascal_builtin_types[]) =
  {
    &builtin_type_int,
      &builtin_type_long,
--- 407,413 ----
    {NULL, 0, 0, 0}
  };
  
! struct type **const (pascal_builtin_types[]) =
  {
    &builtin_type_int,
      &builtin_type_long,
Index: scm-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/scm-lang.c,v
retrieving revision 1.7
diff -c -3 -p -r1.7 scm-lang.c
*** scm-lang.c	2002/01/04 05:20:08	1.7
--- scm-lang.c	2002/02/12 10:11:36
*************** static void scm_printstr (struct ui_file
*** 41,47 ****
  			  unsigned int length, int width,
  			  int force_ellipses);
  
! extern struct type **CONST_PTR (c_builtin_types[]);
  
  struct type *builtin_type_scm;
  
--- 41,47 ----
  			  unsigned int length, int width,
  			  int force_ellipses);
  
! extern struct type **const (c_builtin_types[]);
  
  struct type *builtin_type_scm;
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]