General -Wall warning cleanup, part I.

Submitted-By: Kent Vander Velden <graphix@iastate.edu>
This commit is contained in:
jkh 1996-07-12 19:08:36 +00:00
parent a3b50e31fd
commit 97de575586
58 changed files with 528 additions and 255 deletions

View File

@ -68,7 +68,7 @@ _BS_blt (op, pdst, dstbit, psrc, srcbit, length)
case _BS_alu_nor: case _BS_alu_nor:
ca1 = ONES; cx1 = ONES; ca2 = ONES; cx2 = ONES; ca1 = ONES; cx1 = ONES; ca2 = ONES; cx2 = ONES;
break; break;
case_BS_alu_equiv: case _BS_alu_equiv:
ca1 = 0; cx1 = ONES; ca2 = ONES; cx2 = ONES; ca1 = 0; cx1 = ONES; ca2 = ONES; cx2 = ONES;
break; break;
case _BS_alu_invert: case _BS_alu_invert:
@ -91,7 +91,7 @@ _BS_blt (op, pdst, dstbit, psrc, srcbit, length)
return; return;
} }
{ {
#define COMBINE(dst, src) ((dst) & ((src) & ca1 ^ cx1) ^ ((src) & ca2 ^ cx2)) #define COMBINE(dst, src) ( ((dst) & ( ((src) & ca1) ^ cx1)) ^ ( ((src) & ca2) ^ cx2))
#include "bitdo2.h" #include "bitdo2.h"
} }
} }

View File

@ -67,7 +67,7 @@ _BS_lcompare_0 (ptr0, len0, ptr1, len1)
len0 -= nwords0 * _BS_BITS_PER_WORD; len0 -= nwords0 * _BS_BITS_PER_WORD;
len1 -= nwords1 * _BS_BITS_PER_WORD; len1 -= nwords1 * _BS_BITS_PER_WORD;
if (len0 == 0 || len1 == 0) if (len0 == 0 || len1 == 0)
return len0 == 0 - len1 == 0; return (len0 == 0) - (len1 == 0);
len0 &= _BS_BITS_PER_WORD - 1; len0 &= _BS_BITS_PER_WORD - 1;
len1 &= _BS_BITS_PER_WORD - 1; len1 &= _BS_BITS_PER_WORD - 1;
word0 = *ptr0++ & ~((_BS_word)(~0) _BS_RIGHT len0); word0 = *ptr0++ & ~((_BS_word)(~0) _BS_RIGHT len0);

View File

@ -45,6 +45,7 @@ the executable file might be covered by the GNU General Public License. */
#include "libioP.h" #include "libioP.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h>
#ifdef __STDC__ #ifdef __STDC__
#include <stdlib.h> #include <stdlib.h>
#endif #endif

View File

@ -31,6 +31,8 @@ the executable file might be covered by the GNU General Public License. */
#include "libioP.h" #include "libioP.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/uio.h>
#include <unistd.h>
#ifdef TODO #ifdef TODO
/* Add open, isatty */ /* Add open, isatty */

View File

@ -38,9 +38,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "bi-run.h" #include "bi-run.h"
#include <stdio.h> #include <stdio.h>
#include <string.h>
extern char *xmalloc (), *xrealloc (); extern char *xmalloc (), *xrealloc ();
#ifndef __FreeBSD__
extern void free (); extern void free ();
#endif
extern struct obstack *rtl_obstack; extern struct obstack *rtl_obstack;

View File

@ -24,6 +24,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "flags.h" #include "flags.h"
#include "obstack.h" #include "obstack.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h> #include <ctype.h>
extern struct obstack permanent_obstack; extern struct obstack permanent_obstack;
@ -1457,6 +1459,8 @@ binary_op_error (code)
case LROTATE_EXPR: case LROTATE_EXPR:
case RROTATE_EXPR: case RROTATE_EXPR:
opname = "rotate"; break; opname = "rotate"; break;
default:
break;
} }
error ("invalid operands to binary %s", opname); error ("invalid operands to binary %s", opname);
} }
@ -1543,6 +1547,8 @@ shorten_compare (op0_ptr, op1_ptr, restype_ptr, rescode_ptr)
case GE_EXPR: case GE_EXPR:
code = LE_EXPR; code = LE_EXPR;
break; break;
default:
break;
} }
*rescode_ptr = code; *rescode_ptr = code;
} }
@ -1673,6 +1679,8 @@ shorten_compare (op0_ptr, op1_ptr, restype_ptr, rescode_ptr)
primop1 = TYPE_MAX_VALUE (type); primop1 = TYPE_MAX_VALUE (type);
val = 0; val = 0;
break; break;
default:
break;
} }
type = unsigned_type (type); type = unsigned_type (type);
} }
@ -1770,6 +1778,8 @@ shorten_compare (op0_ptr, op1_ptr, restype_ptr, rescode_ptr)
primop0)))) primop0))))
warning ("unsigned value < 0 is always 0"); warning ("unsigned value < 0 is always 0");
value = integer_zero_node; value = integer_zero_node;
default:
break;
} }
if (value != 0) if (value != 0)
@ -1946,6 +1956,8 @@ truthvalue_conversion (expr)
if (warn_parentheses && C_EXP_ORIGINAL_CODE (expr) == MODIFY_EXPR) if (warn_parentheses && C_EXP_ORIGINAL_CODE (expr) == MODIFY_EXPR)
warning ("suggest parentheses around assignment used as truth value"); warning ("suggest parentheses around assignment used as truth value");
break; break;
default:
break;
} }
if (TREE_CODE (TREE_TYPE (expr)) == COMPLEX_TYPE) if (TREE_CODE (TREE_TYPE (expr)) == COMPLEX_TYPE)

View File

@ -28,6 +28,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <varargs.h> #include <varargs.h>
#endif #endif
#include "insn-flags.h" #include "insn-flags.h"
#include <string.h>
/* Decide whether a function's arguments should be processed /* Decide whether a function's arguments should be processed
from first to last or from last to first. from first to last or from last to first.
@ -233,6 +234,8 @@ calls_function_1 (exp, which)
case RTL_EXPR: case RTL_EXPR:
return 0; return 0;
default:
break;
} }
for (i = 0; i < length; i++) for (i = 0; i < length; i++)

View File

@ -2585,6 +2585,8 @@ find_split_point (loc, insn)
unsignedp = (code == ZERO_EXTRACT); unsignedp = (code == ZERO_EXTRACT);
} }
break; break;
default:
break;
} }
if (len && pos >= 0 && pos + len <= GET_MODE_BITSIZE (GET_MODE (inner))) if (len && pos >= 0 && pos + len <= GET_MODE_BITSIZE (GET_MODE (inner)))
@ -2681,6 +2683,8 @@ find_split_point (loc, insn)
SUBST (XEXP (x, 1), tem); SUBST (XEXP (x, 1), tem);
} }
break; break;
default:
break;
} }
/* Otherwise, select our actions depending on our rtx class. */ /* Otherwise, select our actions depending on our rtx class. */
@ -3856,6 +3860,8 @@ simplify_rtx (x, op0_mode, last, in_dest)
NULL_RTX, 0)); NULL_RTX, 0));
#endif #endif
break;
default:
break; break;
} }
@ -3990,6 +3996,8 @@ simplify_if_then_else (x)
case LT: case LT:
case LE: case LE:
return gen_unary (NEG, mode, mode, gen_unary (ABS, mode, mode, true)); return gen_unary (NEG, mode, mode, gen_unary (ABS, mode, mode, true));
default:
break;
} }
/* Look for MIN or MAX. */ /* Look for MIN or MAX. */
@ -4013,6 +4021,8 @@ simplify_if_then_else (x)
case LEU: case LEU:
case LTU: case LTU:
return gen_binary (UMIN, mode, true, false); return gen_binary (UMIN, mode, true, false);
default:
break;
} }
#if STORE_FLAG_VALUE == 1 || STORE_FLAG_VALUE == -1 #if STORE_FLAG_VALUE == 1 || STORE_FLAG_VALUE == -1
@ -4692,6 +4702,8 @@ simplify_logical (x, last)
return gen_rtx_combine (reverse_condition (GET_CODE (op0)), return gen_rtx_combine (reverse_condition (GET_CODE (op0)),
mode, XEXP (op0, 0), XEXP (op0, 1)); mode, XEXP (op0, 0), XEXP (op0, 1));
break; break;
default:
break;
} }
return x; return x;
@ -5306,6 +5318,8 @@ extract_left_shift (x, count)
return gen_binary (code, mode, tem, return gen_binary (code, mode, tem,
GEN_INT (INTVAL (XEXP (x, 1)) >> count)); GEN_INT (INTVAL (XEXP (x, 1)) >> count));
break;
default:
break; break;
} }
@ -5548,6 +5562,8 @@ make_compound_operation (x, in_code)
return newer; return newer;
} }
default:
break;
} }
if (new) if (new)
@ -6074,6 +6090,8 @@ force_to_mode (x, mode, mask, reg, just_select)
force_to_mode (XEXP (x, 2), mode, force_to_mode (XEXP (x, 2), mode,
mask, reg,next_select))); mask, reg,next_select)));
break; break;
default:
break;
} }
/* Ensure we return a value of the proper mode. */ /* Ensure we return a value of the proper mode. */
@ -6288,6 +6306,8 @@ known_cond (x, cond, reg, val)
case LT: case LE: case LT: case LE:
return gen_unary (NEG, GET_MODE (XEXP (x, 0)), GET_MODE (XEXP (x, 0)), return gen_unary (NEG, GET_MODE (XEXP (x, 0)), GET_MODE (XEXP (x, 0)),
XEXP (x, 0)); XEXP (x, 0));
default:
break;
} }
/* The only other cases we handle are MIN, MAX, and comparisons if the /* The only other cases we handle are MIN, MAX, and comparisons if the
@ -6324,6 +6344,8 @@ known_cond (x, cond, reg, val)
return unsignedp ? XEXP (x, 1) : x; return unsignedp ? XEXP (x, 1) : x;
case LEU: case LTU: case LEU: case LTU:
return unsignedp ? XEXP (x, 0) : x; return unsignedp ? XEXP (x, 0) : x;
default:
break;
} }
} }
} }
@ -6935,6 +6957,8 @@ nonzero_bits (x, mode)
result_width = MIN (width0, width1); result_width = MIN (width0, width1);
result_low = MIN (low0, low1); result_low = MIN (low0, low1);
break; break;
default:
break;
} }
if (result_width < mode_width) if (result_width < mode_width)
@ -7037,6 +7061,8 @@ nonzero_bits (x, mode)
nonzero &= (nonzero_bits (XEXP (x, 1), mode) nonzero &= (nonzero_bits (XEXP (x, 1), mode)
| nonzero_bits (XEXP (x, 2), mode)); | nonzero_bits (XEXP (x, 2), mode));
break; break;
default:
break;
} }
return nonzero; return nonzero;
@ -7306,6 +7332,8 @@ num_sign_bit_copies (x, mode)
case GEU: case GTU: case LEU: case LTU: case GEU: case GTU: case LEU: case LTU:
return bitwidth; return bitwidth;
#endif #endif
default:
break;
} }
/* If we haven't been able to figure it out by one of the above rules, /* If we haven't been able to figure it out by one of the above rules,
@ -7416,6 +7444,8 @@ merge_outer_ops (pop0, pconst0, op1, const1, mode, pcomp_p)
case NEG: case NEG:
op0 = NIL; op0 = NIL;
break; break;
default:
break;
} }
} }
@ -7457,6 +7487,8 @@ merge_outer_ops (pop0, pconst0, op1, const1, mode, pcomp_p)
/* (a ^ b) & b) == (~a) & b */ /* (a ^ b) & b) == (~a) & b */
*pcomp_p = 1; *pcomp_p = 1;
break; break;
default:
break;
} }
/* Check for NO-OP cases. */ /* Check for NO-OP cases. */
@ -8073,6 +8105,8 @@ simplify_shift_const (x, code, result_mode, varop, count)
continue; continue;
} }
break; break;
default:
break;
} }
break; break;
@ -8864,6 +8898,8 @@ simplify_comparison (code, pop0, pop1)
code = LT; code = LT;
} }
break; break;
default:
break;
} }
/* Compute some predicates to simplify code below. */ /* Compute some predicates to simplify code below. */
@ -9397,6 +9433,8 @@ simplify_comparison (code, pop0, pop1)
continue; continue;
} }
break; break;
default:
break;
} }
break; break;
@ -9527,6 +9565,8 @@ reversible_comparison_p (x)
x = get_last_value (XEXP (x, 0)); x = get_last_value (XEXP (x, 0));
return (x && GET_CODE (x) == COMPARE return (x && GET_CODE (x) == COMPARE
&& ! FLOAT_MODE_P (GET_MODE (XEXP (x, 0)))); && ! FLOAT_MODE_P (GET_MODE (XEXP (x, 0))));
default:
break;
} }
return 0; return 0;
@ -10107,6 +10147,8 @@ mark_used_regs_combine (x)
mark_used_regs_combine (SET_SRC (x)); mark_used_regs_combine (SET_SRC (x));
return; return;
} }
default:
break;
} }
/* Recursively scan the operands of this expression. */ /* Recursively scan the operands of this expression. */

View File

@ -386,6 +386,8 @@ convert_to_integer (type, expr)
} }
} }
default:
break;
} }
return build1 (NOP_EXPR, type, expr); return build1 (NOP_EXPR, type, expr);

View File

