Commit b0791fa9 by Kaveh R. Ghazi Committed by Kaveh Ghazi

com.c (ffecom_file_, [...]): Constify a char*.

        * com.c (ffecom_file_, ffecom_file, file_buf,
        ffecom_open_include_): Constify a char*.
        (ffecom_possible_partial_overlap_): Mark parameter `expr2' with
        ATTRIBUTE_UNUSED.
        (ffecom_init_0): Use a fully prototyped cast in call to bsearch.
        (lang_print_error_function): ANSI-fy.

        * com.h (ffecom_file): Constify a char*.

        * fini.c (main): Call return, not exit.

        * g77spec.c (lang_specific_driver): Use non-const *in_argv in
        assignment.

        * intrin.c (ffeintrin_cmp_name_): Don't needlessly cast away
        const-ness.

From-SVN: r30693
parent 14657de8
Sun Nov 28 21:39:05 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* com.c (ffecom_file_, ffecom_file, file_buf,
ffecom_open_include_): Constify a char*.
(ffecom_possible_partial_overlap_): Mark parameter `expr2' with
ATTRIBUTE_UNUSED.
(ffecom_init_0): Use a fully prototyped cast in call to bsearch.
(lang_print_error_function): ANSI-fy.
* com.h (ffecom_file): Constify a char*.
* fini.c (main): Call return, not exit.
* g77spec.c (lang_specific_driver): Use non-const *in_argv in
assignment.
* intrin.c (ffeintrin_cmp_name_): Don't needlessly cast away
const-ness.
Sun Nov 28 21:15:29 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Sun Nov 28 21:15:29 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* com.c (ffecom_get_invented_identifier): Rewrite to take an ellipses. * com.c (ffecom_get_invented_identifier): Rewrite to take an ellipses.
......
...@@ -484,7 +484,7 @@ static tree start_decl (tree decl, bool is_top_level); ...@@ -484,7 +484,7 @@ static tree start_decl (tree decl, bool is_top_level);
static void start_function (tree name, tree type, int nested, int public); static void start_function (tree name, tree type, int nested, int public);
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */ #endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
#if FFECOM_GCC_INCLUDE #if FFECOM_GCC_INCLUDE
static void ffecom_file_ (char *name); static void ffecom_file_ (const char *name);
static void ffecom_initialize_char_syntax_ (void); static void ffecom_initialize_char_syntax_ (void);
static void ffecom_close_include_ (FILE *f); static void ffecom_close_include_ (FILE *f);
static int ffecom_decode_include_option_ (char *spec); static int ffecom_decode_include_option_ (char *spec);
...@@ -1566,7 +1566,7 @@ ffecom_widest_expr_type_ (ffebld list) ...@@ -1566,7 +1566,7 @@ ffecom_widest_expr_type_ (ffebld list)
aliasing of arguments, it isn't a concern. */ aliasing of arguments, it isn't a concern. */
static bool static bool
ffecom_possible_partial_overlap_ (ffebld expr1, ffebld expr2) ffecom_possible_partial_overlap_ (ffebld expr1, ffebld expr2 ATTRIBUTE_UNUSED)
{ {
ffesymbol sym; ffesymbol sym;
ffestorag st; ffestorag st;
...@@ -11581,7 +11581,7 @@ ffecom_init_0 () ...@@ -11581,7 +11581,7 @@ ffecom_init_0 ()
double fl; double fl;
name = bsearch ("foo", &names[0], ARRAY_SIZE (names), sizeof (names[0]), name = bsearch ("foo", &names[0], ARRAY_SIZE (names), sizeof (names[0]),
(int (*)()) strcmp); (int (*)(const void *, const void *)) strcmp);
if (name != (char *) &names[2]) if (name != (char *) &names[2])
{ {
assert ("bsearch doesn't work, #define FFEPROJ_BSEARCH 0 in proj.h" assert ("bsearch doesn't work, #define FFEPROJ_BSEARCH 0 in proj.h"
...@@ -12461,7 +12461,7 @@ ffecom_modify (tree newtype, tree lhs, ...@@ -12461,7 +12461,7 @@ ffecom_modify (tree newtype, tree lhs,
/* Register source file name. */ /* Register source file name. */
void void
ffecom_file (char *name) ffecom_file (const char *name)
{ {
#if FFECOM_GCC_INCLUDE #if FFECOM_GCC_INCLUDE
ffecom_file_ (name); ffecom_file_ (name);
...@@ -14304,9 +14304,8 @@ lang_printable_name (tree decl, int v) ...@@ -14304,9 +14304,8 @@ lang_printable_name (tree decl, int v)
an error. */ an error. */
#if BUILT_FOR_270 #if BUILT_FOR_270
void static void
lang_print_error_function (file) lang_print_error_function (const char *file)
const char *file;
{ {
static ffeglobal last_g = NULL; static ffeglobal last_g = NULL;
static ffesymbol last_s = NULL; static ffesymbol last_s = NULL;
...@@ -15816,9 +15815,9 @@ static struct file_name_list *last_include = NULL; /* Last in chain */ ...@@ -15816,9 +15815,9 @@ static struct file_name_list *last_include = NULL; /* Last in chain */
and for expanding macro arguments. */ and for expanding macro arguments. */
#define INPUT_STACK_MAX 400 #define INPUT_STACK_MAX 400
static struct file_buf { static struct file_buf {
char *fname; const char *fname;
/* Filename specified with #line command. */ /* Filename specified with #line command. */
char *nominal_fname; const char *nominal_fname;
/* Record where in the search path this file was found. /* Record where in the search path this file was found.
For #include_next. */ For #include_next. */
struct file_name_list *dir; struct file_name_list *dir;
...@@ -16160,7 +16159,7 @@ read_name_map (dirname) ...@@ -16160,7 +16159,7 @@ read_name_map (dirname)
} }
static void static void
ffecom_file_ (char *name) ffecom_file_ (const char *name)
{ {
FILE_BUF *fp; FILE_BUF *fp;
...@@ -16273,7 +16272,7 @@ ffecom_open_include_ (char *name, ffewhereLine l, ffewhereColumn c) ...@@ -16273,7 +16272,7 @@ ffecom_open_include_ (char *name, ffewhereLine l, ffewhereColumn c)
{ {
int n; int n;
char *ep; char *ep;
char *nam; const char *nam;
if ((nam = fp->nominal_fname) != NULL) if ((nam = fp->nominal_fname) != NULL)
{ {
......
...@@ -319,7 +319,7 @@ tree ffecom_make_tempvar (const char *commentary, tree type, ...@@ -319,7 +319,7 @@ tree ffecom_make_tempvar (const char *commentary, tree type,
ffetargetCharacterSize size, int elements); ffetargetCharacterSize size, int elements);
tree ffecom_modify (tree newtype, tree lhs, tree rhs); tree ffecom_modify (tree newtype, tree lhs, tree rhs);
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */ #endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
void ffecom_file (char *name); void ffecom_file (const char *name);
void ffecom_notify_init_storage (ffestorag st); void ffecom_notify_init_storage (ffestorag st);
void ffecom_notify_init_symbol (ffesymbol s); void ffecom_notify_init_symbol (ffesymbol s);
void ffecom_notify_primary_entry (ffesymbol fn); void ffecom_notify_primary_entry (ffesymbol fn);
......
...@@ -267,7 +267,7 @@ main (int argc, char **argv) ...@@ -267,7 +267,7 @@ main (int argc, char **argv)
if (argc != 4) if (argc != 4)
{ {
fprintf (stderr, "Command form: fini input output-code output-include\n"); fprintf (stderr, "Command form: fini input output-code output-include\n");
exit (1); return (1);
} }
input_name = argv[1]; input_name = argv[1];
...@@ -278,21 +278,21 @@ main (int argc, char **argv) ...@@ -278,21 +278,21 @@ main (int argc, char **argv)
if (in == NULL) if (in == NULL)
{ {
fprintf (stderr, "Cannot open \"%s\"\n", input_name); fprintf (stderr, "Cannot open \"%s\"\n", input_name);
exit (1); return (1);
} }
out = fopen (output_name, "w"); out = fopen (output_name, "w");
if (out == NULL) if (out == NULL)
{ {
fclose (in); fclose (in);
fprintf (stderr, "Cannot open \"%s\"\n", output_name); fprintf (stderr, "Cannot open \"%s\"\n", output_name);
exit (1); return (1);
} }
incl = fopen (include_name, "w"); incl = fopen (include_name, "w");
if (incl == NULL) if (incl == NULL)
{ {
fclose (in); fclose (in);
fprintf (stderr, "Cannot open \"%s\"\n", include_name); fprintf (stderr, "Cannot open \"%s\"\n", include_name);
exit (1); return (1);
} }
/* Get past the initial block-style comment (man, this parsing code is just /* Get past the initial block-style comment (man, this parsing code is just
...@@ -316,7 +316,7 @@ main (int argc, char **argv) ...@@ -316,7 +316,7 @@ main (int argc, char **argv)
else else
{ {
assert ("EOF too soon!" == NULL); assert ("EOF too soon!" == NULL);
exit (1); return (1);
} }
} }
...@@ -441,7 +441,7 @@ main (int argc, char **argv) ...@@ -441,7 +441,7 @@ main (int argc, char **argv)
#endif #endif
if (do_exit) if (do_exit)
exit (1); return (1);
/* First output the #include file. */ /* First output the #include file. */
...@@ -624,7 +624,7 @@ typedef enum %s_ %s;\n\ ...@@ -624,7 +624,7 @@ typedef enum %s_ %s;\n\
fclose (incl); fclose (incl);
if (in != stdin) if (in != stdin)
fclose (in); fclose (in);
exit (0); return (0);
} }
void void
......
...@@ -304,7 +304,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) ...@@ -304,7 +304,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
fprintf (stderr, "\n"); fprintf (stderr, "\n");
#endif #endif
real_g77_newargv = argv; real_g77_newargv = *in_argv;
g77_xargc = argc; g77_xargc = argc;
g77_xargv = argv; g77_xargv = argv;
......
...@@ -1165,9 +1165,9 @@ ffeintrin_check_any_ (ffebld arglist) ...@@ -1165,9 +1165,9 @@ ffeintrin_check_any_ (ffebld arglist)
static int static int
ffeintrin_cmp_name_ (const void *name, const void *intrinsic) ffeintrin_cmp_name_ (const void *name, const void *intrinsic)
{ {
const char *uc = ((struct _ffeintrin_name_ *) intrinsic)->name_uc; const char *uc = ((const struct _ffeintrin_name_ *) intrinsic)->name_uc;
const char *lc = ((struct _ffeintrin_name_ *) intrinsic)->name_lc; const char *lc = ((const struct _ffeintrin_name_ *) intrinsic)->name_lc;
const char *ic = ((struct _ffeintrin_name_ *) intrinsic)->name_ic; const char *ic = ((const struct _ffeintrin_name_ *) intrinsic)->name_ic;
return ffesrc_strcmp_2c (ffe_case_intrin (), name, uc, lc, ic); return ffesrc_strcmp_2c (ffe_case_intrin (), name, uc, lc, ic);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment