From: Kaveh R. Ghazi Date: Fri, 19 Mar 1999 12:43:55 +0000 (+0000) Subject: Warning fixes: X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8db99db275183d379d0b6f2cd80942f6f5f5b4b2;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bf6aa5c743d..9a17c3c956a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,29 @@ +Fri Mar 19 15:28:38 1999 Kaveh R. Ghazi + + * 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 * calls.c (initialize_argument_information): Mark parameters diff --git a/gcc/cccp.c b/gcc/cccp.c index 9fa3d1f271e..a849aabd6b3 100644 --- a/gcc/cccp.c +++ b/gcc/cccp.c @@ -5861,7 +5861,7 @@ create_definition (buf, limit, op) if (bp == temp->name && rest_args == 1) { /* 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; } else diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c index f03b1e2aed6..aac49bd5437 100644 --- a/gcc/cppfiles.c +++ b/gcc/cppfiles.c @@ -814,7 +814,7 @@ read_and_prescan (pfile, fp, desc, len) int desc; size_t len; { - U_CHAR *buf = xmalloc (len); + U_CHAR *buf = (U_CHAR *) xmalloc (len); U_CHAR *ip, *op, *line_base; U_CHAR *ibase; unsigned int line, deferred_newlines; @@ -829,11 +829,11 @@ read_and_prescan (pfile, fp, desc, len) /* Table of characters that can't be handled in the inner loop. Keep these contiguous to optimize the performance of the code generated for the switch that uses them. */ - #define SPECCASE_EMPTY 0 - #define SPECCASE_NUL 1 - #define SPECCASE_CR 2 - #define SPECCASE_BACKSLASH 3 - #define SPECCASE_QUESTION 4 +#define SPECCASE_EMPTY 0 +#define SPECCASE_NUL 1 +#define SPECCASE_CR 2 +#define SPECCASE_BACKSLASH 3 +#define SPECCASE_QUESTION 4 U_CHAR speccase[256]; offset = 0; diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 8cbe5480481..d50848698b0 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -188,7 +188,7 @@ cpp_define (pfile, str) memcpy (buf, str, count - 2); /* Change the first "=" in the string to a space. If there is none, tack " 1" on the end. */ - p = strchr (buf, '='); + p = (U_CHAR *) strchr (buf, '='); if (p) { *p = ' '; @@ -755,7 +755,7 @@ cpp_push_buffer (pfile, buffer, length) return NULL; } - new = xcalloc (sizeof (cpp_buffer), 1); + new = (cpp_buffer *) xcalloc (sizeof (cpp_buffer), 1); new->if_stack = pfile->if_stack; new->cleanup = null_cleanup; @@ -1006,7 +1006,7 @@ do_include (pfile, keyword) int angle_brackets = 0; /* 0 for "...", 1 for <...> */ int before; /* included before? */ long flen; - char *fbeg, *fend; + unsigned char *fbeg, *fend; cpp_buffer *fp; enum cpp_token token; @@ -2025,7 +2025,7 @@ do_endif (pfile, keyword) for (ip = CPP_BUFFER (pfile); ; ip = CPP_PREV_BUFFER (ip)) if (ip->fname != NULL) break; - ip->ihash->control_macro = temp->control_macro; + ip->ihash->control_macro = (char *) temp->control_macro; } } free (temp); @@ -2748,7 +2748,7 @@ do_assert (pfile, keyword) cpp_pedwarn (pfile, "ANSI C does not allow `#assert'"); 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); if (ret == 0) goto error; @@ -2790,11 +2790,11 @@ do_assert (pfile, keyword) (char *)base->value.aschain, -1); base->value.aschain = this; - pfile->limit = sym; /* Pop */ + pfile->limit = (unsigned char *) sym; /* Pop */ return 0; error: - pfile->limit = sym; /* Pop */ + pfile->limit = (unsigned char *) sym; /* Pop */ skip_rest_of_line (pfile); return 1; } @@ -2815,7 +2815,7 @@ do_unassert (pfile, keyword) 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); if (ret == 0) goto error; @@ -2860,10 +2860,10 @@ do_unassert (pfile, keyword) delete_macro (base); /* Last answer for this predicate deleted. */ } - pfile->limit = sym; /* Pop */ + pfile->limit = (unsigned char *) sym; /* Pop */ return 0; error: - pfile->limit = sym; /* Pop */ + pfile->limit = (unsigned char *) sym; /* Pop */ skip_rest_of_line (pfile); return 1; } @@ -2885,7 +2885,7 @@ int cpp_read_check_assertion (pfile) cpp_reader *pfile; { - char *name = CPP_PWRITTEN (pfile); + U_CHAR *name = CPP_PWRITTEN (pfile); int result; HASHNODE *hp; @@ -2895,7 +2895,7 @@ cpp_read_check_assertion (pfile) result = 0; 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); } diff --git a/gcc/genrecog.c b/gcc/genrecog.c index e66a83947fd..f1359470b6b 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -221,8 +221,9 @@ make_insn_sequence (insn, type) { int new_size; new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512); - insn_name_ptr = xrealloc (insn_name_ptr, sizeof(char *) * new_size); - bzero (insn_name_ptr + insn_name_ptr_size, + insn_name_ptr = + (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)); insn_name_ptr_size = new_size; } diff --git a/gcc/loop.c b/gcc/loop.c index 551bcf6359a..f2adbf470c1 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -4216,8 +4216,6 @@ strength_reduce (scan_start, end, loop_top, insn_count, p != next->insn; p = next_insn_in_loop (p, scan_start, end, loop_top)) { - rtx note; - if (GET_RTX_CLASS (GET_CODE (p)) != 'i') continue; if (reg_mentioned_p (old_reg, PATTERN (p))) diff --git a/gcc/reload1.c b/gcc/reload1.c index 02002fdd23d..081b997710f 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -509,7 +509,8 @@ new_insn_chain () 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_after = OBSTACK_ALLOC_REG_SET (&reload_obstack); } diff --git a/gcc/rtl.c b/gcc/rtl.c index 801018e17fe..ae474d08bf1 100644 --- a/gcc/rtl.c +++ b/gcc/rtl.c @@ -325,7 +325,7 @@ copy_rtx (orig) all fields need copying, and then clear the fields that should not be copied. That is the sensible default behavior, and forces 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 walks over the RTL. */