@ -21,6 +21,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "config.h" #include "config.h"
/* Must precede rtl.h for FFS. */ /* Must precede rtl.h for FFS. */
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include "rtl.h" #include "rtl.h"
#include "regs.h" #include "regs.h"
@ -737,6 +738,8 @@ rtx_cost (x, outer_code)
RTX_COSTS (x, code, outer_code); RTX_COSTS (x, code, outer_code);
#endif #endif
CONST_COSTS (x, code, outer_code); CONST_COSTS (x, code, outer_code);
default:
break;
} }
/* Sum the costs of the sub-rtx's, plus cost of this operation, /* Sum the costs of the sub-rtx's, plus cost of this operation,
@ -1948,6 +1951,8 @@ canon_hash (x, mode)
do_not_record = 1; do_not_record = 1;
return 0; return 0;
} }
default:
break;
} }
i = GET_RTX_LENGTH (code) - 1; i = GET_RTX_LENGTH (code) - 1;
@ -2122,6 +2127,8 @@ exp_equiv_p (x, y, validate, equal_values)
validate, equal_values) validate, equal_values)
&& exp_equiv_p (XEXP (x, 1), XEXP (y, 0), && exp_equiv_p (XEXP (x, 1), XEXP (y, 0),
validate, equal_values))); validate, equal_values)));
default:
break;
} }
/* Compare the elements. If any pair of corresponding elements /* Compare the elements. If any pair of corresponding elements
@ -2318,6 +2325,8 @@ set_nonvarying_address_components (addr, size, pbase, pstart, pend)
base = *pbase; base = *pbase;
} }
break; break;
default:
break;
} }
break; break;
@ -2496,6 +2505,8 @@ canon_reg (x, insn)
: REGNO_REG_CLASS (first) == NO_REGS ? x : REGNO_REG_CLASS (first) == NO_REGS ? x
: gen_rtx (REG, qty_mode[reg_qty[REGNO (x)]], first)); : gen_rtx (REG, qty_mode[reg_qty[REGNO (x)]], first));
} }
default:
break;
} }
fmt = GET_RTX_FORMAT (code); fmt = GET_RTX_FORMAT (code);
@ -3289,6 +3300,8 @@ simplify_unary_operation (code, mode, op, op_mode)
&& GET_CODE (XEXP (XEXP (op, 0), 1)) == LABEL_REF) && GET_CODE (XEXP (XEXP (op, 0), 1)) == LABEL_REF)
return XEXP (op, 0); return XEXP (op, 0);
break; break;
default:
break;
} }
return 0; return 0;
@ -4189,6 +4202,8 @@ simplify_plus_minus (code, mode, op0, op1)
if (negs[i]) if (negs[i])
ops[i] = GEN_INT (- INTVAL (ops[i])), negs[i] = 0, changed = 1; ops[i] = GEN_INT (- INTVAL (ops[i])), negs[i] = 0, changed = 1;
break; break;
default:
break;
} }
} }
@ -4518,6 +4533,8 @@ simplify_relational_operation (code, mode, op0, op1)
&& INTEGRAL_MODE_P (mode)) && INTEGRAL_MODE_P (mode))
return const0_rtx; return const0_rtx;
break; break;
default:
break;
} }
return 0; return 0;
@ -4547,6 +4564,8 @@ simplify_relational_operation (code, mode, op0, op1)
return equal || op0ltu ? const_true_rtx : const0_rtx; return equal || op0ltu ? const_true_rtx : const0_rtx;
case GEU: case GEU:
return equal || op1ltu ? const_true_rtx : const0_rtx; return equal || op1ltu ? const_true_rtx : const0_rtx;
default:
break;
} }
abort (); abort ();
@ -5012,6 +5031,8 @@ fold_rtx (x, insn)
return x; return x;
} }
default:
break;
} }
const_arg0 = 0; const_arg0 = 0;
@ -5345,6 +5366,8 @@ fold_rtx (x, insn)
if (has_sign) if (has_sign)
return false; return false;
break; break;
default:
break;
} }
} }
} }
@ -5534,6 +5557,8 @@ fold_rtx (x, insn)
return cse_gen_binary (code, mode, y, new_const); return cse_gen_binary (code, mode, y, new_const);
} }
default:
break;
} }
new = simplify_binary_operation (code, mode, new = simplify_binary_operation (code, mode,
@ -7568,6 +7593,8 @@ cse_process_notes (x, object)
/* Otherwise, canonicalize this register. */ /* Otherwise, canonicalize this register. */
return canon_reg (x, NULL_RTX); return canon_reg (x, NULL_RTX);
default:
break;
} }
for (i = 0; i < GET_RTX_LENGTH (code); i++) for (i = 0; i < GET_RTX_LENGTH (code); i++)
@ -8510,6 +8537,8 @@ count_reg_usage (x, counts, dest, incr)
count_reg_usage (XEXP (x, 0), counts, NULL_RTX, incr); count_reg_usage (XEXP (x, 0), counts, NULL_RTX, incr);
count_reg_usage (XEXP (x, 1), counts, NULL_RTX, incr); count_reg_usage (XEXP (x, 1), counts, NULL_RTX, incr);
return; return;
default:
break;
} }
fmt = GET_RTX_FORMAT (code); fmt = GET_RTX_FORMAT (code);

View File

@ -68,6 +68,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Include these first, because they may define MIN and MAX. */ /* Include these first, because they may define MIN and MAX. */
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <errno.h> #include <errno.h>
#include "config.h" #include "config.h"
@ -1768,6 +1769,8 @@ dbxout_symbol (decl, local)
#endif #endif
dbxout_symbol_location (decl, type, 0, DECL_RTL (decl)); dbxout_symbol_location (decl, type, 0, DECL_RTL (decl));
default:
break;
} }
} }

View File

@ -1514,6 +1514,8 @@ copy_rtx_if_shared (orig)
x->used = 1; x->used = 1;
return x; return x;
} }
default:
break;
} }
/* This rtx may not be shared. If it has already been seen, /* This rtx may not be shared. If it has already been seen,
@ -1603,6 +1605,8 @@ reset_used_flags (x)
case BARRIER: case BARRIER:
/* The chain of insns is not being copied. */ /* The chain of insns is not being copied. */
return; return;
default:
break;
} }
x->used = 0; x->used = 0;
@ -3089,6 +3093,8 @@ restore_reg_data (first)
case INSN: case INSN:
restore_reg_data_1 (PATTERN (insn)); restore_reg_data_1 (PATTERN (insn));
break; break;
default:
break;
} }
} }
@ -3166,6 +3172,8 @@ restore_reg_data_1 (orig)
mark_reg_pointer (XEXP (x, 0)); mark_reg_pointer (XEXP (x, 0));
restore_reg_data_1 (XEXP (x, 0)); restore_reg_data_1 (XEXP (x, 0));
return; return;
default:
break;
} }
/* Now scan the subexpressions recursively. */ /* Now scan the subexpressions recursively. */

View File

@ -116,6 +116,8 @@ plus_constant_wide (x, c)
return gen_rtx (PLUS, mode, return gen_rtx (PLUS, mode,
XEXP (x, 0), XEXP (x, 0),
plus_constant (XEXP (x, 1), c)); plus_constant (XEXP (x, 1), c));
default:
break;
} }
if (c != 0) if (c != 0)
@ -669,6 +671,8 @@ promote_mode (type, mode, punsignedp, for_call)
case POINTER_TYPE: case POINTER_TYPE:
break; break;
default:
break;
} }
*punsignedp = unsignedp; *punsignedp = unsignedp;
@ -807,6 +811,8 @@ emit_stack_save (save_level, psave, after)
} }
break; break;
#endif #endif
default:
break;
} }
/* If there is no save area and we have to allocate one, do so. Otherwise /* If there is no save area and we have to allocate one, do so. Otherwise
@ -887,6 +893,8 @@ emit_stack_restore (save_level, sa, after)
fcn = gen_restore_stack_nonlocal; fcn = gen_restore_stack_nonlocal;
break; break;
#endif #endif
default:
break;
} }
if (sa != 0) if (sa != 0)

View File

@ -3471,6 +3471,8 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
emit_label (label); emit_label (label);
} }
return gen_lowpart (mode, rem_flag ? remainder : quotient); return gen_lowpart (mode, rem_flag ? remainder : quotient);
default:
break;
} }
if (quotient == 0) if (quotient == 0)
@ -3774,6 +3776,8 @@ emit_store_flag (target, code, op0, op1, mode, unsignedp, normalizep)
if (op1 == const1_rtx) if (op1 == const1_rtx)
op1 = const0_rtx, code = EQ; op1 = const0_rtx, code = EQ;
break; break;
default:
break;
} }
/* From now on, we won't change CODE, so set ICODE now. */ /* From now on, we won't change CODE, so set ICODE now. */

View File

@ -40,6 +40,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "bc-optab.h" #include "bc-optab.h"
#include "bc-emit.h" #include "bc-emit.h"
#include <string.h>
#define CEIL(x,y) (((x) + (y) - 1) / (y)) #define CEIL(x,y) (((x) + (y) - 1) / (y))
@ -509,6 +510,8 @@ queued_subexp_p (x)
case MINUS: case MINUS:
return queued_subexp_p (XEXP (x, 0)) return queued_subexp_p (XEXP (x, 0))
|| queued_subexp_p (XEXP (x, 1)); || queued_subexp_p (XEXP (x, 1));
default:
break;
} }
return 0; return 0;
} }
@ -519,7 +522,7 @@ void
emit_queue () emit_queue ()
{ {
register rtx p; register rtx p;
while (p = pending_chain) while ( (p = pending_chain) )
{ {
QUEUED_INSN (p) = emit_insn (QUEUED_BODY (p)); QUEUED_INSN (p) = emit_insn (QUEUED_BODY (p));
pending_chain = QUEUED_NEXT (p); pending_chain = QUEUED_NEXT (p);
@ -816,6 +819,9 @@ convert_move (to, from, unsignedp)
case TFmode: case TFmode:
libcall = extendsftf2_libfunc; libcall = extendsftf2_libfunc;
break; break;
default:
break;
} }
break; break;
@ -833,6 +839,8 @@ convert_move (to, from, unsignedp)
case TFmode: case TFmode:
libcall = extenddftf2_libfunc; libcall = extenddftf2_libfunc;
break; break;
default:
break;
} }
break; break;
@ -846,6 +854,8 @@ convert_move (to, from, unsignedp)
case DFmode: case DFmode:
libcall = truncxfdf2_libfunc; libcall = truncxfdf2_libfunc;
break; break;
default:
break;
} }
break; break;
@ -859,8 +869,12 @@ convert_move (to, from, unsignedp)
case DFmode: case DFmode:
libcall = trunctfdf2_libfunc; libcall = trunctfdf2_libfunc;
break; break;
default:
break;
} }
break; break;
default:
break;
} }
if (libcall == (rtx) 0) if (libcall == (rtx) 0)
@ -3708,6 +3722,8 @@ safe_from_p (x, exp)
case METHOD_CALL_EXPR: case METHOD_CALL_EXPR:
/* This takes a rtx argument, but shouldn't appear here. */ /* This takes a rtx argument, but shouldn't appear here. */
abort (); abort ();
default:
break;
} }
/* If we have an rtx, we do not need to scan our operands. */ /* If we have an rtx, we do not need to scan our operands. */
@ -4693,15 +4709,15 @@ expand_expr (exp, target, tmode, modifier)
/* If domain is empty, answer is no. Likewise if index is constant /* If domain is empty, answer is no. Likewise if index is constant
and out of bounds. */ and out of bounds. */
if ((TREE_CODE (set_high_bound) == INTEGER_CST if (((TREE_CODE (set_high_bound) == INTEGER_CST
&& TREE_CODE (set_low_bound) == INTEGER_CST && TREE_CODE (set_low_bound) == INTEGER_CST
&& tree_int_cst_lt (set_high_bound, set_low_bound) && tree_int_cst_lt (set_high_bound, set_low_bound))
|| (TREE_CODE (index) == INTEGER_CST || (TREE_CODE (index) == INTEGER_CST
&& TREE_CODE (set_low_bound) == INTEGER_CST && TREE_CODE (set_low_bound) == INTEGER_CST
&& tree_int_cst_lt (index, set_low_bound)) && tree_int_cst_lt (index, set_low_bound))
|| (TREE_CODE (set_high_bound) == INTEGER_CST || (TREE_CODE (set_high_bound) == INTEGER_CST
&& TREE_CODE (index) == INTEGER_CST && TREE_CODE (index) == INTEGER_CST
&& tree_int_cst_lt (set_high_bound, index)))) && tree_int_cst_lt (set_high_bound, index))))
return const0_rtx; return const0_rtx;
if (target == 0) if (target == 0)
@ -6618,6 +6634,8 @@ bc_expand_expr (exp)
return; return;
} }
default:
break;
} }
abort (); abort ();
@ -8362,6 +8380,8 @@ preexpand_calls (exp)
case SAVE_EXPR: case SAVE_EXPR:
if (SAVE_EXPR_RTL (exp) != 0) if (SAVE_EXPR_RTL (exp) != 0)
return; return;
default:
break;
} }
nops = tree_code_length[(int) TREE_CODE (exp)]; nops = tree_code_length[(int) TREE_CODE (exp)];
@ -9899,7 +9919,7 @@ bc_expand_component_address (exp)
if (DECL_BIT_FIELD (TREE_OPERAND (exp, 1))) if (DECL_BIT_FIELD (TREE_OPERAND (exp, 1)))
bc_push_offset_and_size (bitpos, /* DECL_SIZE_UNIT */ (TREE_OPERAND (exp, 1))); bc_push_offset_and_size (bitpos, /* DECL_SIZE_UNIT */ (TREE_OPERAND (exp, 1)));
else else
if (SIval = bitpos / BITS_PER_UNIT) if ( (SIval = bitpos / BITS_PER_UNIT) )
bc_emit_instruction (addconstPSI, SIval); bc_emit_instruction (addconstPSI, SIval);
return (TREE_OPERAND (exp, 1)); return (TREE_OPERAND (exp, 1));

