From 0f13b49dace06a6e21336b2888ffb3257f0cadbf Mon Sep 17 00:00:00 2001 From: guerby Date: Sat, 17 Nov 2001 11:35:08 +0000 Subject: [PATCH] 2001-11-17 Laurent Guerby * Make-lang.in (GNATLIBFLAGS): Add -W -Wall. * gigi.h (init_decl_processing): Rename to gnat_init_decl_processing. * io-aux.c: Provide K&R prototypes to all functions, reformat code. * lang-spec.h: Add missing struct field to silence warnings. * sysdep.c (rts_get_*): Provide K&R prototype. * sysdep.c (Unlock_Task, Lock_Task): Move to K&R prototype. * traceback.c (Unlock_Task, Lock_Task): Likewise. * tracebak.c (__gnat_backtrace): Remove unused variable. * utils.c (end_subprog_body): Move to K&R style. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47117 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 12 ++++++++++ gcc/ada/Make-lang.in | 2 +- gcc/ada/gigi.h | 2 +- gcc/ada/io-aux.c | 62 +++++++++++++++++++++++++++++++++++++++++++++------- gcc/ada/lang-specs.h | 8 +++---- gcc/ada/sysdep.c | 19 ++++++++++------ gcc/ada/tracebak.c | 7 +++--- gcc/ada/utils.c | 4 ++-- 8 files changed, 89 insertions(+), 27 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index dce151b45cd..b5a7745b7da 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,15 @@ +2001-11-17 Laurent Guerby + + * Make-lang.in (GNATLIBFLAGS): Add -W -Wall. + * gigi.h (init_decl_processing): Rename to gnat_init_decl_processing. + * io-aux.c: Provide K&R prototypes to all functions, reformat code. + * lang-spec.h: Add missing struct field to silence warnings. + * sysdep.c (rts_get_*): Provide K&R prototype. + * sysdep.c (Unlock_Task, Lock_Task): Move to K&R prototype. + * traceback.c (Unlock_Task, Lock_Task): Likewise. + * tracebak.c (__gnat_backtrace): Remove unused variable. + * utils.c (end_subprog_body): Move to K&R style. + Thu Nov 15 18:16:17 2001 Richard Kenner * trans.c, utils2.c: Remove PALIGN parameter to get_inner_reference. diff --git a/gcc/ada/Make-lang.in b/gcc/ada/Make-lang.in index 3ae936e16a2..ab61917d3ef 100644 --- a/gcc/ada/Make-lang.in +++ b/gcc/ada/Make-lang.in @@ -48,7 +48,7 @@ shext = # Extra flags to pass to recursive makes. BOOT_ADAFLAGS= $(ADAFLAGS) ADAFLAGS= -W -Wall -gnatpg -gnata -GNATLIBFLAGS= -gnatpg +GNATLIBFLAGS= -W -Wall -gnatpg GNATLIBCFLAGS= -g -O2 ADA_INCLUDE_DIR = $(libsubdir)/adainclude ADA_RTL_OBJ_DIR = $(libsubdir)/adalib diff --git a/gcc/ada/gigi.h b/gcc/ada/gigi.h index 82848532b05..15d3b65871f 100644 --- a/gcc/ada/gigi.h +++ b/gcc/ada/gigi.h @@ -433,7 +433,7 @@ extern tree pushdecl PARAMS ((tree)); /* Create the predefined scalar types such as `integer_type_node' needed in the gcc back-end and initialize the global binding level. */ -extern void init_decl_processing PARAMS ((void)); +extern void gnat_init_decl_processing PARAMS ((void)); extern void init_gigi_decls PARAMS ((tree, tree)); /* Return an integer type with the number of bits of precision given by diff --git a/gcc/ada/io-aux.c b/gcc/ada/io-aux.c index 33fbd5f2f8e..d42f362caec 100644 --- a/gcc/ada/io-aux.c +++ b/gcc/ada/io-aux.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * $Revision: 1.5 $ + * $Revision: 1.1 $ * * * Copyright (C) 1992-2001 Free Software Foundation, Inc. * * * @@ -34,12 +34,40 @@ #include +#ifdef IN_RTS +#include "tconfig.h" +#else +#include "config.h" +#endif + /* Function wrappers are needed to access the values from Ada which are */ /* defined as C macros. */ -FILE *c_stdin (void) { return stdin; } -FILE *c_stdout (void) { return stdout;} -FILE *c_stderr (void) { return stderr;} +FILE *c_stdin PARAMS ((void)); +FILE *c_stdout PARAMS ((void)); +FILE *c_stderr PARAMS ((void)); +int seek_set_function PARAMS ((void)); +int seek_end_function PARAMS ((void)); +void *null_function PARAMS ((void)); +int c_fileno PARAMS ((FILE *)); + +FILE * +c_stdin () +{ + return stdin; +} + +FILE * +c_stdout () +{ + return stdout; +} + +FILE * +c_stderr () +{ + return stderr; +} #ifndef SEEK_SET /* Symbolic constants for the "fseek" function: */ #define SEEK_SET 0 /* Set file pointer to offset */ @@ -47,8 +75,26 @@ FILE *c_stderr (void) { return stderr;} #define SEEK_END 2 /* Set file pointer to the size of the file plus offset */ #endif -int seek_set_function (void) { return SEEK_SET; } -int seek_end_function (void) { return SEEK_END; } -void *null_function (void) { return NULL; } +int +seek_set_function () +{ + return SEEK_SET; +} + +int +seek_end_function () +{ + return SEEK_END; +} + +void *null_function () +{ + return NULL; +} -int c_fileno (FILE *s) { return fileno (s); } +int +c_fileno (s) + FILE *s; +{ + return fileno (s); +} diff --git a/gcc/ada/lang-specs.h b/gcc/ada/lang-specs.h index 0019bb939d0..cc29d528b17 100644 --- a/gcc/ada/lang-specs.h +++ b/gcc/ada/lang-specs.h @@ -6,7 +6,7 @@ * * * C Header File * * * - * $Revision: 1.17 $ + * $Revision: 1.1 $ * * * Copyright (C) 1992-2001 Free Software Foundation, Inc. * * * @@ -29,8 +29,8 @@ /* This is the contribution to the `default_compilers' array in gcc.c for GNAT. */ - {".ads", "@ada"}, - {".adb", "@ada"}, + {".ads", "@ada", 0}, + {".adb", "@ada", 0}, {"@ada", "gnat1 %{^I*} %{k8:-gnatk8} %{w:-gnatws} %1 %{!Q:-quiet} %{nostdinc*}\ -dumpbase %{.adb:%b.adb}%{.ads:%b.ads}%{!.adb:%{!.ads:%b.ada}}\ @@ -40,4 +40,4 @@ %i %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ %{!S:%{!gnatc:%{!gnatz:%{!gnats:as %a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}\ %{!c:%e-c or -S required for Ada}\ - %{!pipe:%g.s} %A\n}}}} "}, + %{!pipe:%g.s} %A\n}}}} ", 0}, diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c index 3ae033aeeeb..ed8988a8f5a 100644 --- a/gcc/ada/sysdep.c +++ b/gcc/ada/sysdep.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * $Revision$ + * $Revision: 1.3 $ * * * Copyright (C) 1992-2001 Free Software Foundation, Inc. * * * @@ -521,10 +521,15 @@ getc_immediate_common (stream, ch, end_of_file, avail, waiting) will want to import these). We use the same names as the routines used by AdaMagic for compatibility. */ -char *rts_get_hInstance (void) { return (GetModuleHandleA (0)); } -char *rts_get_hPrevInstance (void) { return (0); } -char *rts_get_lpCommandLine (void) { return (GetCommandLineA ()); } -int rts_get_nShowCmd (void) { return (1); } +char *rts_get_hInstance PARAMS ((void)); +char *rts_get_hPrevInstance PARAMS ((void)); +char *rts_get_lpCommandLine PARAMS ((void)); +int rts_get_nShowCmd PARAMS ((void)); + +char *rts_get_hInstance () { return (GetModuleHandleA (0)); } +char *rts_get_hPrevInstance () { return (0); } +char *rts_get_lpCommandLine () { return (GetCommandLineA ()); } +int rts_get_nShowCmd () { return (1); } #endif /* WINNT */ #ifdef VMS @@ -551,10 +556,10 @@ get_gmtoff () #if defined (_AIX) || defined (__EMX__) #define Lock_Task system__soft_links__lock_task -extern void (*Lock_Task) (void); +extern void (*Lock_Task) PARAMS ((void)); #define Unlock_Task system__soft_links__unlock_task -extern void (*Unlock_Task) (void); +extern void (*Unlock_Task) PARAMS ((void)); /* Provide reentrant version of localtime on Aix and OS/2. Note that AiX does provide localtime_r, but in the library libc_r which doesn't get included diff --git a/gcc/ada/tracebak.c b/gcc/ada/tracebak.c index 890d0e8d8c6..287e8d4608b 100644 --- a/gcc/ada/tracebak.c +++ b/gcc/ada/tracebak.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * $Revision$ + * $Revision: 1.2 $ * * * Copyright (C) 2000-2001 Ada Core Technologies, Inc. * * * @@ -61,10 +61,10 @@ #endif #define Lock_Task system__soft_links__lock_task -extern void (*Lock_Task) (void); +extern void (*Lock_Task) PARAMS ((void)); #define Unlock_Task system__soft_links__unlock_task -extern void (*Unlock_Task) (void); +extern void (*Unlock_Task) PARAMS ((void)); #ifndef CURRENT_STACK_FRAME # define CURRENT_STACK_FRAME ({ char __csf; &__csf; }) @@ -202,7 +202,6 @@ __gnat_backtrace (array, size, exclude_min, exclude_max) struct layout *current; void *top_frame; void *top_stack; - void *ret; int cnt = 0; #ifdef PROTECT_SEGV diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index 1b4f80557ad..e5375b4b96a 100644 --- a/gcc/ada/utils.c +++ b/gcc/ada/utils.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * * * Copyright (C) 1992-2001, Free Software Foundation, Inc. * * * @@ -1829,7 +1829,7 @@ begin_subprog_body (subprog_decl) to assembler language output. */ void -end_subprog_body (void) +end_subprog_body () { tree decl; tree cico_list; -- 2.11.0