summaryrefslogtreecommitdiff
path: root/gcc/protoize.c
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-14 09:02:55 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-14 09:02:55 +0000
commit274c11d805b29abde5083d1dced7b32ab761041f (patch)
tree512ed0c30b871532bb4d50fed36b99ceca838284 /gcc/protoize.c
parentd77d05180c561683c54a2b9a17fd171e9e2be910 (diff)
downloadgcc-274c11d805b29abde5083d1dced7b32ab761041f.tar.gz
Warning fixes:
* Makefile.in (sched.o): Depend on recog.h. * alias.c (REG_BASE_VALUE): Cast the result of REGNO() macro to (unsigned) when comparing against one. (find_base_value): Likewise. (record_base_value): Cast variable `regno' to (unsigned) when comparing against one. Cast the result of REGNO() macro to (unsigned) when comparing against one. (memrefs_conflict_p): Change type of variables `r_x' and `r_y' to unsigned. (init_alias_analysis): Add unsigned variable `ui'. Use it as loop variable where an unsigned index is needed. * caller-save.c (init_caller_save): Cast `-1' to (enum insn_code) before comparing against one. * collect2.c: Add prototypes for functions `error', `fatal' and `fatal_perror'. Make these functions take variable arguments instead of faking it with a fixed number of args. (write_c_file_stat): Cast the argument of ctype macro to (unsigned char). * combine.c (can_combine_p): Mark parameter `pred' with ATTRIBUTE_UNUSED. (find_split_point): Cast variable `src' to (unsigned HOST_WIDE_INT) when comparing against one. HOST_WIDE_INT) when comparing against one. (simplify_rtx): Cast 1 to (unsigned HOST_WIDE_INT) in shift. (simplify_logical): Likewise. (force_to_mode): Cast result of INTVAL() macro to (unsigned HOST_WIDE_INT) when comparing against one. Cast 1 to (unsigned HOST_WIDE_INT) in shift. (simplify_and_const_int): Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (merge_outer_ops): Cast variable const0 to `unsigned HOST_WIDE_INT' when comparing against the result of GET_MODE_MASK() macro. (simplify_comparison): Likewise for variable `c0'. Cast variable `const_op' to `unsigned HOST_WIDE_INT' when comparing against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast the result of `GET_MODE_MASK()/2' to `HOST_WIDE_INT' when comparing against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (distribute_notes): Wrap variable `cc0_setter' in macro `HAVE_cc0'. config/mips/mips.c (gen_int_relational): Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (output_block_move): Cast `sizeof' expression to (int) when comparing against one. (function_arg): Cast BITS_PER_WORD to `unsigned' when comparing against one. (save_restore_insns): Cast `base_offset' to `long' to match format specifier in fprintf. * config/mips/mips.h (Pmode): Cast the result of `Pmode' macro to `enum machine_mode'. * flow.c (life_analysis_1): Remove unused variable `insn'. * gcc.c (translate_options): Move variables `j' and `k' into the scope in which they are used. Change their types to `size_t'. (set_spec): Cast the argument of ctype macro to `unsigned char'. (read_specs): Likewise. (process_command): Cast `sizeof' to (int) when comparing against one. (do_spec_1): Cast the argument of ctype macro to `unsigned char'. (handle_braces): Cast both sides of `==' expression to `long' to ensure sign matching. (main): Cast variable `i' to `int' when comparing against one. * gcov-io.h (__fetch_long): Change type of parameter `bytes' from int to size_t. Cast variable `i' to size_t when comparing against one. * genattrtab.c (convert_set_attr_alternative): Remove unused parameter `insn_code'. All callers changed. (convert_set_attr): Likewise. * genrecog.c (add_to_sequence): Cast result of XVECLEN() macro to size_t when comparing against one. Likewise for variable `len'. * global.c (global_alloc): Cast variable `max_regno' to size_t when comparing against one. Likewise for variable `max_allocno'. * jump.c (sets_cc0_p): Mark parameter `x' with ATTRIBUTE_UNUSED. * local-alloc.c (validate_equiv_mem_from_store): Mark parameter `set' with ATTRIBUTE_UNUSED. (find_free_reg): Cast `sizeof' expression to (int) when comparing against one. * loop.c (count_loop_regs_set): Remove unused variable `dest'. (strength_reduce): Mark parameter `bct_p' with ATTRIBUTE_UNUSED. (get_condition): Cast variable `const_val' to `unsigned HOST_WIDE_INT' when comparing against one. Cast unsigned expression to HOST_WIDE_INT when comparing against one. (insert_loop_mem): Mark parameter `data' with ATTRIBUTE_UNUSED. (load_mems_and_recount_loop_regs_set): Cast variable `nregs' to `unsigned' when comparing against one. * protoize.c (is_id_char): Change type of parameter `ch' to unsigned char. (munge_compile_params): Cast argument of ctype macro to (const unsigned char). (process_aux_info_file): Cast variable `aux_info_size' to int when comparing against one. (forward_to_next_token_char): Cast argument of ctype macro to `const unsigned char'. (edit_formals_lists): Likewise. (find_rightmost_formals_list): Likewise. (add_local_decl): Likewise. (add_global_decls): Likewise. (edit_fn_definition): Likewise. (do_cleaning): Likewise. (scan_for_missed_items): Likewise. (edit_file): Cast variable `orig_size' to (int) when comparing against one. (main): Cast argument of ctype macro to `const unsigned char'. * recog.c (const_int_operand): Mark parameter `mode' with ATTRIBUTE_UNUSED. * regclass.c (record_reg_classes): Change type of variable `c' to `unsigned char'. Cast `char' array index to `unsigned char'. * reload.c (push_secondary_reload): Cast argument to REG_CLASS_FROM_LETTER() macro to `unsigned char'. * reload1.c (calculate_needs): Cast `char' array index to `unsigned char'. (set_label_offsets): Change type of variable `i' to unsigned int. Cast result of XVECLEN() macro to unsigned when comparing against one. (mark_not_eliminable): Change type of variable `i' to unsigned. (order_regs_for_reload): Likewise. Cast `max_regno' to unsigned when comparing against one. (reload_as_needed): Cast macro NUM_ELIMINABLE_REGS to (int) when comparing against one. (choose_reload_regs): Hide unused label `fail'. (reload_cse_simplify_operands): Cast `char' array index to `unsigned char'. (reload_combine_note_store): Mark parameter `set' with ATTRIBUTE_UNUSED. Cast UNITS_PER_WORD to unsigned when comparing against one. (reload_cse_move2add): Remove unused variable `src2'. * sched.c: Include recog.h. (sched_note_set): Remove unused parameter `b'. All callers changed. (split_hard_reg_notes): Likewise for parameter `orig_insn'. (blockage_range): Cast result of UNIT_BLOCKED() macro to (int) when comparing against one. * stupid.c (stupid_find_reg): Mark parameter `changes_size' with ATTRIBUTE_UNUSED. Cast `sizeof' expression to (int) when comparing against one. * unroll.c (precondition_loop_p): Remove unused parameter `loop_end'. All callers changed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23079 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/protoize.c')
-rw-r--r--gcc/protoize.c63
1 files changed, 36 insertions, 27 deletions
diff --git a/gcc/protoize.c b/gcc/protoize.c
index a7a5ae92e2b..73d8caba390 100644
--- a/gcc/protoize.c
+++ b/gcc/protoize.c
@@ -824,7 +824,7 @@ restore_pointers ()
static int
is_id_char (ch)
- char ch;
+ unsigned char ch;
{
return (ISALNUM (ch) || (ch == '_') || (ch == '$'));
}
@@ -2002,12 +2002,12 @@ munge_compile_params (params_list)
temp_params[param_count++] = compiler_file_name;
for (;;)
{
- while (ISSPACE (*params_list))
+ while (ISSPACE ((const unsigned char)*params_list))
params_list++;
if (!*params_list)
break;
param = params_list;
- while (*params_list && !ISSPACE (*params_list))
+ while (*params_list && !ISSPACE ((const unsigned char)*params_list))
params_list++;
if (param[0] != '-')
temp_params[param_count++]
@@ -2022,9 +2022,10 @@ munge_compile_params (params_list)
case 'c':
break; /* Don't copy these. */
case 'o':
- while (ISSPACE (*params_list))
+ while (ISSPACE ((const unsigned char)*params_list))
params_list++;
- while (*params_list && !ISSPACE (*params_list))
+ while (*params_list
+ && !ISSPACE ((const unsigned char)*params_list))
params_list++;
break;
default:
@@ -2287,7 +2288,8 @@ start_over: ;
/* Read the aux_info file into memory. */
- if (safe_read (aux_info_file, aux_info_base, aux_info_size) != aux_info_size)
+ if (safe_read (aux_info_file, aux_info_base, aux_info_size) !=
+ (int) aux_info_size)
{
int errno_val = errno;
fprintf (stderr, "%s: error reading aux info file `%s': %s\n",
@@ -2955,7 +2957,8 @@ static const char *
forward_to_next_token_char (ptr)
const char *ptr;
{
- for (++ptr; ISSPACE (*ptr); check_source (++ptr < clean_text_limit, 0))
+ for (++ptr; ISSPACE ((const unsigned char)*ptr);
+ check_source (++ptr < clean_text_limit, 0))
continue;
return ptr;
}
@@ -3323,7 +3326,7 @@ edit_formals_lists (end_formals, f_list_count, def_dec_p)
next_end = start_formals - 1;
check_source (next_end > clean_read_ptr, 0);
- while (ISSPACE (*next_end))
+ while (ISSPACE ((const unsigned char)*next_end))
check_source (--next_end > clean_read_ptr, 0);
check_source (*next_end == ')', next_end);
check_source (--next_end > clean_read_ptr, 0);
@@ -3343,7 +3346,8 @@ edit_formals_lists (end_formals, f_list_count, def_dec_p)
const char *func_name_limit;
size_t func_name_len;
- for (func_name_limit = start_formals-1; ISSPACE (*func_name_limit); )
+ for (func_name_limit = start_formals-1;
+ ISSPACE ((const unsigned char)*func_name_limit); )
check_source (--func_name_limit > clean_read_ptr, 0);
for (func_name_start = func_name_limit++;
@@ -3469,8 +3473,8 @@ find_rightmost_formals_list (clean_text_p)
while (*end_formals != ')')
{
- if (ISSPACE (*end_formals))
- while (ISSPACE (*end_formals))
+ if (ISSPACE ((const unsigned char)*end_formals))
+ while (ISSPACE ((const unsigned char)*end_formals))
check_source (--end_formals > clean_read_ptr, 0);
else
check_source (--end_formals > clean_read_ptr, 0);
@@ -3488,7 +3492,7 @@ find_rightmost_formals_list (clean_text_p)
by an alphabetic character, while others *cannot* validly be followed
by such characters. */
- if ((ch == '{') || ISALPHA (ch))
+ if ((ch == '{') || ISALPHA ((unsigned char)ch))
break;
/* At this point, we have found a right paren, but we know that it is
@@ -3584,7 +3588,7 @@ add_local_decl (def_dec_p, clean_text_p)
We can now just scan backwards and find the left end of the existing
indentation string, and then copy it to the output buffer. */
- for (sp = ep; ISSPACE (*sp) && *sp != '\n'; sp--)
+ for (sp = ep; ISSPACE ((const unsigned char)*sp) && *sp != '\n'; sp--)
continue;
/* Now write out the open { which began this block, and any following
@@ -3665,7 +3669,7 @@ add_global_decls (file_p, clean_text_p)
header. We will put in the added declarations just prior to that. */
scan_p++;
- while (ISSPACE (*scan_p))
+ while (ISSPACE ((const unsigned char)*scan_p))
scan_p++;
scan_p--;
@@ -3834,7 +3838,7 @@ edit_fn_definition (def_dec_p, clean_text_p)
{
have_newlines |= (*scan_orig == '\n');
/* Leave identical whitespace alone. */
- if (!ISSPACE (*scan_orig))
+ if (!ISSPACE ((const unsigned char)*scan_orig))
*((NONCONST char *)scan_orig) = ' '; /* identical - so whiteout */
}
else
@@ -3878,7 +3882,7 @@ do_cleaning (new_clean_text_base, new_clean_text_limit)
scan_p += 2;
while (scan_p[1] != '/' || scan_p[0] != '*')
{
- if (!ISSPACE (*scan_p))
+ if (!ISSPACE ((const unsigned char)*scan_p))
*scan_p = ' ';
if (++scan_p >= new_clean_text_limit)
abort ();
@@ -3893,7 +3897,7 @@ do_cleaning (new_clean_text_base, new_clean_text_limit)
*scan_p = ' ';
while (scan_p[1] != '\n' || scan_p[0] == '\\')
{
- if (!ISSPACE (*scan_p))
+ if (!ISSPACE ((const unsigned char)*scan_p))
*scan_p = ' ';
if (++scan_p >= new_clean_text_limit)
abort ();
@@ -3905,9 +3909,10 @@ do_cleaning (new_clean_text_base, new_clean_text_limit)
non_whitespace_since_newline = 1;
while (scan_p[1] != '\'' || scan_p[0] == '\\')
{
- if (scan_p[0] == '\\' && !ISSPACE (scan_p[1]))
+ if (scan_p[0] == '\\'
+ && !ISSPACE ((const unsigned char)scan_p[1]))
scan_p[1] = ' ';
- if (!ISSPACE (*scan_p))
+ if (!ISSPACE ((const unsigned char)*scan_p))
*scan_p = ' ';
if (++scan_p >= new_clean_text_limit)
abort ();
@@ -3919,14 +3924,15 @@ do_cleaning (new_clean_text_base, new_clean_text_limit)
non_whitespace_since_newline = 1;
while (scan_p[1] != '"' || scan_p[0] == '\\')
{
- if (scan_p[0] == '\\' && !ISSPACE (scan_p[1]))
+ if (scan_p[0] == '\\'
+ && !ISSPACE ((const unsigned char)scan_p[1]))
scan_p[1] = ' ';
- if (!ISSPACE (*scan_p))
+ if (!ISSPACE ((const unsigned char)*scan_p))
*scan_p = ' ';
if (++scan_p >= new_clean_text_limit)
abort ();
}
- if (!ISSPACE (*scan_p))
+ if (!ISSPACE ((const unsigned char)*scan_p))
*scan_p = ' ';
scan_p++;
break;
@@ -4019,12 +4025,12 @@ scan_for_missed_items (file_p)
last_r_paren = scan_p;
- for (ahead_p = scan_p + 1; ISSPACE (*ahead_p); )
+ for (ahead_p = scan_p + 1; ISSPACE ((const unsigned char)*ahead_p); )
check_source (++ahead_p < limit, limit);
scan_p = ahead_p - 1;
- if (ISALPHA (*ahead_p) || *ahead_p == '{')
+ if (ISALPHA ((const unsigned char)*ahead_p) || *ahead_p == '{')
{
const char *last_l_paren;
const int lineno = identify_lineno (ahead_p);
@@ -4038,7 +4044,8 @@ scan_for_missed_items (file_p)
do
{
last_l_paren = careful_find_l_paren (last_r_paren);
- for (last_r_paren = last_l_paren-1; ISSPACE (*last_r_paren); )
+ for (last_r_paren = last_l_paren-1;
+ ISSPACE ((const unsigned char)*last_r_paren); )
check_source (--last_r_paren >= backup_limit, backup_limit);
}
while (*last_r_paren == ')');
@@ -4219,7 +4226,8 @@ edit_file (hp)
in one swell fwoop. Then figure out where the end of the text is and
make sure that it ends with a newline followed by a null. */
- if (safe_read (input_file, new_orig_text_base, orig_size) != orig_size)
+ if (safe_read (input_file, new_orig_text_base, orig_size) !=
+ (int) orig_size)
{
int errno_val = errno;
close (input_file);
@@ -4677,7 +4685,8 @@ main (argc, argv)
{
const char *cp;
- for (cp = varargs_style_indicator; ISALNUM (*cp) || *cp == '_'; cp++)
+ for (cp = varargs_style_indicator;
+ ISALNUM ((const unsigned char)*cp) || *cp == '_'; cp++)
continue;
if (*cp != 0)
varargs_style_indicator = savestring (varargs_style_indicator,