View File

@ -50,6 +50,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <varargs.h> #include <varargs.h>
#endif #endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <ctype.h> #include <ctype.h>
#include "tree.h" #include "tree.h"
@ -1867,6 +1868,8 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
else if (result == 2) else if (result == 2)
INSN_CODE (insn) = -1; INSN_CODE (insn) = -1;
} }
default:
break;
} }
} }
#endif #endif
@ -2120,6 +2123,8 @@ walk_alter_subreg (x)
case SUBREG: case SUBREG:
return alter_subreg (x); return alter_subreg (x);
default:
break;
} }
return x; return x;
@ -2178,6 +2183,8 @@ alter_cond (cond)
PUT_CODE (cond, NE); PUT_CODE (cond, NE);
value = 2; value = 2;
break; break;
default:
break;
} }
if (cc_status.flags & CC_NOT_NEGATIVE) if (cc_status.flags & CC_NOT_NEGATIVE)
@ -2204,6 +2211,8 @@ alter_cond (cond)
PUT_CODE (cond, NE); PUT_CODE (cond, NE);
value = 2; value = 2;
break; break;
default:
break;
} }
if (cc_status.flags & CC_NO_OVERFLOW) if (cc_status.flags & CC_NO_OVERFLOW)
@ -2226,6 +2235,8 @@ alter_cond (cond)
case LTU: case LTU:
/* Jump becomes no-op. */ /* Jump becomes no-op. */
return -1; return -1;
default:
break;
} }
if (cc_status.flags & (CC_Z_IN_NOT_N | CC_Z_IN_N)) if (cc_status.flags & (CC_Z_IN_NOT_N | CC_Z_IN_N))
@ -2250,6 +2261,8 @@ alter_cond (cond)
PUT_CODE (cond, cc_status.flags & CC_Z_IN_N ? LT : GE); PUT_CODE (cond, cc_status.flags & CC_Z_IN_N ? LT : GE);
value = 2; value = 2;
break; break;
default:
break;
} }
if (cc_status.flags & CC_NOT_SIGNED) if (cc_status.flags & CC_NOT_SIGNED)
@ -2276,6 +2289,8 @@ alter_cond (cond)
PUT_CODE (cond, GEU); PUT_CODE (cond, GEU);
value = 2; value = 2;
break; break;
default:
break;
} }
return value; return value;

View File

@ -108,6 +108,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
reg_n_calls_crosses and reg_basic_block. */ reg_n_calls_crosses and reg_basic_block. */
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include "config.h" #include "config.h"
#include "rtl.h" #include "rtl.h"
#include "basic-block.h" #include "basic-block.h"
@ -2543,6 +2544,8 @@ mark_used_regs (needed, live, x, final, insn)
live[i / REGSET_ELT_BITS] live[i / REGSET_ELT_BITS]
|= (REGSET_ELT_TYPE) 1 << (i % REGSET_ELT_BITS); |= (REGSET_ELT_TYPE) 1 << (i % REGSET_ELT_BITS);
break; break;
default:
break;
} }
/* Recursively scan the operands of this expression. */ /* Recursively scan the operands of this expression. */

View File

@ -1740,6 +1740,8 @@ operand_equal_p (arg0, arg1, only_const)
TREE_OPERAND (arg1, 1), 0) TREE_OPERAND (arg1, 1), 0)
&& operand_equal_p (TREE_OPERAND (arg0, 2), && operand_equal_p (TREE_OPERAND (arg0, 2),
TREE_OPERAND (arg1, 2), 0)); TREE_OPERAND (arg1, 2), 0));
default:
break;
} }
break; break;
} }
@ -1951,6 +1953,8 @@ eval_subst (arg, old0, new0, old1, new1)
old0, new0, old1, new1), old0, new0, old1, new1),
eval_subst (TREE_OPERAND (arg, 2), eval_subst (TREE_OPERAND (arg, 2),
old0, new0, old1, new1))); old0, new0, old1, new1)));
default:
break;
} }
case '<': case '<':
@ -2094,6 +2098,8 @@ invert_truthvalue (arg)
case SAVE_EXPR: case SAVE_EXPR:
return build1 (TRUTH_NOT_EXPR, type, arg); return build1 (TRUTH_NOT_EXPR, type, arg);
default:
break;
} }
if (TREE_CODE (TREE_TYPE (arg)) != BOOLEAN_TYPE) if (TREE_CODE (TREE_TYPE (arg)) != BOOLEAN_TYPE)
abort (); abort ();
@ -4285,6 +4291,8 @@ fold (expr)
TREE_SET_CODE (t, code); TREE_SET_CODE (t, code);
arg1 = const_binop (MINUS_EXPR, arg1, integer_one_node, 0); arg1 = const_binop (MINUS_EXPR, arg1, integer_one_node, 0);
TREE_OPERAND (t, 1) = arg1; TREE_OPERAND (t, 1) = arg1;
default:
break;
} }
} }
@ -4411,6 +4419,8 @@ fold (expr)
t = build_int_2 (0, 0); t = build_int_2 (0, 0);
TREE_TYPE (t) = type; TREE_TYPE (t) = type;
return t; return t;
default:
break;
} }
} }
@ -4438,6 +4448,8 @@ fold (expr)
return omit_one_operand (type, return omit_one_operand (type,
convert (type, integer_zero_node), convert (type, integer_zero_node),
arg0); arg0);
default:
break;
} }
} }
@ -4732,6 +4744,8 @@ fold (expr)
return pedantic_non_lvalue return pedantic_non_lvalue
(fold (build1 (NEGATE_EXPR, type, (fold (build1 (NEGATE_EXPR, type,
fold (build1 (ABS_EXPR, type, arg1))))); fold (build1 (ABS_EXPR, type, arg1)))));
default:
break;
} }
/* If this is A != 0 ? A : 0, this is simply A. For ==, it is /* If this is A != 0 ? A : 0, this is simply A. For ==, it is
@ -4764,6 +4778,8 @@ fold (expr)
case GT_EXPR: case GT_EXPR:
return pedantic_non_lvalue return pedantic_non_lvalue
(fold (build (MAX_EXPR, type, arg1, arg2))); (fold (build (MAX_EXPR, type, arg1, arg2)));
default:
break;
} }
/* If this is A op C1 ? A : C2 with C1 and C2 constant integers, /* If this is A op C1 ? A : C2 with C1 and C2 constant integers,
@ -4822,6 +4838,8 @@ fold (expr)
return pedantic_non_lvalue return pedantic_non_lvalue
(fold (build (MAX_EXPR, type, arg1, arg2))); (fold (build (MAX_EXPR, type, arg1, arg2)));
break; break;
default:
break;
} }
} }

View File

@ -32,7 +32,7 @@ static char sccsid[] = "@(#)ld.c 6.10 (Berkeley) 5/22/91";
Set, indirect, and warning symbol features added by Randy Smith. */ Set, indirect, and warning symbol features added by Randy Smith. */
/* /*
* $Id: ld.c,v 1.33 1996/05/28 16:17:48 phk Exp $ * $Id: ld.c,v 1.34 1996/06/08 04:52:57 wpaul Exp $
*/ */
/* Define how to initialize system-dependent header fields. */ /* Define how to initialize system-dependent header fields. */
@ -875,10 +875,10 @@ check_each_file(function, arg)
for (; subentry; subentry = subentry->chain) { for (; subentry; subentry = subentry->chain) {
if (subentry->flags & E_SCRAPPED) if (subentry->flags & E_SCRAPPED)
continue; continue;
if (return_val = (*function)(subentry, arg)) if ( (return_val = (*function)(subentry, arg)) )
return return_val; return return_val;
} }
} else if (return_val = (*function)(entry, arg)) } else if ( (return_val = (*function)(entry, arg)) )
return return_val; return return_val;
} }
return 0; return 0;
@ -2391,7 +2391,7 @@ digest_pass2()
/* Flag second-hand definitions */ /* Flag second-hand definitions */
undefined_global_sym_count++; undefined_global_sym_count++;
if (sp->flags & GS_TRACE) if (sp->flags & GS_TRACE)
printf("symbol %s assigned to location %#x\n", printf("symbol %s assigned to location %#lx\n",
sp->name, sp->value); sp->name, sp->value);
} }
@ -2456,7 +2456,7 @@ digest_pass2()
} }
bss_size += size; bss_size += size;
if (write_map) if (write_map)
printf("Allocating %s %s: %x at %x\n", printf("Allocating %s %s: %x at %lx\n",
sp->defined==(N_BSS|N_EXT)?"common":"data", sp->defined==(N_BSS|N_EXT)?"common":"data",
sp->name, size, sp->value); sp->name, size, sp->value);
@ -3607,7 +3607,8 @@ write_file_syms(entry, syms_written_addr)
continue; continue;
if (discard_locals == DISCARD_ALL || if (discard_locals == DISCARD_ALL ||
discard_locals == DISCARD_L && lsp->flags & LS_L_SYMBOL) { (discard_locals == DISCARD_L &&
(lsp->flags & LS_L_SYMBOL))) {
/* /*
* The user wants to discard this symbol, but it * The user wants to discard this symbol, but it
* is referenced by a relocation. We can still * is referenced by a relocation. We can still

View File

@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* $Id: ldconfig.c,v 1.13 1996/01/09 00:04:35 pk Exp $ * $Id: ldconfig.c,v 1.12 1996/02/26 02:22:33 pst Exp $
*/ */
#include <sys/param.h> #include <sys/param.h>
@ -39,6 +39,8 @@
#include <sys/resource.h> #include <sys/resource.h>
#include <dirent.h> #include <dirent.h>
#include <errno.h> #include <errno.h>
#include <err.h>
#include <ctype.h>
#include <fcntl.h> #include <fcntl.h>
#include <ar.h> #include <ar.h>
#include <ranlib.h> #include <ranlib.h>
@ -114,7 +116,7 @@ char *argv[];
return rval; return rval;
if (justread) { if (justread) {
listhints(); listhints();
return; return 0;
} }
} }
@ -288,7 +290,7 @@ buildhints()
hdr.hh_ehints = hdr.hh_strtab + hdr.hh_strtab_sz; hdr.hh_ehints = hdr.hh_strtab + hdr.hh_strtab_sz;
if (verbose) if (verbose)
printf("Totals: entries %d, buckets %d, string size %d\n", printf("Totals: entries %d, buckets %ld, string size %d\n",
nhints, hdr.hh_nbucket, strtab_sz); nhints, hdr.hh_nbucket, strtab_sz);
/* Allocate buckets and string table */ /* Allocate buckets and string table */

View File

