Commit 8db99db2 by Kaveh R. Ghazi Committed by Kaveh Ghazi

Warning fixes:

        * cccp.c (create_definition): Cast to U_CHAR* when assigning to one.
        * cppfiles.c (read_and_prescan): Likewise.
        Start a #define in column 0.
        * cpplib.c (cpp_define): Cast to U_CHAR* when assigning to one.
        (cpp_push_buffer): Likewise for cpp_buffer*.
        (do_include): Change the type of `fbeg' and `fend' to unsigned char*.
        (do_endif): Cast to char* when assigning to one.
        (do_assert): Likewise.
        (do_unassert): Likewise.
        (cpp_read_check_assertion): Change the type of `name' to U_CHAR*.
        Don't do unnecessary cast to char* anymore.
        * genrecog.c (make_insn_sequence): Cast to char** when assigning
        to one.  Cast the first argument of bzero to PTR.
        * loop.c (strength_reduce): Remove unused variable `note'.
        * reload1.c (new_insn_chain): Cast to struct insn_chain* when
        assigning to one.
        * rtl.c (copy_rtx): Use memcpy instead of bcopy.

From-SVN: r25860
parent b03a08ee
Fri Mar 19 15:28:38 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cccp.c (create_definition): Cast to U_CHAR* when assigning to one.
* cppfiles.c (read_and_prescan): Likewise.
Start a #define in column 0.
* cpplib.c (cpp_define): Cast to U_CHAR* when assigning to one.
(cpp_push_buffer): Likewise for cpp_buffer*.
(do_include): Change the type of `fbeg' and `fend' to unsigned char*.
(do_endif): Cast to char* when assigning to one.
(do_assert): Likewise.
(do_unassert): Likewise.
(cpp_read_check_assertion): Change the type of `name' to U_CHAR*.
Don't do unnecessary cast to char* anymore.
* genrecog.c (make_insn_sequence): Cast to char** when assigning
to one. Cast the first argument of bzero to PTR.
* loop.c (strength_reduce): Remove unused variable `note'.
* reload1.c (new_insn_chain): Cast to struct insn_chain* when
assigning to one.
* rtl.c (copy_rtx): Use memcpy instead of bcopy.
Fri Mar 19 11:19:31 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Fri Mar 19 11:19:31 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* calls.c (initialize_argument_information): Mark parameters * calls.c (initialize_argument_information): Mark parameters
......
...@@ -5861,7 +5861,7 @@ create_definition (buf, limit, op) ...@@ -5861,7 +5861,7 @@ create_definition (buf, limit, op)
if (bp == temp->name && rest_args == 1) if (bp == temp->name && rest_args == 1)
{ {
/* This is the ISO C 9x style. */ /* This is the ISO C 9x style. */
temp->name = va_args_name; temp->name = (U_CHAR *) va_args_name;
temp->length = VA_ARGS_NAME_LENGTH; temp->length = VA_ARGS_NAME_LENGTH;
} }
else else
......
...@@ -814,7 +814,7 @@ read_and_prescan (pfile, fp, desc, len) ...@@ -814,7 +814,7 @@ read_and_prescan (pfile, fp, desc, len)
int desc; int desc;
size_t len; size_t len;
{ {
U_CHAR *buf = xmalloc (len); U_CHAR *buf = (U_CHAR *) xmalloc (len);
U_CHAR *ip, *op, *line_base; U_CHAR *ip, *op, *line_base;
U_CHAR *ibase; U_CHAR *ibase;
unsigned int line, deferred_newlines; unsigned int line, deferred_newlines;
...@@ -829,11 +829,11 @@ read_and_prescan (pfile, fp, desc, len) ...@@ -829,11 +829,11 @@ read_and_prescan (pfile, fp, desc, len)
/* Table of characters that can't be handled in the inner loop. /* Table of characters that can't be handled in the inner loop.
Keep these contiguous to optimize the performance of the code generated Keep these contiguous to optimize the performance of the code generated
for the switch that uses them. */ for the switch that uses them. */
#define SPECCASE_EMPTY 0 #define SPECCASE_EMPTY 0
#define SPECCASE_NUL 1 #define SPECCASE_NUL 1
#define SPECCASE_CR 2 #define SPECCASE_CR 2
#define SPECCASE_BACKSLASH 3 #define SPECCASE_BACKSLASH 3
#define SPECCASE_QUESTION 4 #define SPECCASE_QUESTION 4
U_CHAR speccase[256]; U_CHAR speccase[256];
offset = 0; offset = 0;
......
...@@ -188,7 +188,7 @@ cpp_define (pfile, str) ...@@ -188,7 +188,7 @@ cpp_define (pfile, str)
memcpy (buf, str, count - 2); memcpy (buf, str, count - 2);
/* Change the first "=" in the string to a space. If there is none, /* Change the first "=" in the string to a space. If there is none,
tack " 1" on the end. */ tack " 1" on the end. */
p = strchr (buf, '='); p = (U_CHAR *) strchr (buf, '=');
if (p) if (p)
{ {
*p = ' '; *p = ' ';
...@@ -755,7 +755,7 @@ cpp_push_buffer (pfile, buffer, length) ...@@ -755,7 +755,7 @@ cpp_push_buffer (pfile, buffer, length)
return NULL; return NULL;
} }
new = xcalloc (sizeof (cpp_buffer), 1); new = (cpp_buffer *) xcalloc (sizeof (cpp_buffer), 1);
new->if_stack = pfile->if_stack; new->if_stack = pfile->if_stack;
new->cleanup = null_cleanup; new->cleanup = null_cleanup;
...@@ -1006,7 +1006,7 @@ do_include (pfile, keyword) ...@@ -1006,7 +1006,7 @@ do_include (pfile, keyword)
int angle_brackets = 0; /* 0 for "...", 1 for <...> */ int angle_brackets = 0; /* 0 for "...", 1 for <...> */
int before; /* included before? */ int before; /* included before? */
long flen; long flen;
char *fbeg, *fend; unsigned char *fbeg, *fend;
cpp_buffer *fp; cpp_buffer *fp;
enum cpp_token token; enum cpp_token token;
...@@ -2025,7 +2025,7 @@ do_endif (pfile, keyword) ...@@ -2025,7 +2025,7 @@ do_endif (pfile, keyword)
for (ip = CPP_BUFFER (pfile); ; ip = CPP_PREV_BUFFER (ip)) for (ip = CPP_BUFFER (pfile); ; ip = CPP_PREV_BUFFER (ip))
if (ip->fname != NULL) if (ip->fname != NULL)
break; break;
ip->ihash->control_macro = temp->control_macro; ip->ihash->control_macro = (char *) temp->control_macro;
} }
} }
free (temp); free (temp);
...@@ -2748,7 +2748,7 @@ do_assert (pfile, keyword) ...@@ -2748,7 +2748,7 @@ do_assert (pfile, keyword)
cpp_pedwarn (pfile, "ANSI C does not allow `#assert'"); cpp_pedwarn (pfile, "ANSI C does not allow `#assert'");
cpp_skip_hspace (pfile); cpp_skip_hspace (pfile);
sym = CPP_PWRITTEN (pfile); /* remember where it starts */ sym = (char *) CPP_PWRITTEN (pfile); /* remember where it starts */
ret = parse_assertion (pfile); ret = parse_assertion (pfile);
if (ret == 0) if (ret == 0)
goto error; goto error;
...@@ -2790,11 +2790,11 @@ do_assert (pfile, keyword) ...@@ -2790,11 +2790,11 @@ do_assert (pfile, keyword)
(char *)base->value.aschain, -1); (char *)base->value.aschain, -1);
base->value.aschain = this; base->value.aschain = this;
pfile->limit = sym; /* Pop */ pfile->limit = (unsigned char *) sym; /* Pop */
return 0; return 0;
error: error:
pfile->limit = sym; /* Pop */ pfile->limit = (unsigned char *) sym; /* Pop */
skip_rest_of_line (pfile); skip_rest_of_line (pfile);
return 1; return 1;
} }
...@@ -2815,7 +2815,7 @@ do_unassert (pfile, keyword) ...@@ -2815,7 +2815,7 @@ do_unassert (pfile, keyword)
cpp_skip_hspace (pfile); cpp_skip_hspace (pfile);
sym = CPP_PWRITTEN (pfile); /* remember where it starts */ sym = (char *) CPP_PWRITTEN (pfile); /* remember where it starts */
ret = parse_assertion (pfile); ret = parse_assertion (pfile);
if (ret == 0) if (ret == 0)
goto error; goto error;
...@@ -2860,10 +2860,10 @@ do_unassert (pfile, keyword) ...@@ -2860,10 +2860,10 @@ do_unassert (pfile, keyword)
delete_macro (base); /* Last answer for this predicate deleted. */ delete_macro (base); /* Last answer for this predicate deleted. */
} }
pfile->limit = sym; /* Pop */ pfile->limit = (unsigned char *) sym; /* Pop */
return 0; return 0;
error: error:
pfile->limit = sym; /* Pop */ pfile->limit = (unsigned char *) sym; /* Pop */
skip_rest_of_line (pfile); skip_rest_of_line (pfile);
return 1; return 1;
} }
...@@ -2885,7 +2885,7 @@ int ...@@ -2885,7 +2885,7 @@ int
cpp_read_check_assertion (pfile) cpp_read_check_assertion (pfile)
cpp_reader *pfile; cpp_reader *pfile;
{ {
char *name = CPP_PWRITTEN (pfile); U_CHAR *name = CPP_PWRITTEN (pfile);
int result; int result;
HASHNODE *hp; HASHNODE *hp;
...@@ -2895,7 +2895,7 @@ cpp_read_check_assertion (pfile) ...@@ -2895,7 +2895,7 @@ cpp_read_check_assertion (pfile)
result = 0; result = 0;
else else
{ {
hp = cpp_lookup (pfile, name, (char *)CPP_PWRITTEN (pfile) - name, -1); hp = cpp_lookup (pfile, name, CPP_PWRITTEN (pfile) - name, -1);
result = (hp != 0); result = (hp != 0);
} }
......
...@@ -221,8 +221,9 @@ make_insn_sequence (insn, type) ...@@ -221,8 +221,9 @@ make_insn_sequence (insn, type)
{ {
int new_size; int new_size;
new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512); new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512);
insn_name_ptr = xrealloc (insn_name_ptr, sizeof(char *) * new_size); insn_name_ptr =
bzero (insn_name_ptr + insn_name_ptr_size, (char **) xrealloc (insn_name_ptr, sizeof(char *) * new_size);
bzero ((PTR)(insn_name_ptr + insn_name_ptr_size),
sizeof(char *) * (new_size - insn_name_ptr_size)); sizeof(char *) * (new_size - insn_name_ptr_size));
insn_name_ptr_size = new_size; insn_name_ptr_size = new_size;
} }
......
...@@ -4216,8 +4216,6 @@ strength_reduce (scan_start, end, loop_top, insn_count, ...@@ -4216,8 +4216,6 @@ strength_reduce (scan_start, end, loop_top, insn_count,
p != next->insn; p != next->insn;
p = next_insn_in_loop (p, scan_start, end, loop_top)) p = next_insn_in_loop (p, scan_start, end, loop_top))
{ {
rtx note;
if (GET_RTX_CLASS (GET_CODE (p)) != 'i') if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
continue; continue;
if (reg_mentioned_p (old_reg, PATTERN (p))) if (reg_mentioned_p (old_reg, PATTERN (p)))
......
...@@ -509,7 +509,8 @@ new_insn_chain () ...@@ -509,7 +509,8 @@ new_insn_chain ()
if (unused_insn_chains == 0) if (unused_insn_chains == 0)
{ {
c = obstack_alloc (&reload_obstack, sizeof (struct insn_chain)); c = (struct insn_chain *)
obstack_alloc (&reload_obstack, sizeof (struct insn_chain));
c->live_before = OBSTACK_ALLOC_REG_SET (&reload_obstack); c->live_before = OBSTACK_ALLOC_REG_SET (&reload_obstack);
c->live_after = OBSTACK_ALLOC_REG_SET (&reload_obstack); c->live_after = OBSTACK_ALLOC_REG_SET (&reload_obstack);
} }
......
...@@ -325,7 +325,7 @@ copy_rtx (orig) ...@@ -325,7 +325,7 @@ copy_rtx (orig)
all fields need copying, and then clear the fields that should all fields need copying, and then clear the fields that should
not be copied. That is the sensible default behavior, and forces not be copied. That is the sensible default behavior, and forces
us to explicitly document why we are *not* copying a flag. */ us to explicitly document why we are *not* copying a flag. */
bcopy (orig, copy, sizeof (struct rtx_def) - sizeof (rtunion)); memcpy (copy, orig, sizeof (struct rtx_def) - sizeof (rtunion));
/* We do not copy the USED flag, which is used as a mark bit during /* We do not copy the USED flag, which is used as a mark bit during
walks over the RTL. */ walks over the RTL. */
......
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