diff --git a/utils/Spiff/comment.c b/utils/Spiff/comment.c index f9a38275895..8f2e22d8275 100644 --- a/utils/Spiff/comment.c +++ b/utils/Spiff/comment.c @@ -187,6 +187,7 @@ char *str; return(W_BOLNULL); } +int W_is_bol(ptr) W_bol ptr; { @@ -234,6 +235,7 @@ char *str; return(W_LITNULL); } +int W_is_lit(ptr) W_lit ptr; { @@ -281,6 +283,7 @@ char *str; return(W_COMNULL); } +int W_is_com(ptr) W_com ptr; { @@ -300,6 +303,7 @@ W_com ptr; return(0); } +int W_is_nesting(ptr) W_com ptr; { diff --git a/utils/Spiff/comment.h b/utils/Spiff/comment.h index 01d84230213..60bb6ed35ad 100644 --- a/utils/Spiff/comment.h +++ b/utils/Spiff/comment.h @@ -66,6 +66,7 @@ extern W_com W_iscom(); extern int W_is_bol(); extern int W_is_lit(); extern int W_is_com(); +extern int W_is_nesting(); extern _W_bolstruct _W_bols[]; extern _W_litstruct _W_lits[]; diff --git a/utils/Spiff/compare.c b/utils/Spiff/compare.c index 90af24b3d8d..edcbfeef334 100644 --- a/utils/Spiff/compare.c +++ b/utils/Spiff/compare.c @@ -21,6 +21,11 @@ static char rcsid[]= "$Header$"; #include +static int _X_strcmp(); +static int _X_cmptokens(); +static int _X_floatdiff(); + +int X_com(a,b,flags) int a,b,flags; { diff --git a/utils/Spiff/exact.c b/utils/Spiff/exact.c index 3bcce5c6948..c09e9c7d52b 100644 --- a/utils/Spiff/exact.c +++ b/utils/Spiff/exact.c @@ -13,6 +13,8 @@ static char rcsid[]= "$Header$"; #include "misc.h" #include "edit.h" +#include "compare.h" +#include /* ** routine to compare each object with its ordinal twin diff --git a/utils/Spiff/float.c b/utils/Spiff/float.c index f6f9e87a0fe..b20efb70d69 100644 --- a/utils/Spiff/float.c +++ b/utils/Spiff/float.c @@ -11,6 +11,8 @@ static char rcsid[]= "$Header$"; #endif +#include +#include #include #include "misc.h" #include "floatrep.h" @@ -37,6 +39,7 @@ int floatcnt = 0; ** returns 0 if string can't be interpreted as a float ** otherwise returns the number of digits that will be used in F_atof */ +int F_isfloat(str,need_decimal,allow_sign) char *str; int need_decimal; /* if non-zero, require that a decimal point be present @@ -367,7 +370,7 @@ F_floatsub(p1,p2) F_float p1,p2; { static F_float result; - static needinit = 1; + static int needinit = 1; static char man1[R_MANMAX],man2[R_MANMAX],diff[R_MANMAX]; int exp1,exp2; char *diffptr,*big,*small; @@ -500,6 +503,7 @@ F_float p1,p2; return(result); } +int F_floatcmp(f1,f2) F_float f1,f2; { @@ -645,14 +649,18 @@ F_float f1,f2; return(result); } +int _F_xor(x,y) +int x, y; { return(((x) && !(y)) || (!(x) && (y))); } #define _F_SAMESIGN(x,y) _F_xor((x<0),(y<0)) #define _F_ABSADD(x,y) (Z_ABS(x) + Z_ABS(y)) +int _F_ABSDIFF(x,y) +int x, y; { if (Z_ABS(x) < Z_ABS(y)) { diff --git a/utils/Spiff/float.h b/utils/Spiff/float.h index 9a96255122d..82c24247676 100644 --- a/utils/Spiff/float.h +++ b/utils/Spiff/float.h @@ -27,6 +27,8 @@ extern F_float F_atof(); extern F_float F_floatmul(); extern F_float F_floatmagadd(); extern F_float F_floatsub(); +extern int F_floatcmp(); +extern int F_isfloat(); #define F_null ((F_float) 0) diff --git a/utils/Spiff/floatrep.c b/utils/Spiff/floatrep.c index 4847f477233..22fd78526fa 100644 --- a/utils/Spiff/floatrep.c +++ b/utils/Spiff/floatrep.c @@ -24,6 +24,7 @@ R_makefloat() return(retval); } +int R_getexp(ptr) R_float ptr; { diff --git a/utils/Spiff/line.c b/utils/Spiff/line.c index 947f1faa482..e358a1806c6 100644 --- a/utils/Spiff/line.c +++ b/utils/Spiff/line.c @@ -63,6 +63,7 @@ char *str; ** ** stores data and sets maximum counts */ +int L_init_file(fnumber,fname) int fnumber; char *fname; diff --git a/utils/Spiff/miller.c b/utils/Spiff/miller.c index 63c7660a7a7..ed83d640cb4 100644 --- a/utils/Spiff/miller.c +++ b/utils/Spiff/miller.c @@ -11,9 +11,11 @@ static char rcsid[]= "$Header$"; #endif +#include #include "misc.h" #include "token.h" #include "edit.h" +#include "compare.h" #define MAXT K_MAXTOKENS #define ORIGIN (max_obj/2) @@ -78,7 +80,7 @@ int comflags; for (k = lower; k<= upper; k+= 2) { new = E_edit_alloc(); - if (k == ORIGIN-d || k!= ORIGIN+d && last_d[k+1] >= last_d[k-1]) { + if (k == ORIGIN-d || (k!= ORIGIN+d && last_d[k+1] >= last_d[k-1])) { row = last_d[k+1]+1; E_setnext(new,script[k+1]); E_setop(new,E_DELETE); diff --git a/utils/Spiff/misc.c b/utils/Spiff/misc.c index 3bdf164f276..3c77673a9d8 100644 --- a/utils/Spiff/misc.c +++ b/utils/Spiff/misc.c @@ -15,6 +15,7 @@ static char rcsid[]= "$Header$"; #include "misc.h" #include "visual.h" #include "output.h" +#include /* ** various routines used throughout the program @@ -101,7 +102,7 @@ _Z_myalloc(k) int k; { int *tmp; - if (tmp = (int*) calloc((unsigned)k,(unsigned)1)) + if ((tmp = (int*) calloc((unsigned)k,(unsigned)1))) { return(tmp); } diff --git a/utils/Spiff/output.c b/utils/Spiff/output.c index 3db9044a05f..db157468d21 100644 --- a/utils/Spiff/output.c +++ b/utils/Spiff/output.c @@ -12,6 +12,8 @@ static char rcsid[]= "$Header$"; #endif #include +#include +#include #ifdef M_TERMINFO #include @@ -171,7 +173,7 @@ int start,end; ** convert a 0 origin token number to a 1 orgin token ** number or 1 origin line number as appropriate */ -static +static int _O_con_line(numb,flags,filenum) int numb, flags,filenum; { diff --git a/utils/Spiff/parse.c b/utils/Spiff/parse.c index 55722b701d5..1d2fd18480b 100644 --- a/utils/Spiff/parse.c +++ b/utils/Spiff/parse.c @@ -21,7 +21,6 @@ static char rcsid[]= "$Header$"; #include "comment.h" #include "parse.h" - #include #define _P_PARSE_CHATTER 1000 @@ -64,7 +63,7 @@ _P_alpha_clear() *_P_alpha = '\0'; } -static +static int _P_in_alpha(chr) char chr; { @@ -128,13 +127,13 @@ _P_initparser() } -static +static int _P_needmore() { return(*_P_nextchr == '\0'); } -static +static int _P_nextline() { /* @@ -370,7 +369,7 @@ W_bol bolptr; /* ** pass over a comment -- look for nexting */ -static +static int _P_comsnarf(comptr) W_com comptr; { @@ -640,9 +639,9 @@ _P_do_parse() /* ** see if this is a floating point number */ - else if (tmp = F_isfloat(_P_nextchr, + else if ((tmp = F_isfloat(_P_nextchr, _P_flags & U_NEED_DECIMAL, - _P_flags & U_INC_SIGN)) + _P_flags & U_INC_SIGN))) { K_saventext(newtoken,_P_nextchr,tmp); K_settype(newtoken,K_FLO_NUM); diff --git a/utils/Spiff/spiff.c b/utils/Spiff/spiff.c index eb0c7558870..9d547850c88 100644 --- a/utils/Spiff/spiff.c +++ b/utils/Spiff/spiff.c @@ -13,6 +13,7 @@ static char rcsid[]= "$Header$"; #include +#include #include "misc.h" #include "flagdefs.h" #include "parse.h" @@ -27,7 +28,10 @@ static char rcsid[]= "$Header$"; #include "visual.h" #include "output.h" -extern void _Y_doargs(); +extern int L_init_file(); +extern int V_visual(); + +static void _Y_doargs(); static int _Y_eflag = 0; /* use exact match algorithm */ static int _Y_vflag = 0; /* use visual mode */ @@ -38,6 +42,7 @@ static int _Y_vflag = 0; /* use visual mode */ */ static int _Y_flags; +int main(argc,argv) int argc; char *argv[]; diff --git a/utils/Spiff/strings.c b/utils/Spiff/strings.c index 07745635c67..ebd1427bc4d 100644 --- a/utils/Spiff/strings.c +++ b/utils/Spiff/strings.c @@ -142,6 +142,7 @@ char **to,*from; void S_savenstr(to,from,cnt) char **to,*from; +int cnt; { S_allocstr(to,cnt); (void) strncpy(*to,from,cnt); diff --git a/utils/Spiff/strings.h b/utils/Spiff/strings.h index b2656800470..95c341b6537 100644 --- a/utils/Spiff/strings.h +++ b/utils/Spiff/strings.h @@ -7,6 +7,7 @@ */ #ifndef S_INCLUDED +#include extern void S_wordcpy(); extern void S_skipword(); extern void S_skipspace(); diff --git a/utils/Spiff/tol.c b/utils/Spiff/tol.c index 6812355cc48..bc14778f256 100644 --- a/utils/Spiff/tol.c +++ b/utils/Spiff/tol.c @@ -11,6 +11,7 @@ static char rcsid[]= "$Header$"; #endif +#include #include "misc.h" #include "float.h" #include "tol.h" @@ -213,7 +214,9 @@ char *str; } } +int T_moretols(next_tol) +int next_tol; { return((next_tol >= 0) && (_T_TOLMAX-1 > next_tol) && diff --git a/utils/Spiff/tol.h b/utils/Spiff/tol.h index 87c291133a2..b03673afea7 100644 --- a/utils/Spiff/tol.h +++ b/utils/Spiff/tol.h @@ -35,6 +35,7 @@ extern void T_initdefault(); extern void T_setdef(); extern void T_tolline(); extern T_tol T_picktol(); +extern int T_moretols(); #define T_gettype(x) (x->tol_type) #define T_getfloat(x) (x->flo_tol) diff --git a/utils/Spiff/visual.c b/utils/Spiff/visual.c index 93fb38e4e08..121614b8a66 100644 --- a/utils/Spiff/visual.c +++ b/utils/Spiff/visual.c @@ -396,6 +396,7 @@ V_cleanup() ** dummy code for systems that don't have ** the mgr window manager installed */ +int V_visual(d) int d; {