@ -1,5 +1,5 @@
/* /*
* $Id: lib.c,v 1.15 1995/05/30 05:01:46 rgrimes Exp $ - library routines * $Id: lib.c,v 1.16 1995/09/28 19:43:22 bde Exp $ - library routines
*/ */
#include <sys/param.h> #include <sys/param.h>
@ -841,7 +841,7 @@ struct file_entry *p;
dot_a: dot_a:
p->flags &= ~E_SEARCH_DYNAMIC; p->flags &= ~E_SEARCH_DYNAMIC;
if (cp = strrchr(p->filename, '/')) { if ( (cp = strrchr(p->filename, '/')) ) {
*cp++ = '\0'; *cp++ = '\0';
fname = concat(concat(p->filename, "/lib", cp), ".a", ""); fname = concat(concat(p->filename, "/lib", cp), ".a", "");
*(--cp) = '/'; *(--cp) = '/';

View File

@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* $Id: rrs.c,v 1.14 1995/03/04 17:46:09 nate Exp $ * $Id: rrs.c,v 1.15 1996/05/27 18:06:02 jdp Exp $
*/ */
#include <sys/param.h> #include <sys/param.h>
@ -74,7 +74,6 @@ static int rrs_symbol_size;
static int current_jmpslot_offset; static int current_jmpslot_offset;
static int current_got_offset; static int current_got_offset;
static int got_origin; static int got_origin;
static int current_reloc_offset;
static int current_hash_index; static int current_hash_index;
int number_of_shobjs; int number_of_shobjs;
@ -662,9 +661,10 @@ void
consider_rrs_section_lengths() consider_rrs_section_lengths()
{ {
int n; int n;
struct shobj *shp, **shpp; struct shobj *shp;
#ifdef notyet #ifdef notyet
struct shobj **shpp;
/* We run into trouble with this as long as shared object symbols /* We run into trouble with this as long as shared object symbols
are not checked for definitions */ are not checked for definitions */
/* /*

View File

@ -33,7 +33,7 @@
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)malloc.c 5.11 (Berkeley) 2/23/91";*/ /*static char *sccsid = "from: @(#)malloc.c 5.11 (Berkeley) 2/23/91";*/
static char *rcsid = "$Id: malloc.c,v 1.3 1995/03/04 17:46:24 nate Exp $"; static char *rcsid = "$Id: malloc.c,v 1.4 1995/05/30 05:01:48 rgrimes Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
/* /*
@ -66,6 +66,7 @@ static char *rcsid = "$Id: malloc.c,v 1.3 1995/03/04 17:46:24 nate Exp $";
#define NULL 0 #define NULL 0
extern void xprintf __P((char *, ...));
static void morecore(); static void morecore();
static int findbucket(); static int findbucket();
@ -390,7 +391,7 @@ realloc(cp, nbytes)
* header starts at ``freep''. If srchlen is -1 search the whole list. * header starts at ``freep''. If srchlen is -1 search the whole list.
* Return bucket number, or -1 if not found. * Return bucket number, or -1 if not found.
*/ */
static static int
findbucket(freep, srchlen) findbucket(freep, srchlen)
union overhead *freep; union overhead *freep;
int srchlen; int srchlen;

View File

@ -1,5 +1,5 @@
/* /*
* $Id: warnings.c,v 1.9 1994/12/23 22:30:57 nate Exp $ * $Id: warnings.c,v 1.10 1995/03/04 17:46:10 nate Exp $
*/ */
#include <sys/param.h> #include <sys/param.h>
@ -113,7 +113,7 @@ print_symbols(outfile)
else if (sp->defined == (N_UNDF|N_EXT)) else if (sp->defined == (N_UNDF|N_EXT))
fprintf(outfile, "common: size %#x", sp->common_size); fprintf(outfile, "common: size %#x", sp->common_size);
else else
fprintf(outfile, "type %d, value %#x, size %#x", fprintf(outfile, "type %d, value %#lx, size %#x",
sp->defined, sp->value, sp->size); sp->defined, sp->value, sp->size);
if (sp->alias) if (sp->alias)
fprintf(outfile, ", aliased to %s", sp->alias->name); fprintf(outfile, ", aliased to %s", sp->alias->name);
@ -133,7 +133,7 @@ describe_file_sections(entry, outfile)
if (entry->flags & (E_JUST_SYMS | E_DYNAMIC)) if (entry->flags & (E_JUST_SYMS | E_DYNAMIC))
fprintf(outfile, " symbols only\n"); fprintf(outfile, " symbols only\n");
else else
fprintf(outfile, " text %x(%x), data %x(%x), bss %x(%x) hex\n", fprintf(outfile, " text %x(%lx), data %x(%lx), bss %x(%lx) hex\n",
entry->text_start_address, entry->header.a_text, entry->text_start_address, entry->header.a_text,
entry->data_start_address, entry->header.a_data, entry->data_start_address, entry->header.a_data,
entry->bss_start_address, entry->header.a_bss); entry->bss_start_address, entry->header.a_bss);
@ -161,7 +161,7 @@ list_file_locals (entry, outfile)
* update it if necessary by this file's start address. * update it if necessary by this file's start address.
*/ */
if (!(p->n_type & (N_STAB | N_EXT))) if (!(p->n_type & (N_STAB | N_EXT)))
fprintf(outfile, " %s: 0x%x\n", fprintf(outfile, " %s: 0x%lx\n",
entry->strings + p->n_un.n_strx, p->n_value); entry->strings + p->n_un.n_strx, p->n_value);
} }

View File

@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* $Id: ldconfig.c,v 1.13 1996/01/09 00:04:35 pk Exp $ * $Id: ldconfig.c,v 1.12 1996/02/26 02:22:33 pst Exp $
*/ */
#include <sys/param.h> #include <sys/param.h>
@ -39,6 +39,8 @@
#include <sys/resource.h> #include <sys/resource.h>
#include <dirent.h> #include <dirent.h>
#include <errno.h> #include <errno.h>
#include <err.h>
#include <ctype.h>
#include <fcntl.h> #include <fcntl.h>
#include <ar.h> #include <ar.h>
#include <ranlib.h> #include <ranlib.h>
@ -114,7 +116,7 @@ char *argv[];
return rval; return rval;
if (justread) { if (justread) {
listhints(); listhints();
return; return 0;
} }
} }
@ -288,7 +290,7 @@ buildhints()
hdr.hh_ehints = hdr.hh_strtab + hdr.hh_strtab_sz; hdr.hh_ehints = hdr.hh_strtab + hdr.hh_strtab_sz;
if (verbose) if (verbose)
printf("Totals: entries %d, buckets %d, string size %d\n", printf("Totals: entries %d, buckets %ld, string size %d\n",
nhints, hdr.hh_nbucket, strtab_sz); nhints, hdr.hh_nbucket, strtab_sz);
/* Allocate buckets and string table */ /* Allocate buckets and string table */

View File

