+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>
* com.c (ffecom_get_invented_identifier): Rewrite to take an ellipses.
static void start_function (tree name, tree type, int nested, int public);
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
#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_close_include_ (FILE *f);
static int ffecom_decode_include_option_ (char *spec);
aliasing of arguments, it isn't a concern. */
static bool
-ffecom_possible_partial_overlap_ (ffebld expr1, ffebld expr2)
+ffecom_possible_partial_overlap_ (ffebld expr1, ffebld expr2 ATTRIBUTE_UNUSED)
{
ffesymbol sym;
ffestorag st;
double fl;
name = bsearch ("foo", &names[0], ARRAY_SIZE (names), sizeof (names[0]),
- (int (*)()) strcmp);
+ (int (*)(const void *, const void *)) strcmp);
if (name != (char *) &names[2])
{
assert ("bsearch doesn't work, #define FFEPROJ_BSEARCH 0 in proj.h"
/* Register source file name. */
void
-ffecom_file (char *name)
+ffecom_file (const char *name)
{
#if FFECOM_GCC_INCLUDE
ffecom_file_ (name);
an error. */
#if BUILT_FOR_270
-void
-lang_print_error_function (file)
- const char *file;
+static void
+lang_print_error_function (const char *file)
{
static ffeglobal last_g = NULL;
static ffesymbol last_s = NULL;
and for expanding macro arguments. */
#define INPUT_STACK_MAX 400
static struct file_buf {
- char *fname;
+ const char *fname;
/* Filename specified with #line command. */
- char *nominal_fname;
+ const char *nominal_fname;
/* Record where in the search path this file was found.
For #include_next. */
struct file_name_list *dir;
}
static void
-ffecom_file_ (char *name)
+ffecom_file_ (const char *name)
{
FILE_BUF *fp;
{
int n;
char *ep;
- char *nam;
+ const char *nam;
if ((nam = fp->nominal_fname) != NULL)
{
ffetargetCharacterSize size, int elements);
tree ffecom_modify (tree newtype, tree lhs, tree rhs);
#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_symbol (ffesymbol s);
void ffecom_notify_primary_entry (ffesymbol fn);
if (argc != 4)
{
fprintf (stderr, "Command form: fini input output-code output-include\n");
- exit (1);
+ return (1);
}
input_name = argv[1];
if (in == NULL)
{
fprintf (stderr, "Cannot open \"%s\"\n", input_name);
- exit (1);
+ return (1);
}
out = fopen (output_name, "w");
if (out == NULL)
{
fclose (in);
fprintf (stderr, "Cannot open \"%s\"\n", output_name);
- exit (1);
+ return (1);
}
incl = fopen (include_name, "w");
if (incl == NULL)
{
fclose (in);
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
else
{
assert ("EOF too soon!" == NULL);
- exit (1);
+ return (1);
}
}
#endif
if (do_exit)
- exit (1);
+ return (1);
/* First output the #include file. */
fclose (incl);
if (in != stdin)
fclose (in);
- exit (0);
+ return (0);
}
void
fprintf (stderr, "\n");
#endif
- real_g77_newargv = argv;
+ real_g77_newargv = *in_argv;
g77_xargc = argc;
g77_xargv = argv;
static int
ffeintrin_cmp_name_ (const void *name, const void *intrinsic)
{
- const char *uc = ((struct _ffeintrin_name_ *) intrinsic)->name_uc;
- const char *lc = ((struct _ffeintrin_name_ *) intrinsic)->name_lc;
- const char *ic = ((struct _ffeintrin_name_ *) intrinsic)->name_ic;
+ const char *uc = ((const struct _ffeintrin_name_ *) intrinsic)->name_uc;
+ const char *lc = ((const struct _ffeintrin_name_ *) intrinsic)->name_lc;
+ const char *ic = ((const struct _ffeintrin_name_ *) intrinsic)->name_ic;
return ffesrc_strcmp_2c (ffe_case_intrin (), name, uc, lc, ic);
}