This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Declare some Darwin functions as const


A minor improvement extracted from Apple's sources, plus the
removal of a stray decl. Bootstrapped on powerpc-apple-darwin.

Stan

2002-07-16 Stan Shebs <shebs@apple.com>

* darwin.c (func_name_maybe_scoped): Remove unused decl.
(machopic_function_base_name): Declare result to be const.
(machopic_non_lazy_ptr_name): Ditto.
(machopic_stub_name): Ditto.
* darwin-protos.h: Ditto for the prototypes.

Index: config/darwin-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin-protos.h,v
retrieving revision 1.13
diff -p -r1.13 darwin-protos.h
*** config/darwin-protos.h 4 Jun 2002 07:08:36 -0000 1.13
--- config/darwin-protos.h 16 Jul 2002 23:50:03 -0000
*************** extern int name_needs_quotes PARAMS ((co
*** 22,30 ****

extern void machopic_validate_stub_or_non_lazy_ptr PARAMS ((const char *, int));

! extern char *machopic_function_base_name PARAMS ((void));
! extern char *machopic_non_lazy_ptr_name PARAMS ((const char*));
! extern char *machopic_stub_name PARAMS ((const char*));

extern void machopic_picsymbol_stub_section PARAMS ((void));
extern void machopic_symbol_stub_section PARAMS ((void));
--- 22,30 ----

extern void machopic_validate_stub_or_non_lazy_ptr PARAMS ((const char *, int));

! extern const char *machopic_function_base_name PARAMS ((void));
! extern const char *machopic_non_lazy_ptr_name PARAMS ((const char*));
! extern const char *machopic_stub_name PARAMS ((const char*));

extern void machopic_picsymbol_stub_section PARAMS ((void));
extern void machopic_symbol_stub_section PARAMS ((void));
Index: config/darwin.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.c,v
retrieving revision 1.22
diff -p -r1.22 darwin.c
*** config/darwin.c 4 Jun 2002 07:08:37 -0000 1.22
--- config/darwin.c 16 Jul 2002 23:50:03 -0000
*************** Boston, MA 02111-1307, USA. */
*** 38,50 ****
#include "function.h"
#include "ggc.h"
#include "langhooks.h"
-
#include "darwin-protos.h"

extern void machopic_output_stub PARAMS ((FILE *, const char *, const char *));

static int machopic_data_defined_p PARAMS ((const char *));
- static int func_name_maybe_scoped PARAMS ((const char *));
static void update_non_lazy_ptrs PARAMS ((const char *));
static void update_stubs PARAMS ((const char *));

--- 38,48 ----
*************** static char function_base[32];
*** 227,233 ****

static int current_pic_label_num;

! char *
machopic_function_base_name ()
{
static const char *name = NULL;
--- 225,231 ----

static int current_pic_label_num;

! const char *
machopic_function_base_name ()
{
static const char *name = NULL;
*************** static GTY(()) tree machopic_non_lazy_po
*** 263,269 ****
either by finding it in our list of pointer names, or by generating
a new one. */

! char *
machopic_non_lazy_ptr_name (name)
const char *name;
{
--- 261,267 ----
either by finding it in our list of pointer names, or by generating
a new one. */

! const char *
machopic_non_lazy_ptr_name (name)
const char *name;
{
*************** static GTY(()) tree machopic_stubs;
*** 326,332 ****
/* Return the name of the stub corresponding to the given name,
generating a new stub name if necessary. */

! char *
machopic_stub_name (name)
const char *name;
{
--- 324,330 ----
/* Return the name of the stub corresponding to the given name,
generating a new stub name if necessary. */

! const char *
machopic_stub_name (name)
const char *name;
{



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