@ -71,7 +71,7 @@ append(argv)
/* Read from disk, write to an archive; pad on write. */ /* Read from disk, write to an archive; pad on write. */
SETCF(0, 0, afd, archive, WPAD); SETCF(0, 0, afd, archive, WPAD);
for (eval = 0; file = *argv++;) { for (eval = 0; (file = *argv++); ) {
if ((fd = open(file, O_RDONLY)) < 0) { if ((fd = open(file, O_RDONLY)) < 0) {
warn("%s", file); warn("%s", file);
eval = 1; eval = 1;

View File

@ -320,7 +320,7 @@ skip_arobj(fd)
{ {
off_t len; off_t len;
len = chdr.size + (chdr.size + chdr.lname & 1); len = chdr.size + ( (chdr.size + chdr.lname) & 1);
if (lseek(fd, len, SEEK_CUR) == (off_t)-1) if (lseek(fd, len, SEEK_CUR) == (off_t)-1)
error(archive); error(archive);
} }

View File

@ -97,7 +97,7 @@ files(argv)
for (list = argv; *list; ++list) for (list = argv; *list; ++list)
if (compare(*list)) { if (compare(*list)) {
p = *list; p = *list;
for (; list[0] = list[1]; ++list) for (; (list[0] = list[1]); ++list)
continue; continue;
return (p); return (p);
} }

View File

@ -141,7 +141,7 @@ useold: SETCF(afd, archive, curfd, tname, RPAD|WPAD);
} }
/* Append any left-over arguments to the end of the after file. */ /* Append any left-over arguments to the end of the after file. */
append: while (file = *argv++) { append: while ( (file = *argv++) ) {
if (options & AR_V) if (options & AR_V)
(void)printf("a - %s\n", file); (void)printf("a - %s\n", file);
if ((sfd = open(file, O_RDONLY)) < 0) { if ((sfd = open(file, O_RDONLY)) < 0) {

View File

@ -8,6 +8,8 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/file.h> #include <sys/file.h>
#include <string.h> #include <string.h>
#include <sys/param.h> #include <sys/param.h>
@ -23,7 +25,7 @@ static const char copyright[] =
"Copyright 1987,1988 by MIT Student Information Processing Board"; "Copyright 1987,1988 by MIT Student Information Processing Board";
static const char rcsid_compile_et_c[] = static const char rcsid_compile_et_c[] =
"$Header: /afs/rel-eng.athena.mit.edu/project/release/current/source/athena/athena.lib/et/RCS/compile_et.c,v 1.3 91/02/28 15:15:23 epeisach Exp $"; "$Header: /home/ncvs/src/usr.bin/compile_et/compile_et.c,v 1.2 1995/01/14 22:29:31 wollman Exp $";
#endif #endif
extern char *gensym(); extern char *gensym();
@ -33,10 +35,6 @@ char buffer[BUFSIZ];
char *table_name = (char *)NULL; char *table_name = (char *)NULL;
FILE *hfile, *cfile; FILE *hfile, *cfile;
/* C library */
extern char *malloc();
extern int errno;
/* lex stuff */ /* lex stuff */
extern FILE *yyin; extern FILE *yyin;
extern int yylineno; extern int yylineno;
@ -253,7 +251,7 @@ int main (argc, argv) int argc; char **argv; {
for (cpp = struct_def; *cpp; cpp++) for (cpp = struct_def; *cpp; cpp++)
fputs (*cpp, cfile); fputs (*cpp, cfile);
fprintf(cfile, fprintf(cfile,
"static const struct error_table et = { text, %ldL, %d };\n\n", "static const struct error_table et = { text, %dL, %d };\n\n",
table_number, current); table_number, current);
fputs("static struct et_list link = { 0, 0 };\n\n", fputs("static struct et_list link = { 0, 0 };\n\n",
cfile); cfile);
@ -269,7 +267,7 @@ int main (argc, argv) int argc; char **argv; {
fprintf (hfile, "extern void initialize_%s_error_table ();\n", fprintf (hfile, "extern void initialize_%s_error_table ();\n",
table_name); table_name);
fprintf (hfile, "#define ERROR_TABLE_BASE_%s (%ldL)\n", fprintf (hfile, "#define ERROR_TABLE_BASE_%s (%dL)\n",
table_name, table_number); table_name, table_number);
/* compatibility... */ /* compatibility... */
fprintf (hfile, "\n/* for compatibility with older versions... */\n"); fprintf (hfile, "\n/* for compatibility with older versions... */\n");
@ -286,5 +284,6 @@ int yyerror(s) char *s; {
fputs(s, stderr); fputs(s, stderr);
fprintf(stderr, "\nLine number %d; last token was '%s'\n", fprintf(stderr, "\nLine number %d; last token was '%s'\n",
yylineno, current_token); yylineno, current_token);
return 0;
} }

View File

@ -1,7 +1,7 @@
%{ %{
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
char *str_concat(), *ds(), *quote(); char *str_concat(), *ds(), *quote();
void *malloc(), *realloc();
char *current_token = (char *)NULL; char *current_token = (char *)NULL;
extern char *table_name; extern char *table_name;
%} %}
@ -74,7 +74,7 @@ description : QUOTED_STRING
#ifndef lint #ifndef lint
static char const rcsid_error_table_y[] = static char const rcsid_error_table_y[] =
"$Header: /home/ncvs/src/usr.bin/compile_et/error_table.y,v 1.2 1995/01/14 22:29:33 wollman Exp $"; "$Header: /home/ncvs/src/usr.bin/compile_et/error_table.y,v 1.3 1995/03/15 19:05:28 wpaul Exp $";
#endif #endif
void *malloc(), *realloc(); void *malloc(), *realloc();
@ -124,6 +124,7 @@ long table_number;
int current = 0; int current = 0;
char **error_codes = (char **)NULL; char **error_codes = (char **)NULL;
void
add_ec(name, description) add_ec(name, description)
char const *name, *description; char const *name, *description;
{ {
@ -138,6 +139,7 @@ add_ec(name, description)
error_codes[current] = (char *)NULL; error_codes[current] = (char *)NULL;
} }
void
add_ec_val(name, val, description) add_ec_val(name, val, description)
char const *name, *val, *description; char const *name, *val, *description;
{ {
@ -162,6 +164,7 @@ add_ec_val(name, val, description)
error_codes[current] = (char *)NULL; error_codes[current] = (char *)NULL;
} }
void
put_ecs() put_ecs()
{ {
int i; int i;
@ -206,6 +209,7 @@ int char_to_num(c)
exit (1); exit (1);
} }
void
set_table_num(string) set_table_num(string)
char *string; char *string;
{ {

View File

@ -11,7 +11,7 @@ end return END;
[\t\n ] ; [\t\n ] ;
\"{PC}*\" { register char *p; yylval.dynstr = ds(yytext+1); \"{PC}*\" { register char *p; yylval.dynstr = ds(yytext+1);
if (p=rindex(yylval.dynstr, '"')) *p='\0'; if ( (p=rindex(yylval.dynstr, '"')) ) *p='\0';
return QUOTED_STRING; return QUOTED_STRING;
} }
@ -22,5 +22,5 @@ end return END;
. { return (*yytext); } . { return (*yytext); }
%% %%
#ifndef lint #ifndef lint
static char rcsid_et_lex_lex_l[] = "$Header: et_lex.lex.l,v 1.3 87/10/31 06:28:05 raeburn Exp $"; static char rcsid_et_lex_lex_l[] = "$Header: /home/ncvs/src/usr.bin/compile_et/et_lex.lex.l,v 1.2 1995/01/14 22:29:33 wollman Exp $";
#endif #endif

View File

@ -80,7 +80,8 @@ void userdump __P((int, struct proc *, u_long, int));
kvm_t *kd; kvm_t *kd;
/* XXX undocumented routine, should be in kvm.h? */ /* XXX undocumented routine, should be in kvm.h? */
ssize_t kvm_uread __P((kvm_t *, struct proc *, u_long, char *, size_t)); ssize_t kvm_uread __P((kvm_t *, const struct proc *, u_long, char *, size_t));
static int data_offset; static int data_offset;

View File

@ -80,7 +80,8 @@ void userdump __P((int, struct proc *, u_long, int));
kvm_t *kd; kvm_t *kd;
/* XXX undocumented routine, should be in kvm.h? */ /* XXX undocumented routine, should be in kvm.h? */
ssize_t kvm_uread __P((kvm_t *, struct proc *, u_long, char *, size_t)); ssize_t kvm_uread __P((kvm_t *, const struct proc *, u_long, char *, size_t));
static int data_offset; static int data_offset;

View File

@ -486,7 +486,7 @@ ArchStatMember (archive, member, hash)
strncpy(copy, member, AR_MAX_NAME_LEN); strncpy(copy, member, AR_MAX_NAME_LEN);
copy[AR_MAX_NAME_LEN] = '\0'; copy[AR_MAX_NAME_LEN] = '\0';
} }
if (he = Hash_FindEntry (&ar->members, copy)) if ( (he = Hash_FindEntry (&ar->members, copy)) )
return ((struct ar_hdr *) Hash_GetValue (he)); return ((struct ar_hdr *) Hash_GetValue (he));
return ((struct ar_hdr *) NULL); return ((struct ar_hdr *) NULL);
} }

View File

@ -11,41 +11,41 @@
extern char *last_token, *ds(); extern char *last_token, *ds();
static l_command_table() static int l_command_table()
{ {
last_token = "command_table"; last_token = "command_table";
return COMMAND_TABLE; return COMMAND_TABLE;
} }
static l_request() static int l_request()
{ {
last_token = "request"; last_token = "request";
return REQUEST; return REQUEST;
} }
static l_unimplemented() static int l_unimplemented()
{ {
last_token = "unimplemented"; last_token = "unimplemented";
return UNIMPLEMENTED; return UNIMPLEMENTED;
} }
static l_end() static int l_end()
{ {
last_token = "end"; last_token = "end";
return END; return END;
} }
static l_quoted_string() static int l_quoted_string()
{ {
register char *p; register char *p;
yylval.dynstr = ds(yytext+1); yylval.dynstr = ds(yytext+1);
if (p=rindex(yylval.dynstr, '"')) if ( (p=rindex(yylval.dynstr, '"')) )
*p='\0'; *p='\0';
last_token = ds(yylval.dynstr); last_token = ds(yylval.dynstr);
return STRING; return STRING;
} }
static l_string() static int l_string()
{ {
yylval.dynstr = ds(yytext); yylval.dynstr = ds(yytext);
last_token = ds(yylval.dynstr); last_token = ds(yylval.dynstr);

View File

@ -26,6 +26,7 @@ extern FILE *output_file;
extern FILE *yyin, *yyout; extern FILE *yyin, *yyout;
extern int yylineno; extern int yylineno;
int
main(argc, argv) main(argc, argv)
int argc; int argc;
char **argv; char **argv;
@ -85,10 +86,12 @@ main(argc, argv)
return result; return result;
} }
int
yyerror(s) yyerror(s)
char *s; char *s;
{ {
fputs(s, stderr); fputs(s, stderr);
fprintf(stderr, "\nLine %d; last token was '%s'\n", fprintf(stderr, "\nLine %d; last token was '%s'\n",
yylineno, last_token); yylineno, last_token);
return 0;
} }

View File

@ -74,12 +74,18 @@ int (*sfunc)() = fname;
#define SYMBOL_TYPE(x) ((x) & (N_TYPE | N_STAB)) #define SYMBOL_TYPE(x) ((x) & (N_TYPE | N_STAB))
void *emalloc(); void *emalloc();
void usage __P(( void ));
int process_file __P(( char * ));
int show_archive __P(( char *, FILE * ));
int show_objfile __P(( char *, FILE * ));
void print_symbol __P(( char *, struct nlist * ));
/* /*
* main() * main()
* parse command line, execute process_file() for each file * parse command line, execute process_file() for each file
* specified on the command line. * specified on the command line.
*/ */
int
main(argc, argv) main(argc, argv)
int argc; int argc;
char **argv; char **argv;
@ -143,6 +149,7 @@ main(argc, argv)
* show symbols in the file given as an argument. Accepts archive and * show symbols in the file given as an argument. Accepts archive and
* object files as input. * object files as input.
*/ */
int
process_file(fname) process_file(fname)
char *fname; char *fname;
{ {
@ -205,6 +212,7 @@ static char *scat(char *dest, char *src)
* show_archive() * show_archive()
* show symbols in the given archive file * show symbols in the given archive file
*/ */
int
show_archive(fname, fp) show_archive(fname, fp)
char *fname; char *fname;
FILE *fp; FILE *fp;
@ -324,6 +332,7 @@ skip: if (fseek(fp, last_ar_off + even(atol(ar_head.ar_size)),
* file pointer for fp is expected to be at the beginning of an a.out * file pointer for fp is expected to be at the beginning of an a.out
* header. * header.
*/ */
int
show_objfile(objname, fp) show_objfile(objname, fp)
char *objname; char *objname;
FILE *fp; FILE *fp;
@ -457,6 +466,7 @@ show_objfile(objname, fp)
* print_symbol() * print_symbol()
* show one symbol * show one symbol
*/ */
void
print_symbol(objname, sym) print_symbol(objname, sym)
char *objname; char *objname;
register struct nlist *sym; register struct nlist *sym;
@ -589,6 +599,7 @@ typeletter(type)
return('?'); return('?');
} }
int
fname(a0, b0) fname(a0, b0)
void *a0, *b0; void *a0, *b0;
{ {
@ -597,6 +608,7 @@ fname(a0, b0)
return(strcmp(a->n_un.n_name, b->n_un.n_name)); return(strcmp(a->n_un.n_name, b->n_un.n_name));
} }
int
rname(a0, b0) rname(a0, b0)
void *a0, *b0; void *a0, *b0;
{ {
@ -605,6 +617,7 @@ rname(a0, b0)
return(strcmp(b->n_un.n_name, a->n_un.n_name)); return(strcmp(b->n_un.n_name, a->n_un.n_name));
} }
int
value(a0, b0) value(a0, b0)
void *a0, *b0; void *a0, *b0;
{ {
@ -635,13 +648,14 @@ emalloc(size)
char *p; char *p;
/* NOSTRICT */ /* NOSTRICT */
if (p = malloc(size)) if ( (p = malloc(size)) )
return(p); return(p);
(void)fprintf(stderr, "nm: %s\n", strerror(errno)); (void)fprintf(stderr, "nm: %s\n", strerror(errno));
exit(1); exit(1);
} }
usage() void
usage(void)
{ {
(void)fprintf(stderr, "usage: nm [-agnopruw] [file ...]\n"); (void)fprintf(stderr, "usage: nm [-agnopruw] [file ...]\n");
exit(1); exit(1);

View File

@ -48,10 +48,17 @@ static char sccsid[] = "@(#)build.c 8.1 (Berkeley) 6/6/93";
#include <fcntl.h> #include <fcntl.h>
#include <ranlib.h> #include <ranlib.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h> #include <unistd.h>
#include "archive.h" #include "archive.h"
extern int tmp __P(( void ));
extern void error __P(( char * ));
extern void badfmt __P(( void ));
extern void settime __P(( int ));
extern CHDR chdr; /* converted header */ extern CHDR chdr; /* converted header */
extern char *archive; /* archive name */ extern char *archive; /* archive name */
extern char *tname; /* temporary file "name" */ extern char *tname; /* temporary file "name" */
@ -72,7 +79,8 @@ long tsymlen; /* total string length */
static void rexec __P((int, int)); static void rexec __P((int, int));
static void symobj __P((void)); static void symobj __P((void));
build() int
build(void)
{ {
CF cf; CF cf;
int afd, tfd; int afd, tfd;

View File

@ -42,6 +42,7 @@ static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93";
#include <sys/signal.h> #include <sys/signal.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <signal.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -50,7 +51,10 @@ static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93";
extern char *archive; /* archive name */ extern char *archive; /* archive name */
char *tname = "temporary file"; /* temporary file "name" */ char *tname = "temporary file"; /* temporary file "name" */
tmp() void error __P(( char * ));
int
tmp(void)
{ {
sigset_t set, oset; sigset_t set, oset;
int fd; int fd;
@ -90,12 +94,14 @@ rname(path)
return((ind = rindex(path, '/')) ? ind + 1 : path); return((ind = rindex(path, '/')) ? ind + 1 : path);
} }
badfmt() void
badfmt(void)
{ {
errno = EFTYPE; errno = EFTYPE;
error(archive); error(archive);
} }
void
error(name) error(name)
char *name; char *name;
{ {

View File

@ -50,10 +50,15 @@ static char sccsid[] = "@(#)ranlib.c 8.1 (Berkeley) 6/6/93";
#include <stdlib.h> #include <stdlib.h>
#include <archive.h> #include <archive.h>
extern int build __P(( void ));
extern int touch __P(( void ));
void usage __P((void));
CHDR chdr; CHDR chdr;
u_int options; /* UNUSED -- keep open_archive happy */ u_int options; /* UNUSED -- keep open_archive happy */
char *archive; char *archive;
int
main(argc, argv) main(argc, argv)
int argc; int argc;
char **argv; char **argv;
@ -77,13 +82,15 @@ main(argc, argv)
if (!*argv) if (!*argv)
usage(); usage();
for (eval = 0; archive = *argv++;) for (eval = 0; (archive = *argv++); )
eval |= tflag ? touch() : build(); eval |= tflag ? touch() : build();
exit(eval); exit(eval);
} }
usage() void
usage(void)
{ {
(void)fprintf(stderr, "usage: ranlib [-t] archive ...\n"); (void)fprintf(stderr, "usage: ranlib [-t] archive ...\n");
exit(1); exit(1);
} }

View File

@ -52,7 +52,12 @@ static char sccsid[] = "@(#)touch.c 8.1 (Berkeley) 6/6/93";
extern CHDR chdr; /* converted header */ extern CHDR chdr; /* converted header */
extern char *archive; /* archive name */ extern char *archive; /* archive name */
touch() extern void error __P(( char * ));
void settime __P(( int ));
int touch __P(( void ));
int
touch(void)
{ {
int afd; int afd;
@ -69,6 +74,7 @@ touch()
return(0); return(0);
} }
void
settime(afd) settime(afd)
int afd; int afd;
{ {

View File

@ -43,10 +43,10 @@ static char sccsid[] = "@(#)rpc_clntout.c 1.11 89/02/22 (C) 1987 SMI";
#include "rpc_parse.h" #include "rpc_parse.h"
#include "rpc_util.h" #include "rpc_util.h"
extern int pdeclaration __P(( char *, declaration *, int, char * )); extern void pdeclaration __P(( char *, declaration *, int, char * ));
void printarglist __P(( proc_list *, char *, char *, char *)); void printarglist __P(( proc_list *, char *, char *, char *));
static int write_program __P(( definition * )); static void write_program __P(( definition * ));
static int printbody __P(( proc_list * )); static void printbody __P(( proc_list * ));
static char RESULT[] = "clnt_res"; static char RESULT[] = "clnt_res";
@ -72,7 +72,7 @@ write_stubs()
} }
} }
static static void
write_program(def) write_program(def)
definition *def; definition *def;
{ {
@ -218,13 +218,12 @@ ampr(type)
} }
} }
static static void
printbody(proc) printbody(proc)
proc_list *proc; proc_list *proc;
{ {
decl_list *l; decl_list *l;
bool_t args2 = (proc->arg_num > 1); bool_t args2 = (proc->arg_num > 1);
int i;
/* /*
* For new style with multiple arguments, need a structure in which * For new style with multiple arguments, need a structure in which

View File

@ -39,17 +39,20 @@ static char sccsid[] = "@(#)rpc_cout.c 1.13 89/02/22 (C) 1987 SMI";
*/ */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include "rpc_parse.h" #include "rpc_parse.h"
#include "rpc_util.h" #include "rpc_util.h"
static int print_header __P(( definition * )); static void print_header __P(( definition * ));
static int print_trailer __P(( void )); static void print_trailer __P(( void ));
static int print_stat __P(( int , declaration * )); static void print_stat __P(( int , declaration * ));
static int emit_enum __P(( definition * )); static void emit_enum __P(( definition * ));
static int emit_program __P(( definition * )); static void emit_program __P(( definition * ));
static int emit_union __P(( definition * )); static void emit_union __P(( definition * ));
static int emit_struct __P(( definition * )); static void emit_struct __P(( definition * ));
static int emit_typedef __P(( definition * )); static void emit_typedef __P(( definition * ));
static void emit_inline __P(( int, declaration *, int ));
static void emit_single_in_line __P(( int, declaration *, int, relation ));
/* /*
* Emit the C-routine for the given definition * Emit the C-routine for the given definition
@ -89,11 +92,13 @@ emit(def)
case DEF_TYPEDEF: case DEF_TYPEDEF:
emit_typedef(def); emit_typedef(def);
break; break;
/* DEF_CONST and DEF_PROGRAM have already been handled */
default:
} }
print_trailer(); print_trailer();
} }
static static int
findtype(def, type) findtype(def, type)
definition *def; definition *def;
char *type; char *type;
@ -106,7 +111,7 @@ findtype(def, type)
} }
} }
static static int
undefined(type) undefined(type)
char *type; char *type;
{ {
@ -117,7 +122,7 @@ undefined(type)
} }
static static void
print_generic_header(procname, pointerp) print_generic_header(procname, pointerp)
char* procname; char* procname;
int pointerp; int pointerp;
@ -141,15 +146,10 @@ print_generic_header(procname, pointerp)
} }
} }
static static void
print_header(def) print_header(def)
definition *def; definition *def;
{ {
decl_list *dl;
bas_type *ptr;
int i;
print_generic_header(def->def_name, print_generic_header(def->def_name,
def->def_kind != DEF_TYPEDEF || def->def_kind != DEF_TYPEDEF ||
!isvectordef(def->def.ty.old_type, !isvectordef(def->def.ty.old_type,
@ -162,14 +162,14 @@ print_header(def)
f_print(fout, "\tregister long *buf;\n\n"); f_print(fout, "\tregister long *buf;\n\n");
} }
static static void
print_prog_header(plist) print_prog_header(plist)
proc_list *plist; proc_list *plist;
{ {
print_generic_header(plist->args.argname, 1); print_generic_header(plist->args.argname, 1);
} }
static static void
print_trailer() print_trailer()
{ {
f_print(fout, "\treturn (TRUE);\n"); f_print(fout, "\treturn (TRUE);\n");
@ -177,7 +177,7 @@ print_trailer()
} }
static static void
print_ifopen(indent, name) print_ifopen(indent, name)
int indent; int indent;
char *name; char *name;
@ -186,14 +186,14 @@ print_ifopen(indent, name)
f_print(fout, "if (!xdr_%s(xdrs", name); f_print(fout, "if (!xdr_%s(xdrs", name);
} }
static static void
print_ifarg(arg) print_ifarg(arg)
char *arg; char *arg;
{ {
f_print(fout, ", %s", arg); f_print(fout, ", %s", arg);
} }
static static void
print_ifsizeof(indent, prefix, type) print_ifsizeof(indent, prefix, type)
int indent; int indent;
char *prefix; char *prefix;
@ -216,7 +216,7 @@ print_ifsizeof(indent, prefix, type)
} }
} }
static static void
print_ifclose(indent) print_ifclose(indent)
int indent; int indent;
{ {
@ -225,7 +225,7 @@ print_ifclose(indent)
f_print(fout, "\treturn (FALSE);\n"); f_print(fout, "\treturn (FALSE);\n");
} }
static static void
print_ifstat(indent, prefix, type, rel, amax, objname, name) print_ifstat(indent, prefix, type, rel, amax, objname, name)
int indent; int indent;
char *prefix; char *prefix;
@ -302,7 +302,7 @@ print_ifstat(indent, prefix, type, rel, amax, objname, name)
} }
/* ARGSUSED */ /* ARGSUSED */
static static void
emit_enum(def) emit_enum(def)
definition *def; definition *def;
{ {
@ -311,7 +311,7 @@ emit_enum(def)
print_ifclose(1); print_ifclose(1);
} }
static static void
emit_program(def) emit_program(def)
definition *def; definition *def;
{ {
@ -332,7 +332,7 @@ emit_program(def)
} }
static static void
emit_union(def) emit_union(def)
definition *def; definition *def;
{ {
@ -385,6 +385,9 @@ strlen(dflt->name) + 1);
dflt->array_max, object, dflt->name); dflt->array_max, object, dflt->name);
free(object); free(object);
f_print(fout, "\t\tbreak;\n"); f_print(fout, "\t\tbreak;\n");
} else {
f_print(fout, "\tdefault:\n");
f_print(fout, "\t\tbreak;\n");
} }
} else { } else {
f_print(fout, "\tdefault:\n"); f_print(fout, "\tdefault:\n");
@ -553,12 +556,12 @@ int flag;
} }
} }
static static void
emit_struct(def) emit_struct(def)
definition *def; definition *def;
{ {
decl_list *dl; decl_list *dl;
int i, j, size, flag; int j, size, flag;
bas_type *ptr; bas_type *ptr;
int can_inline; int can_inline;
@ -623,7 +626,7 @@ emit_struct(def)
} }
static static void
emit_typedef(def) emit_typedef(def)
definition *def; definition *def;
{ {
@ -635,7 +638,7 @@ emit_typedef(def)
print_ifstat(1, prefix, type, rel, amax, "objp", def->def_name); print_ifstat(1, prefix, type, rel, amax, "objp", def->def_name);
} }
static static void
print_stat(indent, dec) print_stat(indent, dec)
int indent; int indent;
declaration *dec; declaration *dec;
@ -657,6 +660,7 @@ print_stat(indent, dec)
char *upcase (); char *upcase ();
static void
emit_inline(indent, decl, flag) emit_inline(indent, decl, flag)
int indent; int indent;
declaration *decl; declaration *decl;
@ -681,9 +685,11 @@ int flag;
f_print(fout, "}\n"); f_print(fout, "}\n");
tabify(fout, indent); tabify(fout, indent);
f_print(fout, "}\n"); f_print(fout, "}\n");
default:
} }
} }
static void
emit_single_in_line(indent, decl, flag, rel) emit_single_in_line(indent, decl, flag, rel)
int indent; int indent;
declaration *decl; declaration *decl;

View File

@ -43,16 +43,18 @@ static char sccsid[] = "@(#)rpc_hout.c 1.12 89/02/22 (C) 1987 SMI";
#include "rpc_util.h" #include "rpc_util.h"
void storexdrfuncdecl __P(( char *, int )); void storexdrfuncdecl __P(( char *, int ));
static int pconstdef __P(( definition * )); static void pconstdef __P(( definition * ));
static int pstructdef __P(( definition * )); static void pstructdef __P(( definition * ));
static int puniondef __P(( definition * )); static void puniondef __P(( definition * ));
static int pprogramdef __P(( definition * )); static void pprogramdef __P(( definition * ));
static int pstructdef __P(( definition * )); static void pstructdef __P(( definition * ));
static int penumdef __P(( definition * )); static void penumdef __P(( definition * ));
static int ptypedef __P(( definition * )); static void ptypedef __P(( definition * ));
static int pdefine __P(( char *, char * )); static void pdefine __P(( char *, char * ));
static int undefined2 __P(( char *, char * )); static int undefined2 __P(( char *, char * ));
static int parglist __P(( proc_list *, char * )); static void parglist __P(( proc_list *, char * ));
static void pprocdef __P(( proc_list *, version_list *, char *, int, int ));
void pdeclaration __P(( char *, declaration *, int, char * ));
static char RESULT[] = "clnt_res"; static char RESULT[] = "clnt_res";
@ -109,7 +111,8 @@ print_funcdef(def)
f_print(fout, "\n"); f_print(fout, "\n");
pprogramdef(def); pprogramdef(def);
break; break;
} default:
}
} }
/* store away enough information to allow the XDR functions to be spat /* store away enough information to allow the XDR functions to be spat
@ -157,7 +160,7 @@ int i;
} }
static static void
pconstdef(def) pconstdef(def)
definition *def; definition *def;
{ {
@ -167,7 +170,7 @@ pconstdef(def)
/* print out the definitions for the arguments of functions in the /* print out the definitions for the arguments of functions in the
header file header file
*/ */
static static void
pargdef(def) pargdef(def)
definition *def; definition *def;
{ {
@ -201,7 +204,7 @@ pargdef(def)
} }
static static void
pstructdef(def) pstructdef(def)
definition *def; definition *def;
{ {
@ -216,7 +219,7 @@ pstructdef(def)
f_print(fout, "typedef struct %s %s;\n", name, name); f_print(fout, "typedef struct %s %s;\n", name, name);
} }
static static void
puniondef(def) puniondef(def)
definition *def; definition *def;
{ {
@ -245,7 +248,7 @@ puniondef(def)
f_print(fout, "typedef struct %s %s;\n", name, name); f_print(fout, "typedef struct %s %s;\n", name, name);
} }
static static void
pdefine(name, num) pdefine(name, num)
char *name; char *name;
char *num; char *num;
@ -253,7 +256,7 @@ pdefine(name, num)
f_print(fout, "#define\t%s %s\n", name, num); f_print(fout, "#define\t%s %s\n", name, num);
} }
static static void
puldefine(name, num) puldefine(name, num)
char *name; char *name;
char *num; char *num;
@ -261,7 +264,7 @@ puldefine(name, num)
f_print(fout, "#define\t%s ((unsigned long)(%s))\n", name, num); f_print(fout, "#define\t%s ((unsigned long)(%s))\n", name, num);
} }
static static int
define_printed(stop, start) define_printed(stop, start)
proc_list *stop; proc_list *stop;
version_list *start; version_list *start;
@ -282,7 +285,7 @@ define_printed(stop, start)
/* NOTREACHED */ /* NOTREACHED */
} }
static static void
pfreeprocdef(char * name, char *vers, int mode) pfreeprocdef(char * name, char *vers, int mode)
{ {
f_print(fout, "extern int "); f_print(fout, "extern int ");
@ -295,7 +298,7 @@ pfreeprocdef(char * name, char *vers, int mode)
} }
static static void
pprogramdef(def) pprogramdef(def)
definition *def; definition *def;
{ {
@ -371,6 +374,7 @@ pprogramdef(def)
} }
} }
static void
pprocdef(proc, vp, addargtype, server_p, mode) pprocdef(proc, vp, addargtype, server_p, mode)
proc_list *proc; proc_list *proc;
version_list *vp; version_list *vp;
@ -399,15 +403,12 @@ pprocdef(proc, vp, addargtype, server_p, mode)
parglist(proc, addargtype); parglist(proc, addargtype);
else else
f_print(fout, "();\n"); f_print(fout, "();\n");
} }
/* print out argument list of procedure */ /* print out argument list of procedure */
static static void
parglist(proc, addargtype) parglist(proc, addargtype)
proc_list *proc; proc_list *proc;
char* addargtype; char* addargtype;
@ -438,7 +439,7 @@ parglist(proc, addargtype)
} }
static static void
penumdef(def) penumdef(def)
definition *def; definition *def;
{ {
@ -470,7 +471,7 @@ penumdef(def)
f_print(fout, "typedef enum %s %s;\n", name, name); f_print(fout, "typedef enum %s %s;\n", name, name);
} }
static static void
ptypedef(def) ptypedef(def)
definition *def; definition *def;
{ {
@ -517,6 +518,7 @@ ptypedef(def)
} }
} }
void
pdeclaration(name, dec, tab, separator) pdeclaration(name, dec, tab, separator)
char *name; char *name;
declaration *dec; declaration *dec;
@ -575,7 +577,7 @@ pdeclaration(name, dec, tab, separator)
f_print(fout, separator); f_print(fout, separator);
} }
static static int
undefined2(type, stop) undefined2(type, stop)
char *type; char *type;
char *stop; char *stop;

View File

@ -42,6 +42,7 @@ static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI";
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <ctype.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/param.h> #include <sys/param.h>
#include <sys/file.h> #include <sys/file.h>
@ -53,23 +54,26 @@ static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI";
extern void write_sample_svc __P(( definition * )); extern void write_sample_svc __P(( definition * ));
extern int write_sample_clnt __P(( definition * )); extern int write_sample_clnt __P(( definition * ));
extern void write_sample_clnt_main __P(( void )); extern void write_sample_clnt_main __P(( void ));
static int c_output __P(( char *, char *, int, char * )); extern void add_sample_msg __P(( void ));
static int h_output __P(( char *, char *, int, char * )); static void c_output __P(( char *, char *, int, char * ));
static int l_output __P(( char *, char *, int, char * )); static void h_output __P(( char *, char *, int, char * ));
static int t_output __P(( char *, char *, int, char * )); static void l_output __P(( char *, char *, int, char * ));
static int clnt_output __P(( char *, char *, int, char * )); static void t_output __P(( char *, char *, int, char * ));
static void clnt_output __P(( char *, char *, int, char * ));
void c_initialize __P(( void ));
#ifndef __FreeBSD__ #ifndef __FreeBSD__
char * rindex(); char * rindex();
#endif #endif
static int usage __P(( void )); static void usage __P(( void ));
static int options_usage __P (( void )); static void options_usage __P (( void ));
static int do_registers __P(( int, char ** )); static int do_registers __P(( int, char ** ));
static int parseargs __P(( int, char **, struct commandline * )); static int parseargs __P(( int, char **, struct commandline * ));
static int svc_output __P(( char *, char *, int, char * )); static void svc_output __P(( char *, char *, int, char * ));
static void mkfile_output __P(( struct commandline * )); static void mkfile_output __P(( struct commandline * ));
static int s_output __P(( int, char **, char *, char *, int, char *, int, int )); static void s_output __P(( int, char **, char *, char *, int, char *, int, int ));
#define EXTEND 1 /* alias for TRUE */ #define EXTEND 1 /* alias for TRUE */
#define DONT_EXTEND 0 /* alias for FALSE */ #define DONT_EXTEND 0 /* alias for FALSE */
@ -156,6 +160,7 @@ xdrfunc *xdrfunc_tail = NULL; /* xdr function list */
pid_t childpid; pid_t childpid;
int
main(argc, argv) main(argc, argv)
int argc; int argc;
char *argv[]; char *argv[];
@ -274,7 +279,7 @@ extendfile(file, ext)
/* /*
* Open output file with given extension * Open output file with given extension
*/ */
static static void
open_output(infile, outfile) open_output(infile, outfile)
char *infile; char *infile;
char *outfile; char *outfile;
@ -298,9 +303,10 @@ open_output(infile, outfile)
} }
record_open(outfile); record_open(outfile);
return;
} }
static static void
add_warning() add_warning()
{ {
f_print(fout, "/*\n"); f_print(fout, "/*\n");
@ -342,7 +348,7 @@ static void find_cpp()
/* /*
* Open input file with given define for C-preprocessor * Open input file with given define for C-preprocessor
*/ */
static static void
open_input(infile, define) open_input(infile, define)
char *infile; char *infile;
char *define; char *define;
@ -432,7 +438,7 @@ char *ext;
} }
static static void
c_output(infile, define, extend, outfile) c_output(infile, define, extend, outfile)
char *infile; char *infile;
char *define; char *define;
@ -456,7 +462,7 @@ c_output(infile, define, extend, outfile)
} else } else
f_print(fout, "#include <rpc/rpc.h>\n"); f_print(fout, "#include <rpc/rpc.h>\n");
tell = ftell(fout); tell = ftell(fout);
while (def = get_definition()) { while ( (def = get_definition()) ) {
emit(def); emit(def);
} }
if (extend && tell == ftell(fout)) { if (extend && tell == ftell(fout)) {
@ -465,6 +471,7 @@ c_output(infile, define, extend, outfile)
} }
void
c_initialize() c_initialize()
{ {
@ -512,7 +519,7 @@ char *generate_guard(pathname)
*/ */
static static void
h_output(infile, define, extend, outfile) h_output(infile, define, extend, outfile)
char *infile; char *infile;
char *define; char *define;
@ -558,7 +565,7 @@ h_output(infile, define, extend, outfile)
tell = ftell(fout); tell = ftell(fout);
/* print data definitions */ /* print data definitions */
while (def = get_definition()) { while ( (def = get_definition()) ) {
print_datadef(def); print_datadef(def);
} }
@ -627,7 +634,7 @@ h_output(infile, define, extend, outfile)
/* /*
* Compile into an RPC service * Compile into an RPC service
*/ */
static static void
s_output(argc, argv, infile, define, extend, outfile, nomain, netflag) s_output(argc, argv, infile, define, extend, outfile, nomain, netflag)
int argc; int argc;
char *argv[]; char *argv[];
@ -710,7 +717,7 @@ s_output(argc, argv, infile, define, extend, outfile, nomain, netflag)
if (timerflag) if (timerflag)
f_print(fout, "\n#define _RPCSVC_CLOSEDOWN %s\n", f_print(fout, "\n#define _RPCSVC_CLOSEDOWN %s\n",
svcclosetime); svcclosetime);
while (def = get_definition()) { while ( (def = get_definition()) ) {
foundprogram |= (def->def_kind == DEF_PROGRAM); foundprogram |= (def->def_kind == DEF_PROGRAM);
} }
if (extend && !foundprogram) { if (extend && !foundprogram) {
@ -731,7 +738,7 @@ s_output(argc, argv, infile, define, extend, outfile, nomain, netflag)
/* /*
* generate client side stubs * generate client side stubs
*/ */
static static void
l_output(infile, define, extend, outfile) l_output(infile, define, extend, outfile)
char *infile; char *infile;
char *define; char *define;
@ -754,7 +761,7 @@ l_output(infile, define, extend, outfile)
free(include); free(include);
} else } else
f_print(fout, "#include <rpc/rpc.h>\n"); f_print(fout, "#include <rpc/rpc.h>\n");
while (def = get_definition()) { while ( (def = get_definition()) ) {
foundprogram |= (def->def_kind == DEF_PROGRAM); foundprogram |= (def->def_kind == DEF_PROGRAM);
} }
if (extend && !foundprogram) { if (extend && !foundprogram) {
@ -767,7 +774,7 @@ l_output(infile, define, extend, outfile)
/* /*
* generate the dispatch table * generate the dispatch table
*/ */
static static void
t_output(infile, define, extend, outfile) t_output(infile, define, extend, outfile)
char *infile; char *infile;
char *define; char *define;
@ -782,7 +789,7 @@ t_output(infile, define, extend, outfile)
outfilename = extend ? extendfile(infile, outfile) : outfile; outfilename = extend ? extendfile(infile, outfile) : outfile;
open_output(infile, outfilename); open_output(infile, outfilename);
add_warning(); add_warning();
while (def = get_definition()) { while ( (def = get_definition()) ) {
foundprogram |= (def->def_kind == DEF_PROGRAM); foundprogram |= (def->def_kind == DEF_PROGRAM);
} }
if (extend && !foundprogram) { if (extend && !foundprogram) {
@ -793,7 +800,7 @@ t_output(infile, define, extend, outfile)
} }
/* sample routine for the server template */ /* sample routine for the server template */
static static void
svc_output(infile, define, extend, outfile) svc_output(infile, define, extend, outfile)
char *infile; char *infile;
char *define; char *define;
@ -821,7 +828,7 @@ svc_output(infile, define, extend, outfile)
f_print(fout, "#include <rpc/rpc.h>\n"); f_print(fout, "#include <rpc/rpc.h>\n");
tell = ftell(fout); tell = ftell(fout);
while (def = get_definition()) { while ( (def = get_definition()) ) {
write_sample_svc(def); write_sample_svc(def);
} }
if (extend && tell == ftell(fout)) { if (extend && tell == ftell(fout)) {
@ -830,7 +837,7 @@ svc_output(infile, define, extend, outfile)
} }
/* sample main routine for client */ /* sample main routine for client */
static static void
clnt_output(infile, define, extend, outfile) clnt_output(infile, define, extend, outfile)
char *infile; char *infile;
char *define; char *define;
@ -859,7 +866,7 @@ clnt_output(infile, define, extend, outfile)
} else } else
f_print(fout, "#include <rpc/rpc.h>\n"); f_print(fout, "#include <rpc/rpc.h>\n");
tell = ftell(fout); tell = ftell(fout);
while (def = get_definition()) { while ( (def = get_definition()) ) {
has_program += write_sample_clnt(def); has_program += write_sample_clnt(def);
} }
@ -981,8 +988,8 @@ struct commandline *cmd;
* Perform registrations for service output * Perform registrations for service output
* Return 0 if failed; 1 otherwise. * Return 0 if failed; 1 otherwise.
*/ */
static static int
int do_registers(argc, argv) do_registers(argc, argv)
int argc; int argc;
char *argv[]; char *argv[];
{ {
@ -1078,7 +1085,7 @@ char *outfile;
/* /*
* Parse command line arguments * Parse command line arguments
*/ */
static static int
parseargs(argc, argv, cmd) parseargs(argc, argv, cmd)
int argc; int argc;
char *argv[]; char *argv[];
@ -1129,10 +1136,10 @@ parseargs(argc, argv, cmd)
case 'l': case 'l':
case 'm': case 'm':
case 't': case 't':
if (flag[c]) { if (flag[(int)c]) {
return (0); return (0);
} }
flag[c] = 1; flag[(int)c] = 1;
break; break;
case 'S': case 'S':
/* /*
@ -1151,10 +1158,10 @@ parseargs(argc, argv, cmd)
else else
return (0); return (0);
if (flag[ch]) { if (flag[(int)ch]) {
return (0); return (0);
} }
flag[ch] = 1; flag[(int)ch] = 1;
break; break;
case 'C': /* ANSI C syntax */ case 'C': /* ANSI C syntax */
Cflag = 1; Cflag = 1;
@ -1211,7 +1218,7 @@ parseargs(argc, argv, cmd)
argv[i][j + 1] != 0) { argv[i][j + 1] != 0) {
return (0); return (0);
} }
flag[c] = 1; flag[(int)c] = 1;
if (++i == argc) { if (++i == argc) {
return (0); return (0);
} }
@ -1306,7 +1313,7 @@ parseargs(argc, argv, cmd)
return (1); return (1);
} }
static static void
usage() usage()
{ {
f_print(stderr, "usage: %s infile\n", cmdname); f_print(stderr, "usage: %s infile\n", cmdname);
@ -1324,7 +1331,7 @@ usage()
exit(1); exit(1);
} }
static static void
options_usage() options_usage()
{ {
f_print(stderr, "options:\n"); f_print(stderr, "options:\n");

View File

@ -47,17 +47,17 @@ static char sccsid[] = "@(#)rpc_parse.c 1.8 89/02/22 (C) 1987 SMI";
#define ARGNAME "arg" #define ARGNAME "arg"
extern char *make_argname __P(( char *, char * )); extern char *make_argname __P(( char *, char * ));
static int isdefined __P(( definition * )); static void isdefined __P(( definition * ));
static int def_struct __P(( definition * )); static void def_struct __P(( definition * ));
static int def_program __P(( definition * )); static void def_program __P(( definition * ));
static int def_enum __P(( definition * )); static void def_enum __P(( definition * ));
static int def_const __P(( definition * )); static void def_const __P(( definition * ));
static int def_union __P(( definition * )); static void def_union __P(( definition * ));
static int def_typedef __P(( definition * )); static void def_typedef __P(( definition * ));
static int get_declaration __P(( declaration *, defkind )); static void get_declaration __P(( declaration *, defkind ));
static int get_prog_declaration __P(( declaration *, defkind, int )); static void get_prog_declaration __P(( declaration *, defkind, int ));
static int get_type __P(( char **, char **, defkind )); static void get_type __P(( char **, char **, defkind ));
static int unsigned_dec __P(( char ** )); static void unsigned_dec __P(( char ** ));
#ifndef __FreeBSD__ #ifndef __FreeBSD__
extern char *strdup(); extern char *strdup();
@ -103,14 +103,14 @@ get_definition()
return (defp); return (defp);
} }
static static void
isdefined(defp) isdefined(defp)
definition *defp; definition *defp;
{ {
STOREVAL(&defined, defp); STOREVAL(&defined, defp);
} }
static static void
def_struct(defp) def_struct(defp)
definition *defp; definition *defp;
{ {
@ -138,7 +138,7 @@ def_struct(defp)
*tailp = NULL; *tailp = NULL;
} }
static static void
def_program(defp) def_program(defp)
definition *defp; definition *defp;
{ {
@ -245,7 +245,7 @@ def_program(defp)
} }
static static void
def_enum(defp) def_enum(defp)
definition *defp; definition *defp;
{ {
@ -275,7 +275,7 @@ def_enum(defp)
*tailp = NULL; *tailp = NULL;
} }
static static void
def_const(defp) def_const(defp)
definition *defp; definition *defp;
{ {
@ -289,13 +289,13 @@ def_const(defp)
defp->def.co = tok.str; defp->def.co = tok.str;
} }
static static void
def_union(defp) def_union(defp)
definition *defp; definition *defp;
{ {
token tok; token tok;
declaration dec; declaration dec;
case_list *cases, *tcase; case_list *cases;
case_list **tailp; case_list **tailp;
int flag; int flag;
@ -388,7 +388,8 @@ static char* reserved_types[] =
* check that the given name is not one that would eventually result in * check that the given name is not one that would eventually result in
* xdr routines that would conflict with internal XDR routines. * xdr routines that would conflict with internal XDR routines.
*/ */
static check_type_name(name, new_type) static void
check_type_name(name, new_type)
int new_type; int new_type;
char* name; char* name;
{ {
@ -417,7 +418,7 @@ char* name;
static static void
def_typedef(defp) def_typedef(defp)
definition *defp; definition *defp;
{ {
@ -433,7 +434,7 @@ def_typedef(defp)
defp->def.ty.array_max = dec.array_max; defp->def.ty.array_max = dec.array_max;
} }
static static void
get_declaration(dec, dkind) get_declaration(dec, dkind)
declaration *dec; declaration *dec;
defkind dkind; defkind dkind;
@ -486,7 +487,7 @@ get_declaration(dec, dkind)
} }
static static void
get_prog_declaration(dec, dkind, num) get_prog_declaration(dec, dkind, num)
declaration *dec; declaration *dec;
defkind dkind; defkind dkind;
@ -559,7 +560,7 @@ get_prog_declaration(dec, dkind, num)
static static void
get_type(prefixp, typep, dkind) get_type(prefixp, typep, dkind)
char **prefixp; char **prefixp;
char **typep; char **typep;
@ -617,7 +618,7 @@ get_type(prefixp, typep, dkind)
} }
} }
static static void
unsigned_dec(typep) unsigned_dec(typep)
char **typep; char **typep;
{ {

View File

@ -43,9 +43,9 @@
static char RQSTP[] = "rqstp"; static char RQSTP[] = "rqstp";
extern void printarglist __P(( proc_list *, char *, char *, char *)); extern void printarglist __P(( proc_list *, char *, char *, char *));
static int write_sample_client __P(( char *, version_list * )); static void write_sample_client __P(( char *, version_list * ));
static int write_sample_server __P(( definition * )); static void write_sample_server __P(( definition * ));
static int return_type __P(( proc_list * )); static void return_type __P(( proc_list * ));
void void
write_sample_svc(def) write_sample_svc(def)
@ -76,7 +76,7 @@ write_sample_clnt(def)
} }
static static void
write_sample_client(program_name, vp) write_sample_client(program_name, vp)
char *program_name; char *program_name;
version_list *vp; version_list *vp;
@ -192,7 +192,7 @@ write_sample_client(program_name, vp)
f_print(fout, "}\n"); f_print(fout, "}\n");
} }
static static void
write_sample_server(def) write_sample_server(def)
definition *def; definition *def;
{ {
@ -261,13 +261,14 @@ write_sample_server(def)
static static void
return_type(plist) return_type(plist)
proc_list *plist; proc_list *plist;
{ {
ptype(plist->res_prefix, plist->res_type, 1); ptype(plist->res_prefix, plist->res_type, 1);
} }
void
add_sample_msg() add_sample_msg()
{ {
f_print(fout, "/*\n"); f_print(fout, "/*\n");

View File

@ -52,15 +52,15 @@ static char sccsid[] = "@(#)rpc_scan.c 1.11 89/02/22 (C) 1987 SMI";
static int pushed = 0; /* is a token pushed */ static int pushed = 0; /* is a token pushed */
static token lasttok; /* last token, if pushed */ static token lasttok; /* last token, if pushed */
static int unget_token __P(( token * )); static void unget_token __P(( token * ));
static int findstrconst __P(( char **, char **)); static void findstrconst __P(( char **, char **));
static int findchrconst __P(( char **, char **)); static void findchrconst __P(( char **, char **));
static int findconst __P(( char **, char **)); static void findconst __P(( char **, char **));
static int findkind __P(( char **, token * )); static void findkind __P(( char **, token * ));
static int cppline __P(( char * )); static int cppline __P(( char * ));
static int directive __P(( char * )); static int directive __P(( char * ));
static int printdirective __P(( char * )); static void printdirective __P(( char * ));
static int docppline __P(( char *, int *, char ** )); static void docppline __P(( char *, int *, char ** ));
/* /*
* scan expecting 1 given token * scan expecting 1 given token
@ -315,7 +315,7 @@ get_token(tokp)
} }
} }
static static void
unget_token(tokp) unget_token(tokp)
token *tokp; token *tokp;
{ {
@ -323,7 +323,7 @@ unget_token(tokp)
pushed = 1; pushed = 1;
} }
static static void
findstrconst(str, val) findstrconst(str, val)
char **str; char **str;
char **val; char **val;
@ -333,7 +333,7 @@ findstrconst(str, val)
p = *str; p = *str;
do { do {
*p++; p++;
} while (*p && *p != '"'); } while (*p && *p != '"');
if (*p == 0) { if (*p == 0) {
error("unterminated string constant"); error("unterminated string constant");
@ -346,7 +346,7 @@ findstrconst(str, val)
*str = p; *str = p;
} }
static static void
findchrconst(str, val) findchrconst(str, val)
char **str; char **str;
char **val; char **val;
@ -356,7 +356,7 @@ findchrconst(str, val)
p = *str; p = *str;
do { do {
*p++; p++;
} while (*p && *p != '\''); } while (*p && *p != '\'');
if (*p == 0) { if (*p == 0) {
error("unterminated string constant"); error("unterminated string constant");
@ -372,7 +372,7 @@ findchrconst(str, val)
*str = p; *str = p;
} }
static static void
findconst(str, val) findconst(str, val)
char **str; char **str;
char **val; char **val;
@ -425,7 +425,7 @@ static token symbols[] = {
{TOK_EOF, "??????"}, {TOK_EOF, "??????"},
}; };
static static void
findkind(mark, tokp) findkind(mark, tokp)
char **mark; char **mark;
token *tokp; token *tokp;
@ -454,28 +454,28 @@ findkind(mark, tokp)
*mark = str + len; *mark = str + len;
} }
static static int
cppline(line) cppline(line)
char *line; char *line;
{ {
return (line == curline && *line == '#'); return (line == curline && *line == '#');
} }
static static int
directive(line) directive(line)
char *line; char *line;
{ {
return (line == curline && *line == '%'); return (line == curline && *line == '%');
} }
static static void
printdirective(line) printdirective(line)
char *line; char *line;
{ {
f_print(fout, "%s", line + 1); f_print(fout, "%s", line + 1);
} }
static static void
docppline(line, lineno, fname) docppline(line, lineno, fname)
char *line; char *line;
int *lineno; int *lineno;

View File

@ -52,21 +52,23 @@ static char RETVAL[] = "retval";
char _errbuf[256]; /* For all messages */ char _errbuf[256]; /* For all messages */
void internal_proctype __P(( proc_list * )); void internal_proctype __P(( proc_list * ));
static int write_real_program __P(( definition * )); static void write_real_program __P(( definition * ));
static int write_program __P(( definition *, char * )); static void write_program __P(( definition *, char * ));
static int printerr __P(( char *, char * )); static void printerr __P(( char *, char * ));
static int printif __P(( char *, char *, char *, char * )); static void printif __P(( char *, char *, char *, char * ));
static int write_inetmost __P(( char * )); static void write_inetmost __P(( char * ));
static int print_return __P(( char * )); static void print_return __P(( char * ));
static int print_pmapunset __P(( char * )); static void print_pmapunset __P(( char * ));
static int print_err_message __P(( char * )); static void print_err_message __P(( char * ));
static int write_timeout_func __P(( void )); static void write_timeout_func __P(( void ));
static int write_pm_most __P(( char *, int )); static void write_pm_most __P(( char *, int ));
static int write_rpc_svc_fg __P(( char *, char * )); static void write_rpc_svc_fg __P(( char *, char * ));
static int open_log_file __P(( char *, char * )); static void open_log_file __P(( char *, char * ));
static void write_msg_out __P(( void ));
int nullproc __P(( proc_list * ));
static static void
p_xdrfunc(rname, typename) p_xdrfunc(rname, typename)
char* rname; char* rname;
char* typename; char* typename;
@ -320,7 +322,7 @@ write_programs(storage)
* Unpacks single user argument of printmsg_1 to call-by-value format * Unpacks single user argument of printmsg_1 to call-by-value format
* expected by printmsg_1. * expected by printmsg_1.
*/ */
static static void
write_real_program(def) write_real_program(def)
definition *def; definition *def;
{ {
@ -399,7 +401,7 @@ write_real_program(def)
} }
} }
static static void
write_program(def, storage) write_program(def, storage)
definition *def; definition *def;
char *storage; char *storage;
@ -618,7 +620,7 @@ write_program(def, storage)
} }
} }
static static void
printerr(err, transp) printerr(err, transp)
char *err; char *err;
char *transp; char *transp;
@ -626,7 +628,7 @@ printerr(err, transp)
f_print(fout, "\t\tsvcerr_%s(%s);\n", err, transp); f_print(fout, "\t\tsvcerr_%s(%s);\n", err, transp);
} }
static static void
printif(proc, transp, prefix, arg) printif(proc, transp, prefix, arg)
char *proc; char *proc;
char *transp; char *transp;
@ -637,6 +639,7 @@ printif(proc, transp, prefix, arg)
proc, transp, arg, prefix, arg); proc, transp, arg, prefix, arg);
} }
int
nullproc(proc) nullproc(proc)
proc_list *proc; proc_list *proc;
{ {
@ -648,7 +651,7 @@ nullproc(proc)
return (0); return (0);
} }
static static void
write_inetmost(infile) write_inetmost(infile)
char *infile; char *infile;
{ {
@ -677,7 +680,7 @@ write_inetmost(infile)
f_print(fout, "\t}\n"); f_print(fout, "\t}\n");
} }
static static void
print_return(space) print_return(space)
char *space; char *space;
{ {
@ -695,7 +698,7 @@ print_return(space)
} }
} }
static static void
print_pmapunset(space) print_pmapunset(space)
char *space; char *space;
{ {
@ -715,7 +718,7 @@ print_pmapunset(space)
} }
} }
static static void
print_err_message(space) print_err_message(space)
char *space; char *space;
{ {
@ -744,7 +747,8 @@ write_svc_aux(nomain)
* Write the _msgout function * Write the _msgout function
*/ */
write_msg_out() static void
write_msg_out(void)
{ {
f_print(fout, "\n"); f_print(fout, "\n");
/* /*
@ -776,8 +780,8 @@ write_msg_out()
/* /*
* Write the timeout function * Write the timeout function
*/ */
static static void
write_timeout_func() write_timeout_func(void)
{ {
if (!timerflag) if (!timerflag)
return; return;
@ -841,7 +845,7 @@ write_timeout_func()
/* /*
* Write the most of port monitor support * Write the most of port monitor support
*/ */
static static void
write_pm_most(infile, netflag) write_pm_most(infile, netflag)
char *infile; char *infile;
int netflag; int netflag;
@ -940,7 +944,7 @@ ioctl(0, I_PUSH, \"timod\")) {\n");
/* /*
* Support for backgrounding the server if self started. * Support for backgrounding the server if self started.
*/ */
static static void
write_rpc_svc_fg(infile, sp) write_rpc_svc_fg(infile, sp)
char *infile; char *infile;
char *sp; char *sp;
@ -992,7 +996,7 @@ write_rpc_svc_fg(infile, sp)
open_log_file(infile, sp); open_log_file(infile, sp);
} }
static static void
open_log_file(infile, sp) open_log_file(infile, sp)
char *infile; char *infile;
char *sp; char *sp;

View File

@ -58,8 +58,9 @@ static char null_entry[] = "\n\t(char *(*)())0,\n\
static char tbl_nproc[] = "int %s_nproc =\n\tsizeof(%s_table)/sizeof(%s_table[0]);\n\n"; static char tbl_nproc[] = "int %s_nproc =\n\tsizeof(%s_table)/sizeof(%s_table[0]);\n\n";
static int write_table __P(( definition * )); extern int nullproc __P(( proc_list * ));
static int printit __P(( char *, char * )); static void write_table __P(( definition * ));
static void printit __P(( char *, char * ));
void void
write_tables() write_tables()
@ -76,7 +77,7 @@ write_tables()
} }
} }
static static void
write_table(def) write_table(def)
definition *def; definition *def;
{ {
@ -143,7 +144,7 @@ write_table(def)
} }
} }
static static void
printit(prefix, type) printit(prefix, type)
char *prefix; char *prefix;
char *type; char *type;

View File

@ -38,7 +38,9 @@ static char sccsid[] = "@(#)rpc_util.c 1.11 89/02/22 (C) 1987 SMI";
* Copyright (C) 1989, Sun Microsystems, Inc. * Copyright (C) 1989, Sun Microsystems, Inc.
*/ */
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <ctype.h> #include <ctype.h>
#include <unistd.h>
#include "rpc_scan.h" #include "rpc_scan.h"
#include "rpc_parse.h" #include "rpc_parse.h"
#include "rpc_util.h" #include "rpc_util.h"
@ -60,11 +62,12 @@ FILE *fin; /* file pointer of current input */
list *defined; /* list of defined things */ list *defined; /* list of defined things */
static int printwhere __P(( void )); static void printwhere __P(( void ));
/* /*
* Reinitialize the world * Reinitialize the world
*/ */
void
reinitialize() reinitialize()
{ {
memset(curline, 0, MAXLINESIZE); memset(curline, 0, MAXLINESIZE);
@ -76,6 +79,7 @@ reinitialize()
/* /*
* string equality * string equality
*/ */
int
streq(a, b) streq(a, b)
char *a; char *a;
char *b; char *b;
@ -119,7 +123,7 @@ storeval(lstp, val)
*l = lst; *l = lst;
} }
static static int
findit(def, type) findit(def, type)
definition *def; definition *def;
char *type; char *type;
@ -192,7 +196,7 @@ ptype(prefix, type, follow)
} }
} }
static static int
typedefed(def, type) typedefed(def, type)
definition *def; definition *def;
char *type; char *type;
@ -204,6 +208,7 @@ typedefed(def, type)
} }
} }
int
isvectordef(type, rel) isvectordef(type, rel)
char *type; char *type;
relation rel; relation rel;
@ -227,6 +232,8 @@ isvectordef(type, rel)
rel = def->def.ty.rel; rel = def->def.ty.rel;
} }
} }
return (0);
} }
char * char *
@ -237,7 +244,7 @@ locase(str)
static char buf[100]; static char buf[100];
char *p = buf; char *p = buf;
while (c = *str++) { while ( (c = *str++) ) {
*p++ = (c >= 'A' && c <= 'Z') ? (c - 'A' + 'a') : c; *p++ = (c >= 'A' && c <= 'Z') ? (c - 'A' + 'a') : c;
} }
*p = 0; *p = 0;
@ -277,6 +284,7 @@ error(msg)
* Something went wrong, unlink any files that we may have created and then * Something went wrong, unlink any files that we may have created and then
* die. * die.
*/ */
void
crash() crash()
{ {
int i; int i;
@ -399,7 +407,7 @@ toktostr(kind)
return (sp->str); return (sp->str);
} }
static static void
printbuf() printbuf()
{ {
char c; char c;
@ -408,7 +416,7 @@ printbuf()
# define TABSIZE 4 # define TABSIZE 4
for (i = 0; c = curline[i]; i++) { for (i = 0; (c = curline[i]); i++) {
if (c == '\t') { if (c == '\t') {
cnt = 8 - (i % TABSIZE); cnt = 8 - (i % TABSIZE);
c = ' '; c = ' ';
@ -421,7 +429,7 @@ printbuf()
} }
} }
static static void
printwhere() printwhere()
{ {
int i; int i;
@ -462,6 +470,7 @@ make_argname(pname, vname)
bas_type *typ_list_h; bas_type *typ_list_h;
bas_type *typ_list_t; bas_type *typ_list_t;
void
add_type(len, type) add_type(len, type)
int len; int len;
char *type; char *type;

View File

@ -149,6 +149,10 @@ extern pid_t childpid;
/* /*
* rpc_util routines * rpc_util routines
*/ */
void reinitialize();
void crash();
void add_type(int len, char *type);
void storeval(); void storeval();
#define STOREVAL(list,item) \ #define STOREVAL(list,item) \

View File

@ -479,6 +479,7 @@ tdeferr(td, t)
} }
break; break;
/* LINTED (enumeration values not handled in switch) */ /* LINTED (enumeration values not handled in switch) */
default:
} }
/* Anything other is not accepted. */ /* Anything other is not accepted. */

View File

@ -43,6 +43,7 @@ static char rcsid[] = "$NetBSD: scan.l,v 1.8 1995/10/23 13:38:51 jpo Exp $";
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
#include <err.h> #include <err.h>
#include <math.h>
#include "lint1.h" #include "lint1.h"
#include "y.tab.h" #include "y.tab.h"
@ -554,6 +555,7 @@ icon(base)
} }
break; break;
/* LINTED (enumeration values not handled in switch) */ /* LINTED (enumeration values not handled in switch) */
default:
} }
if (typ != QUAD && typ != UQUAD) { if (typ != QUAD && typ != UQUAD) {

View File

@ -39,6 +39,7 @@ static char rcsid[] = "$NetBSD: tree.c,v 1.12 1995/10/02 17:37:57 jpo Exp $";
#include <string.h> #include <string.h>
#include <float.h> #include <float.h>
#include <limits.h> #include <limits.h>
#include <math.h>
#include "lint1.h" #include "lint1.h"
#include "y.tab.h" #include "y.tab.h"
@ -1132,6 +1133,7 @@ typeok(op, arg, ln, rn)
nulleff(ln); nulleff(ln);
break; break;
/* LINTED (enumeration values not handled in switch) */ /* LINTED (enumeration values not handled in switch) */
default:
} }
if (mp->m_badeop && if (mp->m_badeop &&
@ -3575,6 +3577,7 @@ chkmisc(tn, vctx, tctx, eqwarn, fcall, rvdisc, szof)
case STRING: case STRING:
return; return;
/* LINTED (enumeration values not handled in switch) */ /* LINTED (enumeration values not handled in switch) */
default:
} }
cvctx = mp->m_vctx; cvctx = mp->m_vctx;
@ -3913,6 +3916,7 @@ precconf(tn)
} }
break; break;
/* LINTED (enumeration values not handled in switch) */ /* LINTED (enumeration values not handled in switch) */
default:
} }
if (warn) { if (warn) {

View File

@ -613,6 +613,7 @@ inptype(cp, epp)
} }
break; break;
/* LINTED (enumeration value(s) not handled in switch) */ /* LINTED (enumeration value(s) not handled in switch) */
default:
} }
*epp = cp; *epp = cp;
@ -782,6 +783,7 @@ gettlen(cp, epp)
} }
break; break;
/* LINTED (enumeration value(s) not handled in switch) */ /* LINTED (enumeration value(s) not handled in switch) */
default:
} }
*epp = cp; *epp = cp;

View File

@ -517,6 +517,7 @@ main(argc, argv)
terminate(0); terminate(0);
/* NOTREACHED */ /* NOTREACHED */
return 0;
} }
/* /*