summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--contrib/tcl/unix/tclUnixTime.c2
-rw-r--r--lib/libF77/abort_.c2
-rw-r--r--lib/libF77/ef1asc_.c4
-rw-r--r--lib/libF77/getenv_.c2
-rw-r--r--lib/libF77/main.c1
-rw-r--r--lib/libF77/s_rnge.c2
-rw-r--r--lib/libI77/dfe.c17
-rw-r--r--lib/libI77/due.c5
-rw-r--r--lib/libI77/endfile.c4
-rw-r--r--lib/libI77/err.c12
-rw-r--r--lib/libI77/fio.h6
-rw-r--r--lib/libI77/fmt.c22
-rw-r--r--lib/libI77/iio.c17
-rw-r--r--lib/libI77/inquire.c5
-rw-r--r--lib/libI77/lread.c26
-rw-r--r--lib/libI77/lwrite.c14
-rw-r--r--lib/libI77/open.c15
-rw-r--r--lib/libI77/rawio.h8
-rw-r--r--lib/libI77/rdfmt.c16
-rw-r--r--lib/libI77/rsfe.c9
-rw-r--r--lib/libI77/rsne.c48
-rw-r--r--lib/libI77/sfe.c4
-rw-r--r--lib/libI77/sue.c8
-rw-r--r--lib/libI77/uio.c5
-rw-r--r--lib/libI77/wref.c14
-rw-r--r--lib/libI77/wrtfmt.c14
-rw-r--r--lib/libI77/wsfe.c12
-rw-r--r--lib/libI77/wsle.c2
-rw-r--r--lib/libI77/wsne.c2
-rw-r--r--lib/libc/amd64/gen/isinf.c6
-rw-r--r--lib/libc/compat-43/creat.c1
-rw-r--r--lib/libc/compat-43/getwd.c2
-rw-r--r--lib/libc/compat-43/killpg.c1
-rw-r--r--lib/libc/compat-43/setpgrp.c1
-rw-r--r--lib/libc/compat-43/sigcompat.c4
-rw-r--r--lib/libc/db/btree/bt_open.c8
-rw-r--r--lib/libc/db/hash/hash.c2
-rw-r--r--lib/libc/db/hash/hash_bigkey.c2
-rw-r--r--lib/libc/gen/closedir.c2
-rw-r--r--lib/libc/gen/exec.c8
-rw-r--r--lib/libc/gen/fnmatch.c2
-rw-r--r--lib/libc/gen/fts-compat.c14
-rw-r--r--lib/libc/gen/fts.c14
-rw-r--r--lib/libc/gen/getcwd.c2
-rw-r--r--lib/libc/gen/getgrouplist.c2
-rw-r--r--lib/libc/gen/getnetgrent.c4
-rw-r--r--lib/libc/gen/getpass.c1
-rw-r--r--lib/libc/gen/getpwent.c10
-rw-r--r--lib/libc/gen/getttyent.c6
-rw-r--r--lib/libc/gen/initgroups.c1
-rw-r--r--lib/libc/gen/nlist.c2
-rw-r--r--lib/libc/gen/popen.c2
-rw-r--r--lib/libc/gen/pwcache.c2
-rw-r--r--lib/libc/gen/raise.c1
-rw-r--r--lib/libc/gen/rewinddir.c2
-rw-r--r--lib/libc/gen/seekdir.c2
-rw-r--r--lib/libc/gen/setproctitle.c3
-rw-r--r--lib/libc/gen/siginterrupt.c1
-rw-r--r--lib/libc/gen/sigsetops.c5
-rw-r--r--lib/libc/gen/syslog.c4
-rw-r--r--lib/libc/gen/timezone.c30
-rw-r--r--lib/libc/gen/ttyname.c4
-rw-r--r--lib/libc/gen/ttyslot.c6
-rw-r--r--lib/libc/gen/unvis.c2
-rw-r--r--lib/libc/gen/vis.c2
-rw-r--r--lib/libc/i386/gen/isinf.c6
-rw-r--r--lib/libc/net/ether_addr.c15
-rw-r--r--lib/libc/net/gethostbydns.c6
-rw-r--r--lib/libc/net/gethostbyht.c10
-rw-r--r--lib/libc/net/gethostbynis.c5
-rw-r--r--lib/libc/net/gethostnamadr.c9
-rw-r--r--lib/libc/net/getnetbydns.c3
-rw-r--r--lib/libc/net/getnetbyht.c4
-rw-r--r--lib/libc/net/getnetnamadr.c11
-rw-r--r--lib/libc/net/getproto.c2
-rw-r--r--lib/libc/net/getprotoname.c2
-rw-r--r--lib/libc/net/getservbyname.c2
-rw-r--r--lib/libc/net/getservbyport.c2
-rw-r--r--lib/libc/net/getservent.c2
-rw-r--r--lib/libc/net/inet_network.c2
-rw-r--r--lib/libc/net/rcmd.c2
-rw-r--r--lib/libc/net/res_comp.c6
-rw-r--r--lib/libc/net/res_debug.c10
-rw-r--r--lib/libc/net/res_send.c4
-rw-r--r--lib/libc/nls/msgcat.c6
-rw-r--r--lib/libc/nls/msgcat.h4
-rw-r--r--lib/libc/regex/cclass.h44
-rw-r--r--lib/libc/regex/cname.h192
-rw-r--r--lib/libc/regex/engine.c4
-rw-r--r--lib/libc/regex/regcomp.c60
-rw-r--r--lib/libc/regex/regerror.c34
-rw-r--r--lib/libc/stdlib/atoi.c1
-rw-r--r--lib/libc/stdlib/calloc.c2
-rw-r--r--lib/libc/stdlib/getsubopt.c1
-rw-r--r--lib/libc/stdlib/setenv.c5
-rw-r--r--lib/libc/stdlib/strtod.c62
-rw-r--r--lib/libc/stdlib/strtol.c2
-rw-r--r--lib/libc/stdlib/strtoll.c2
-rw-r--r--lib/libc/stdlib/strtoq.c2
-rw-r--r--lib/libc/stdlib/strtoul.c2
-rw-r--r--lib/libc/stdlib/strtoull.c2
-rw-r--r--lib/libc/stdlib/strtouq.c2
-rw-r--r--lib/libc/stdtime/strftime.c3
-rw-r--r--lib/libc/string/strcoll.c6
-rw-r--r--lib/libc/yp/yplib.c4
-rw-r--r--lib/libcom_err/error_message.c7
-rw-r--r--lib/libcompat/4.1/ftime.32
-rw-r--r--lib/libcompat/4.1/ftime.c3
-rw-r--r--lib/libcompat/4.3/cfree.c2
-rw-r--r--lib/libcompat/4.3/insque.c1
-rw-r--r--lib/libcompat/4.3/lsearch.c1
-rw-r--r--lib/libcompat/4.3/remque.c1
-rw-r--r--lib/libcompat/4.3/rexec.c1
-rw-r--r--lib/libcrypt/crypt.c5
-rw-r--r--lib/libcurses/cr_put.c2
-rw-r--r--lib/libcurses/cur_hash.c2
-rw-r--r--lib/libcurses/refresh.c4
-rw-r--r--lib/libcurses/setterm.c6
-rw-r--r--lib/libedit/term.c1
-rw-r--r--lib/libipx/ipx_addr.c2
-rw-r--r--lib/libkvm/kvm_amd64.c1
-rw-r--r--lib/libkvm/kvm_file.c2
-rw-r--r--lib/libkvm/kvm_getloadavg.c1
-rw-r--r--lib/libkvm/kvm_i386.c1
-rw-r--r--lib/libkvm/kvm_proc.c10
-rw-r--r--lib/libpcap/inet.c4
-rw-r--r--lib/libpcap/nametoaddr.c3
-rw-r--r--lib/libpcap/optimize.c3
-rw-r--r--lib/libpcap/pcap-bpf.c4
-rw-r--r--lib/libpcap/pcap.c3
-rw-r--r--lib/libskey/skey.h5
-rw-r--r--lib/libskey/skeyaccess.c8
-rw-r--r--lib/libskey/skeylogin.c8
-rw-r--r--lib/libskey/skeysubr.c1
-rw-r--r--lib/libss/data.c2
-rw-r--r--lib/libss/error.c3
-rw-r--r--lib/libss/execute_cmd.c2
-rw-r--r--lib/libss/help.c2
-rw-r--r--lib/libss/invocation.c2
-rw-r--r--lib/libss/list_rqs.c1
-rw-r--r--lib/libss/listen.c5
-rw-r--r--lib/libss/pager.c1
-rw-r--r--lib/libss/parse.c1
-rw-r--r--lib/libss/prompt.c1
-rw-r--r--lib/libss/request_tbl.c3
-rw-r--r--lib/libss/requests.c4
-rw-r--r--lib/libss/ss_internal.h2
-rw-r--r--lib/libtelnet/genget.c1
-rw-r--r--lib/libtelnet/getent.c3
-rw-r--r--lib/libtelnet/misc.c2
-rw-r--r--lib/libtermcap/termcap.32
-rw-r--r--lib/libtermcap/termcap.c4
-rw-r--r--lib/libtermcap/termcap.h4
-rw-r--r--lib/libtermcap/tgoto.c3
-rw-r--r--lib/libtermcap/tputs.c1
-rw-r--r--lib/libutil/pty.c1
-rw-r--r--lib/libutil/setproctitle.c3
-rw-r--r--lib/liby/main.c3
-rw-r--r--lib/liby/yyerror.c1
-rw-r--r--lib/msun/src/e_asin.c4
-rw-r--r--lib/msun/src/e_asinf.c4
-rw-r--r--lib/msun/src/e_atan2.c4
-rw-r--r--lib/msun/src/e_cosh.c4
-rw-r--r--lib/msun/src/e_exp.c6
-rw-r--r--lib/msun/src/e_expf.c6
-rw-r--r--lib/msun/src/e_sinh.c4
-rw-r--r--sys/libkern/fnmatch.c2
167 files changed, 675 insertions, 512 deletions
diff --git a/contrib/tcl/unix/tclUnixTime.c b/contrib/tcl/unix/tclUnixTime.c
index 96d29bf..80328af 100644
--- a/contrib/tcl/unix/tclUnixTime.c
+++ b/contrib/tcl/unix/tclUnixTime.c
@@ -126,7 +126,7 @@ TclGetTimeZone (currentTime)
#if defined(HAVE_TM_GMTOFF) && !defined (TCL_GOT_TIMEZONE)
# define TCL_GOT_TIMEZONE
time_t curTime = (time_t) currentTime;
- struct tm *timeDataPtr = localtime(&currentTime);
+ struct tm *timeDataPtr = localtime(&curTime);
int timeZone;
timeZone = -(timeDataPtr->tm_gmtoff / 60);
diff --git a/lib/libF77/abort_.c b/lib/libF77/abort_.c
index 9d4a056..96b960d 100644
--- a/lib/libF77/abort_.c
+++ b/lib/libF77/abort_.c
@@ -12,7 +12,5 @@ int abort_(void)
#endif
{
sig_die("Fortran abort routine called", 1);
-#ifdef __cplusplus
return 0;
-#endif
}
diff --git a/lib/libF77/ef1asc_.c b/lib/libF77/ef1asc_.c
index b2b8d72..78993b8 100644
--- a/lib/libF77/ef1asc_.c
+++ b/lib/libF77/ef1asc_.c
@@ -8,14 +8,12 @@
#ifdef KR_headers
extern VOID s_copy();
-ef1asc_(a, la, b, lb) ftnint *a, *b; ftnlen *la, *lb;
+int ef1asc_(a, la, b, lb) ftnint *a, *b; ftnlen *la, *lb;
#else
extern void s_copy(char*,char*,ftnlen,ftnlen);
int ef1asc_(ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb)
#endif
{
s_copy( (char *)a, (char *)b, EVEN(*la), *lb );
-#ifdef __cplusplus
return 0;
-#endif
}
diff --git a/lib/libF77/getenv_.c b/lib/libF77/getenv_.c
index 2a035ea..7ba2de5 100644
--- a/lib/libF77/getenv_.c
+++ b/lib/libF77/getenv_.c
@@ -30,7 +30,7 @@ for(fp = fname ; fp < flast ; ++fp)
break;
}
-while (ep = *env++)
+while ( (ep = *env++) )
{
for(fp = fname; fp<flast ; )
if(*fp++ != *ep++)
diff --git a/lib/libF77/main.c b/lib/libF77/main.c
index 79f1943..7c1127c 100644
--- a/lib/libF77/main.c
+++ b/lib/libF77/main.c
@@ -90,6 +90,7 @@ sig_die("Trace trap", 1);
int xargc;
char **xargv;
+int
#ifdef KR_headers
main(argc, argv) int argc; char **argv;
#else
diff --git a/lib/libF77/s_rnge.c b/lib/libF77/s_rnge.c
index b200fce..fc7f0b6 100644
--- a/lib/libF77/s_rnge.c
+++ b/lib/libF77/s_rnge.c
@@ -20,7 +20,5 @@ fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ", offset+1
while((i = *varn) && i != ' ')
putc(*varn++, stderr);
sig_die(".", 1);
-#ifdef __cplusplus
return 0;
-#endif
}
diff --git a/lib/libI77/dfe.c b/lib/libI77/dfe.c
index 86fbe8e..1135ffd 100644
--- a/lib/libI77/dfe.c
+++ b/lib/libI77/dfe.c
@@ -2,6 +2,7 @@
#include "fio.h"
#include "fmt.h"
+int
y_rsk(Void)
{
if(f__curunit->uend || f__curunit->url <= f__recpos
@@ -11,6 +12,8 @@ y_rsk(Void)
} while(++f__recpos < f__curunit->url);
return 0;
}
+
+int
y_getc(Void)
{
int ch;
@@ -30,10 +33,10 @@ y_getc(Void)
return(-1);
}
err(f__elist->cierr,errno,"readingd");
-#ifdef __cplusplus
return 0;
-#endif
}
+
+int
#ifdef KR_headers
y_putc(c)
#else
@@ -47,6 +50,8 @@ y_putc(int c)
err(f__elist->cierr,110,"dout");
return(0);
}
+
+int
y_rev(Void)
{ /*what about work done?*/
if(f__curunit->url==1 || f__recpos==f__curunit->url)
@@ -56,6 +61,8 @@ y_rev(Void)
f__recpos=0;
return(0);
}
+
+int
y_err(Void)
{
err(f__elist->cierr, 110, "dfe");
@@ -64,6 +71,7 @@ y_err(Void)
#endif
}
+int
y_newrec(Void)
{
if(f__curunit->url == 1 || f__recpos == f__curunit->url) {
@@ -77,6 +85,7 @@ y_newrec(Void)
return(1);
}
+int
#ifdef KR_headers
c_dfe(a) cilist *a;
#else
@@ -108,7 +117,7 @@ integer s_rdfe(cilist *a)
{
int n;
if(!f__init) f_init();
- if(n=c_dfe(a))return(n);
+ if( (n=c_dfe(a)) )return(n);
f__reading=1;
if(f__curunit->uwrt && f__nowreading(f__curunit))
err(a->cierr,errno,"read start");
@@ -130,7 +139,7 @@ integer s_wdfe(cilist *a)
{
int n;
if(!f__init) f_init();
- if(n=c_dfe(a)) return(n);
+ if( (n=c_dfe(a)) ) return(n);
f__reading=0;
if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
err(a->cierr,errno,"startwrt");
diff --git a/lib/libI77/due.c b/lib/libI77/due.c
index d5ade7a..ff9ce55 100644
--- a/lib/libI77/due.c
+++ b/lib/libI77/due.c
@@ -1,6 +1,7 @@
#include "f2c.h"
#include "fio.h"
+int
#ifdef KR_headers
c_due(a) cilist *a;
#else
@@ -30,7 +31,7 @@ integer s_rdue(cilist *a)
#endif
{
int n;
- if(n=c_due(a)) return(n);
+ if( (n=c_due(a)) ) return(n);
f__reading=1;
if(f__curunit->uwrt && f__nowreading(f__curunit))
err(a->cierr,errno,"read start");
@@ -43,7 +44,7 @@ integer s_wdue(cilist *a)
#endif
{
int n;
- if(n=c_due(a)) return(n);
+ if( (n=c_due(a)) ) return(n);
f__reading=0;
if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
err(a->cierr,errno,"write start");
diff --git a/lib/libI77/endfile.c b/lib/libI77/endfile.c
index f5990e3..8425a29 100644
--- a/lib/libI77/endfile.c
+++ b/lib/libI77/endfile.c
@@ -43,7 +43,7 @@ integer f_end(alist *a)
(void) sprintf(nbuf,"fort.%ld",a->aunit);
#ifdef NON_UNIX_STDIO
{ FILE *tf;
- if (tf = fopen(nbuf, f__w_mode[0]))
+ if ( (tf = fopen(nbuf, f__w_mode[0])) )
fclose(tf);
}
#else
@@ -63,7 +63,7 @@ copy(from, len, to) char *from, *to; register long len;
copy(FILE *from, register long len, FILE *to)
#endif
{
- int k, len1;
+ int len1;
char buf[BUFSIZ];
while(fread(buf, len1 = len > BUFSIZ ? BUFSIZ : (int)len, 1, from)) {
diff --git a/lib/libI77/err.c b/lib/libI77/err.c
index 0777159..923a667 100644
--- a/lib/libI77/err.c
+++ b/lib/libI77/err.c
@@ -78,9 +78,9 @@ char *F_err[] =
#define MAXERR (sizeof(F_err)/sizeof(char *)+100)
#ifdef KR_headers
-f__canseek(f) FILE *f; /*SYSDEP*/
+int f__canseek(f) FILE *f; /*SYSDEP*/
#else
-f__canseek(FILE *f) /*SYSDEP*/
+int f__canseek(FILE *f) /*SYSDEP*/
#endif
{
#ifdef NON_UNIX_STDIO
@@ -187,9 +187,9 @@ f_init(Void)
p->uwrt=1;
}
#ifdef KR_headers
-f__nowreading(x) unit *x;
+int f__nowreading(x) unit *x;
#else
-f__nowreading(unit *x)
+int f__nowreading(unit *x)
#endif
{
long loc;
@@ -210,9 +210,9 @@ f__nowreading(unit *x)
return(0);
}
#ifdef KR_headers
-f__nowwriting(x) unit *x;
+int f__nowwriting(x) unit *x;
#else
-f__nowwriting(unit *x)
+int f__nowwriting(unit *x)
#endif
{
long loc;
diff --git a/lib/libI77/fio.h b/lib/libI77/fio.h
index e8c693b..17e5593 100644
--- a/lib/libI77/fio.h
+++ b/lib/libI77/fio.h
@@ -80,8 +80,8 @@ extern int (*f__doend)(Void);
extern FILE *f__cf; /*current file*/
extern unit *f__curunit; /*current unit*/
extern unit f__units[];
-#define err(f,m,s) {if(f) errno= m; else f__fatal(m,s); return(m);}
-#define errfl(f,m,s) return err__fl((int)f,m,s)
+#define err(f,m,s) {if( (f) ) errno=(m); else f__fatal((m),(s)); return((m));}
+#define errfl(f,m,s) return err__fl((int)(f),(m),(s))
/*Table sizes*/
#define MXUNIT 100
@@ -99,4 +99,4 @@ extern int f__hiwater; /* so TL doesn't confuse us */
#define EXT 7
#define INT 8
-#define buf_end(x) (x->_flag & _IONBF ? x->_ptr : x->_base + BUFSIZ)
+#define buf_end(x) ((x)->_flag & _IONBF ? (x)->_ptr : (x)->_base + BUFSIZ)
diff --git a/lib/libI77/fmt.c b/lib/libI77/fmt.c
index 12792fc..8689ef5 100644
--- a/lib/libI77/fmt.c
+++ b/lib/libI77/fmt.c
@@ -40,9 +40,9 @@ char *ap_end(char *s)
/*NOTREACHED*/ return 0;
}
#ifdef KR_headers
-op_gen(a,b,c,d)
+int op_gen(a,b,c,d)
#else
-op_gen(int a, int b, int c, int d)
+int op_gen(int a, int b, int c, int d)
#endif
{ struct syl *p= &f__syl[f__pc];
if(f__pc>=SYLMX)
@@ -99,9 +99,9 @@ char *f_s(char *s, int curloc)
return(s);
}
#ifdef KR_headers
-ne_d(s,p) char *s,**p;
+int ne_d(s,p) char *s,**p;
#else
-ne_d(char *s, char **p)
+int ne_d(char *s, char **p)
#endif
{ int n,x,sign=0;
struct syl *sp;
@@ -185,9 +185,9 @@ ne_d(char *s, char **p)
return(1);
}
#ifdef KR_headers
-e_d(s,p) char *s,**p;
+int e_d(s,p) char *s,**p;
#else
-e_d(char *s, char **p)
+int e_d(char *s, char **p)
#endif
{ int i,im,n,w,d,e,found=0,x=0;
char *sv=s;
@@ -333,9 +333,9 @@ char *f_list(char *s)
}
#ifdef KR_headers
-pars_f(s) char *s;
+int pars_f(s) char *s;
#else
-pars_f(char *s)
+int pars_f(char *s)
#endif
{
f__parenlvl=f__revloc=f__pc=0;
@@ -350,9 +350,9 @@ int f__cnt[STKSZ],f__ret[STKSZ],f__cp,f__rp;
flag f__workdone, f__nonl;
#ifdef KR_headers
-type_f(n)
+int type_f(n)
#else
-type_f(int n)
+int type_f(int n)
#endif
{
switch(n)
@@ -476,6 +476,8 @@ loop: switch(type_f((p= &f__syl[f__pc])->op))
}
return(0);
}
+
+int
en_fio(Void)
{ ftnint one=1;
return(do_fio(&one,(char *)NULL,(ftnint)0));
diff --git a/lib/libI77/iio.c b/lib/libI77/iio.c
index 4c8eb9d..dff9e3f 100644
--- a/lib/libI77/iio.c
+++ b/lib/libI77/iio.c
@@ -6,6 +6,8 @@ char *f__icend;
extern icilist *f__svic;
int f__icnum;
extern int f__hiwater;
+
+int
z_getc(Void)
{
if(f__recpos++ < f__svic->icirlen) {
@@ -15,9 +17,9 @@ z_getc(Void)
return '\n';
}
#ifdef KR_headers
-z_putc(c)
+int z_putc(c)
#else
-z_putc(int c)
+int z_putc(int c)
#endif
{
if(f__icptr >= f__icend) err(f__svic->icierr,110,"inwrite");
@@ -26,6 +28,8 @@ z_putc(int c)
else err(f__svic->icierr,110,"recend");
return 0;
}
+
+int
z_rnew(Void)
{
f__icptr = f__svic->iciunit + (++f__icnum)*f__svic->icirlen;
@@ -43,9 +47,9 @@ z_endp(Void)
}
#ifdef KR_headers
-c_si(a) icilist *a;
+int c_si(a) icilist *a;
#else
-c_si(icilist *a)
+int c_si(icilist *a)
#endif
{
f__elist = (cilist *)a;
@@ -82,7 +86,7 @@ integer s_rsfi(a) icilist *a;
integer s_rsfi(icilist *a)
#endif
{ int n;
- if(n=c_si(a)) return(n);
+ if( (n=c_si(a)) ) return(n);
f__reading=1;
f__doed=rd_ed;
f__doned=rd_ned;
@@ -93,6 +97,7 @@ integer s_rsfi(icilist *a)
return(0);
}
+int
z_wnew(Void)
{
if (f__recpos < f__hiwater) {
@@ -113,7 +118,7 @@ integer s_wsfi(a) icilist *a;
integer s_wsfi(icilist *a)
#endif
{ int n;
- if(n=c_si(a)) return(n);
+ if( (n=c_si(a)) ) return(n);
f__reading=0;
f__doed=w_ed;
f__doned=w_ned;
diff --git a/lib/libI77/inquire.c b/lib/libI77/inquire.c
index ec98b22..c28e367 100644
--- a/lib/libI77/inquire.c
+++ b/lib/libI77/inquire.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
#include "f2c.h"
#include "fio.h"
#ifdef KR_headers
@@ -53,7 +54,7 @@ integer f_inqu(inlist *a)
}
}
if(a->inex!=NULL)
- if(byfile && x != -1 || !byfile && p!=NULL)
+ if((byfile && x != -1) || (!byfile && p!=NULL))
*a->inex=1;
else *a->inex=0;
if(a->inopen!=NULL)
@@ -61,7 +62,7 @@ integer f_inqu(inlist *a)
else *a->inopen=(p!=NULL && p->ufd!=NULL);
if(a->innum!=NULL) *a->innum= p-f__units;
if(a->innamed!=NULL)
- if(byfile || p!=NULL && p->ufnm!=NULL)
+ if(byfile || (p!=NULL && p->ufnm!=NULL))
*a->innamed=1;
else *a->innamed=0;
if(a->inname!=NULL)
diff --git a/lib/libI77/lread.c b/lib/libI77/lread.c
index c14fd5b..74f6f49 100644
--- a/lib/libI77/lread.c
+++ b/lib/libI77/lread.c
@@ -67,6 +67,7 @@ extern int ungetc(int, FILE*); /* for systems with a buggy stdio.h */
#endif
#endif
+int
t_getc(Void)
{ int ch;
if(f__curunit->uend) return(EOF);
@@ -87,14 +88,14 @@ flag f__lquit;
int f__lcount,f__ltype,nml_read;
char *f__lchar;
double f__lx,f__ly;
-#define ERR(x) if(n=(x)) return(n)
+#define ERR(x) if( (n=(x)) ) return(n)
#define GETC(x) (x=(*l_getc)())
#define Ungetc(x,y) (*l_ungetc)(x,y)
#ifdef KR_headers
-l_R(poststar) int poststar;
+int l_R(poststar) int poststar;
#else
-l_R(int poststar)
+int l_R(int poststar)
#endif
{
char s[FMAX+EXPMAXDIGS+4];
@@ -249,6 +250,7 @@ rd_count(register int ch)
return f__lcount <= 0;
}
+int
l_C(Void)
{ int ch, nml_save;
double lz;
@@ -285,7 +287,7 @@ l_C(Void)
Ungetc(ch,f__cf);
nml_save = nml_read;
nml_read = 0;
- if (ch = l_R(1))
+ if ( (ch = l_R(1)) )
return ch;
if (!f__ltype)
errfl(f__elist->cierr,112,"no real part");
@@ -297,7 +299,7 @@ l_C(Void)
}
while(iswhit(GETC(ch)));
(void) Ungetc(ch,f__cf);
- if (ch = l_R(1))
+ if ( (ch = l_R(1)) )
return ch;
if (!f__ltype)
errfl(f__elist->cierr,112,"no imaginary part");
@@ -311,6 +313,8 @@ l_C(Void)
nml_read = nml_save;
return(0);
}
+
+int
l_L(Void)
{
int ch;
@@ -357,6 +361,8 @@ l_L(Void)
return(0);
}
#define BUFSIZE 128
+
+int
l_CHAR(Void)
{ int ch,size,i;
static char rafail[] = "realloc failure";
@@ -479,9 +485,9 @@ l_CHAR(Void)
}
}
#ifdef KR_headers
-c_le(a) cilist *a;
+int c_le(a) cilist *a;
#else
-c_le(cilist *a)
+int c_le(cilist *a)
#endif
{
if(!f__init)
@@ -499,9 +505,9 @@ c_le(cilist *a)
return(0);
}
#ifdef KR_headers
-l_read(number,ptr,len,type) ftnint *number,type; char *ptr; ftnlen len;
+int l_read(number,ptr,len,type) ftnint *number,type; char *ptr; ftnlen len;
#else
-l_read(ftnint *number, char *ptr, ftnlen len, ftnint type)
+int l_read(ftnint *number, char *ptr, ftnlen len, ftnint type)
#endif
{
#define Ptr ((flex *)ptr)
@@ -639,7 +645,7 @@ integer s_rsle(cilist *a)
{
int n;
- if(n=c_le(a)) return(n);
+ if( (n=c_le(a)) ) return(n);
f__reading=1;
f__external=1;
f__formatted=1;
diff --git a/lib/libI77/lwrite.c b/lib/libI77/lwrite.c
index 5da7dfb..0d323ec 100644
--- a/lib/libI77/lwrite.c
+++ b/lib/libI77/lwrite.c
@@ -14,9 +14,9 @@ donewrec(Void)
}
#ifdef KR_headers
-t_putc(c)
+int t_putc(c)
#else
-t_putc(int c)
+int t_putc(int c)
#endif
{
f__recpos++;
@@ -141,7 +141,7 @@ l_g(char *buf, double n)
switch(*b) {
#ifndef WANT_LEAD_0
case '0':
- while(b[0] = b[1])
+ while( (b[0] = b[1]) )
b++;
break;
#endif
@@ -166,7 +166,7 @@ l_g(char *buf, double n)
while(*++b);
goto f__ret;
case 'E':
- for(c1 = '.', c = 'E'; *b = c1;
+ for(c1 = '.', c = 'E'; (*b = c1);
c1 = c, c = *++b);
goto f__ret;
}
@@ -188,7 +188,7 @@ l_put(register char *s)
#else
register int c, (*pn)(int) = f__putn;
#endif
- while(c = *s++)
+ while( (c = *s++) )
(*pn)(c);
}
@@ -240,9 +240,9 @@ lwrt_C(double a, double b)
PUT(')');
}
#ifdef KR_headers
-l_write(number,ptr,len,type) ftnint *number,type; char *ptr; ftnlen len;
+int l_write(number,ptr,len,type) ftnint *number,type; char *ptr; ftnlen len;
#else
-l_write(ftnint *number, char *ptr, ftnlen len, ftnint type)
+int l_write(ftnint *number, char *ptr, ftnlen len, ftnint type)
#endif
{
#define Ptr ((flex *)ptr)
diff --git a/lib/libI77/open.c b/lib/libI77/open.c
index 75386b9..beb525e 100644
--- a/lib/libI77/open.c
+++ b/lib/libI77/open.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
#ifndef NON_UNIX_STDIO
#include "sys/types.h"
#include "sys/stat.h"
@@ -28,9 +29,9 @@ char *f__w_mode[4] = {"wb", "w", "r+b", "r+"};
#endif
#ifdef KR_headers
-f__isdev(s) char *s;
+int f__isdev(s) char *s;
#else
-f__isdev(char *s)
+int f__isdev(char *s)
#endif
{
#ifdef NON_UNIX_STDIO
@@ -164,7 +165,7 @@ integer f_open(olist *a)
case 'R':
replace:
#ifdef NON_UNIX_STDIO
- if (tf = fopen(buf,f__w_mode[0]))
+ if ( (tf = fopen(buf,f__w_mode[0])) )
fclose(tf);
#else
(void) close(creat(buf, 0666));
@@ -187,9 +188,9 @@ integer f_open(olist *a)
else {
if(!(b->ufd = fopen(buf, f__r_mode[ufmt]))) {
#ifdef NON_UNIX_STDIO
- if (b->ufd = fopen(buf, f__w_mode[ufmt|2]))
+ if ( (b->ufd = fopen(buf, f__w_mode[ufmt|2])) )
b->uwrt = 2;
- else if (b->ufd = fopen(buf, f__w_mode[ufmt]))
+ else if ( (b->ufd = fopen(buf, f__w_mode[ufmt])) )
b->uwrt = 1;
else
#else
@@ -219,9 +220,9 @@ integer f_open(olist *a)
return(0);
}
#ifdef KR_headers
-fk_open(seq,fmt,n) ftnint n;
+int fk_open(seq,fmt,n) ftnint n;
#else
-fk_open(int seq, int fmt, ftnint n)
+int fk_open(int seq, int fmt, ftnint n)
#endif
{ char nbuf[10];
olist a;
diff --git a/lib/libI77/rawio.h b/lib/libI77/rawio.h
index 59181d7..3e2c750 100644
--- a/lib/libI77/rawio.h
+++ b/lib/libI77/rawio.h
@@ -1,5 +1,7 @@
#ifdef KR_headers
+#ifndef __FreeBSD__
extern FILE *fdopen();
+#endif
#else
#ifdef MSDOS
#include "io.h"
@@ -14,17 +16,23 @@ extern "C" {
#endif
#ifndef MSDOS
#ifdef OPEN_DECL
+#ifndef __FreeBSD__
extern int creat(const char*,int), open(const char*,int);
#endif
+#endif
+#ifndef __FreeBSD__
extern int close(int);
extern int read(int,void*,size_t), write(int,void*,size_t);
extern int unlink(const char*);
+#endif
#ifndef _POSIX_SOURCE
#ifndef NON_UNIX_STDIO
+#ifndef __FreeBSD__
extern FILE *fdopen(int, const char*);
#endif
#endif
#endif
+#endif
extern char *mktemp(char*);
diff --git a/lib/libI77/rdfmt.c b/lib/libI77/rdfmt.c
index eef745b..3878dd9 100644
--- a/lib/libI77/rdfmt.c
+++ b/lib/libI77/rdfmt.c
@@ -29,10 +29,10 @@ rd_Z(Uint *n, int w, ftnlen len)
if (!hex['0']) {
s = "0123456789";
- while(ch = *s++)
+ while( (ch = *s++) )
hex[ch] = ch - '0' + 1;
s = "ABCDEF";
- while(ch = *s++)
+ while( (ch = *s++) )
hex[ch] = hex[ch + 'a' - 'A'] = ch - 'A' + 11;
}
s = s0 = (char *)x;
@@ -61,7 +61,7 @@ rd_Z(Uint *n, int w, ftnlen len)
return errno = 115;
w = (int)len;
w1 = s - s0;
- w2 = w1+1 >> 1;
+ w2 = (w1+1) >> 1;
t = (char *)n;
if (*(char *)&one) {
/* little endian */
@@ -83,7 +83,7 @@ rd_Z(Uint *n, int w, ftnlen len)
t += i;
}
do {
- *t = hex[*s0 & 0xff]-1 << 4 | hex[s0[1] & 0xff]-1;
+ *t = ((hex[*s0 & 0xff]-1) << 4) | (hex[s0[1] & 0xff]-1);
t += i;
s0 += 2;
}
@@ -387,9 +387,9 @@ rd_POS(char *s)
return(1);
}
#ifdef KR_headers
-rd_ed(p,ptr,len) struct syl *p; char *ptr; ftnlen len;
+int rd_ed(p,ptr,len) struct syl *p; char *ptr; ftnlen len;
#else
-rd_ed(struct syl *p, char *ptr, ftnlen len)
+int rd_ed(struct syl *p, char *ptr, ftnlen len)
#endif
{ int ch;
for(;f__cursor>0;f__cursor--) if((ch=(*f__getn)())<0) return(ch);
@@ -450,9 +450,9 @@ rd_ed(struct syl *p, char *ptr, ftnlen len)
return(errno);
}
#ifdef KR_headers
-rd_ned(p) struct syl *p;
+int rd_ned(p) struct syl *p;
#else
-rd_ned(struct syl *p)
+int rd_ned(struct syl *p)
#endif
{
switch(p->op)
diff --git a/lib/libI77/rsfe.c b/lib/libI77/rsfe.c
index 5ff0a33..24ecafc 100644
--- a/lib/libI77/rsfe.c
+++ b/lib/libI77/rsfe.c
@@ -3,6 +3,7 @@
#include "fio.h"
#include "fmt.h"
+int
xrd_SL(Void)
{ int ch;
if(!f__curunit->uend)
@@ -14,6 +15,8 @@ xrd_SL(Void)
f__cursor=f__recpos=0;
return(1);
}
+
+int
x_getc(Void)
{ int ch;
if(f__curunit->uend) return(EOF);
@@ -33,11 +36,15 @@ x_getc(Void)
}
return(-1);
}
+
+int
x_endp(Void)
{
(void) xrd_SL();
return(0);
}
+
+int
x_rev(Void)
{
(void) xrd_SL();
@@ -50,7 +57,7 @@ integer s_rsfe(cilist *a) /* start */
#endif
{ int n;
if(!f__init) f_init();
- if(n=c_sfe(a)) return(n);
+ if( (n=c_sfe(a)) ) return(n);
f__reading=1;
f__sequential=1;
f__formatted=1;
diff --git a/lib/libI77/rsne.c b/lib/libI77/rsne.c
index ad7ad26..9378717 100644
--- a/lib/libI77/rsne.c
+++ b/lib/libI77/rsne.c
@@ -78,7 +78,7 @@ hash(hashtab *ht, register char *s)
register hashentry *h;
char *s0 = s;
- for(x = 0; c = *s++; x = x & 0x4000 ? ((x << 1) & 0x7fff) + 1 : x << 1)
+ for(x = 0; (c = *s++); x = x & 0x4000 ? ((x << 1) & 0x7fff) + 1 : x << 1)
x += c;
for(h = *(zot = ht->tab + x % ht->htsize); h; h = h->next)
if (!strcmp(s0, h->name))
@@ -99,7 +99,7 @@ mk_hashtab(Namelist *nl)
hashentry *he;
hashtab **x, **x0, *y;
- for(x = &nl_cache; y = *x; x0 = x, x = &y->next)
+ for(x = &nl_cache; (y = *x); x0 = x, x = &y->next)
if (nl == y->nl)
return y;
if (n_nlcache >= MAX_NL_CACHE) {
@@ -151,13 +151,13 @@ nl_init(Void) {
if(!f__init)
f_init();
- for(s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; c = *s++; )
+ for(s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; (c = *s++); )
Alpha[c]
= Alphanum[c]
= Alpha[c + 'a' - 'A']
= Alphanum[c + 'a' - 'A']
= c;
- for(s = "0123456789_"; c = *s++; )
+ for(s = "0123456789_"; (c = *s++); )
Alphanum[c] = c;
}
@@ -180,7 +180,7 @@ getname(register char *s, int slen)
ch = 115;
errfl(f__elist->cierr, ch, "namelist read");
}
- while(*s = Alphanum[GETC(ch) & 0xff])
+ while( (*s = Alphanum[GETC(ch) & 0xff]) )
if (s < se)
s++;
if (ch == EOF)
@@ -235,15 +235,15 @@ getdimen(int *chp, dimen *d, ftnlen delta, ftnlen extent, ftnlen *x1)
register int k;
ftnlen x2, x3;
- if (k = getnum(chp, x1))
+ if ( (k = getnum(chp, x1)) )
return k;
x3 = 1;
if (*chp == ':') {
- if (k = getnum(chp, &x2))
+ if ( (k = getnum(chp, &x2)) )
return k;
x2 -= *x1;
if (*chp == ':') {
- if (k = getnum(chp, &x3))
+ if ( (k = getnum(chp, &x3)) )
return k;
if (!x3)
return 123;
@@ -291,9 +291,9 @@ print_ne(cilist *a)
static char where0[] = "namelist read start ";
#ifdef KR_headers
-x_rsne(a) cilist *a;
+int x_rsne(a) cilist *a;
#else
-x_rsne(cilist *a)
+int x_rsne(cilist *a)
#endif
{
int ch, got1, k, n, nd, quote, readall;
@@ -340,7 +340,7 @@ x_rsne(cilist *a)
#endif
}
have_amp:
- if (ch = getname(buf,sizeof(buf)))
+ if ( (ch = getname(buf,sizeof(buf))) )
return ch;
nl = (Namelist *)a->cifmt;
if (strcmp(buf, nl->name))
@@ -392,10 +392,10 @@ x_rsne(cilist *a)
case '&':
return 0;
default:
- if (ch <= ' ' && ch >= 0 || ch == ',')
+ if ((ch <= ' ' && ch >= 0) || (ch == ','))
continue;
Ungetc(ch,f__cf);
- if (ch = getname(buf,sizeof(buf)))
+ if ( (ch = getname(buf,sizeof(buf))) )
return ch;
goto havename;
}
@@ -419,8 +419,8 @@ x_rsne(cilist *a)
if (!(dims = v->dims)) {
if (type != TYCHAR)
errfl(a->cierr, 122, where);
- if (k = getdimen(&ch, dn, (ftnlen)size,
- (ftnlen)size, &b))
+ if ( (k = getdimen(&ch, dn, (ftnlen)size,
+ (ftnlen)size, &b)) )
errfl(a->cierr, k, where);
if (ch != ')')
errfl(a->cierr, 115, where);
@@ -436,7 +436,7 @@ x_rsne(cilist *a)
nomax = span = dims[1];
ivae = iva + size*nomax;
colonseen = 0;
- if (k = getdimen(&ch, dn, size, nomax, &b))
+ if ( (k = getdimen(&ch, dn, size, nomax, &b)) )
errfl(a->cierr, k, where);
no = dn->extent;
b0 = dims[2];
@@ -447,8 +447,8 @@ x_rsne(cilist *a)
errfl(a->cierr, 115, where);
dn1 = dn + 1;
span /= *dims;
- if (k = getdimen(&ch, dn1, dn->delta**dims,
- span, &b1))
+ if ( (k = getdimen(&ch, dn1, dn->delta**dims,
+ span, &b1)) )
errfl(a->cierr, k, where);
ex *= *dims;
b += b1*ex;
@@ -467,7 +467,7 @@ x_rsne(cilist *a)
no1 = 1;
dn0 = dimens;
if (type == TYCHAR && ch == '(' /*)*/) {
- if (k = getdimen(&ch, &substr, size, size, &b))
+ if ( (k = getdimen(&ch, &substr, size, size, &b)) )
errfl(a->cierr, k, where);
if (ch != ')')
errfl(a->cierr, 115, where);
@@ -502,7 +502,7 @@ x_rsne(cilist *a)
dn1->delta -= ex;
}
}
- else if (dims = v->dims) {
+ else if ( (dims = v->dims) ) {
no = no1 = dims[1];
ivae = iva + no*size;
}
@@ -522,7 +522,7 @@ x_rsne(cilist *a)
else if (iva + no1*size > ivae)
no1 = (ivae - iva)/size;
f__lquit = 0;
- if (k = l_read(&no1, vaddr + iva, size, type))
+ if ( (k = l_read(&no1, vaddr + iva, size, type)) )
return k;
if (f__lquit == 1)
return 0;
@@ -533,8 +533,8 @@ x_rsne(cilist *a)
if (no1 > f__lcount)
no1 = f__lcount;
iva += no1 * dn0->delta;
- if (k = l_read(&no1, vaddr + iva,
- size, type))
+ if ( (k = l_read(&no1, vaddr + iva,
+ size, type)) )
return k;
}
}
@@ -594,7 +594,7 @@ s_rsne(cilist *a)
f__external=1;
l_eof = 0;
- if(n = c_le(a))
+ if( (n = c_le(a)) )
return n;
if(f__curunit->uwrt && f__nowreading(f__curunit))
err(a->cierr,errno,where0);
diff --git a/lib/libI77/sfe.c b/lib/libI77/sfe.c
index eea9078..6fe9aa0 100644
--- a/lib/libI77/sfe.c
+++ b/lib/libI77/sfe.c
@@ -15,9 +15,9 @@ integer e_rsfe(Void)
return(n);
}
#ifdef KR_headers
-c_sfe(a) cilist *a; /* check */
+int c_sfe(a) cilist *a; /* check */
#else
-c_sfe(cilist *a) /* check */
+int c_sfe(cilist *a) /* check */
#endif
{ unit *p;
if(a->ciunit >= MXUNIT || a->ciunit<0)
diff --git a/lib/libI77/sue.c b/lib/libI77/sue.c
index b1b8bc3..a179169 100644
--- a/lib/libI77/sue.c
+++ b/lib/libI77/sue.c
@@ -4,9 +4,9 @@ extern uiolen f__reclen;
long f__recloc;
#ifdef KR_headers
-c_sue(a) cilist *a;
+int c_sue(a) cilist *a;
#else
-c_sue(cilist *a)
+int c_sue(cilist *a)
#endif
{
if(a->ciunit >= MXUNIT || a->ciunit < 0)
@@ -31,7 +31,7 @@ integer s_rsue(cilist *a)
int n;
if(!f__init) f_init();
f__reading=1;
- if(n=c_sue(a)) return(n);
+ if( (n=c_sue(a)) ) return(n);
f__recpos=0;
if(f__curunit->uwrt && f__nowreading(f__curunit))
err(a->cierr, errno, "read start");
@@ -54,7 +54,7 @@ integer s_wsue(cilist *a)
{
int n;
if(!f__init) f_init();
- if(n=c_sue(a)) return(n);
+ if( (n=c_sue(a)) ) return(n);
f__reading=0;
f__reclen=0;
if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
diff --git a/lib/libI77/uio.c b/lib/libI77/uio.c
index e40875e..6bceb27 100644
--- a/lib/libI77/uio.c
+++ b/lib/libI77/uio.c
@@ -3,9 +3,9 @@
uiolen f__reclen;
#ifdef KR_headers
-do_us(number,ptr,len) ftnint *number; char *ptr; ftnlen len;
+int do_us(number,ptr,len) ftnint *number; char *ptr; ftnlen len;
#else
-do_us(ftnint *number, char *ptr, ftnlen len)
+int do_us(ftnint *number, char *ptr, ftnlen len)
#endif
{
if(f__reading)
@@ -23,6 +23,7 @@ do_us(ftnint *number, char *ptr, ftnlen len)
(void) fwrite(ptr,(int)len,(int)(*number),f__cf);
return(0);
}
+ return (0);
}
#ifdef KR_headers
integer do_ud(number,ptr,len) ftnint *number; char *ptr; ftnlen len;
diff --git a/lib/libI77/wref.c b/lib/libI77/wref.c
index eda9a8f..21485a4 100644
--- a/lib/libI77/wref.c
+++ b/lib/libI77/wref.c
@@ -15,9 +15,9 @@
#endif
#ifdef KR_headers
-wrt_E(p,w,d,e,len) ufloat *p; ftnlen len;
+int wrt_E(p,w,d,e,len) ufloat *p; ftnlen len;
#else
-wrt_E(ufloat *p, int w, int d, int e, ftnlen len)
+int wrt_E(ufloat *p, int w, int d, int e, ftnlen len)
#endif
{
char buf[FMAX+EXPMAXDIGS+4], *s, *se;
@@ -127,7 +127,7 @@ nogood:
/* exponent field if it fits. */
#else
if (!e0) {
- for(s -= 2, e1 = 2; s[0] = s[1]; s++)
+ for(s -= 2, e1 = 2; (s[0] = s[1]); s++)
#ifdef CRAY
delta--;
if ((delta += 4) < 0)
@@ -191,9 +191,9 @@ nogood:
}
#ifdef KR_headers
-wrt_F(p,w,d,len) ufloat *p; ftnlen len;
+int wrt_F(p,w,d,len) ufloat *p; ftnlen len;
#else
-wrt_F(ufloat *p, int w, int d, ftnlen len)
+int wrt_F(ufloat *p, int w, int d, ftnlen len)
#endif
{
int d1, sign, n;
@@ -217,7 +217,7 @@ wrt_F(ufloat *p, int w, int d, ftnlen len)
#endif
}
- if (n = f__scale)
+ if ( (n = f__scale) )
if (n > 0)
do x *= 10.; while(--n > 0);
else
@@ -267,7 +267,7 @@ wrt_F(ufloat *p, int w, int d, ftnlen len)
PUT('-');
else if (f__cplus)
PUT('+');
- while(n = *b++)
+ while( (n = *b++) )
PUT(n);
while(--d1 >= 0)
PUT('0');
diff --git a/lib/libI77/wrtfmt.c b/lib/libI77/wrtfmt.c
index 545dcb9..077db71 100644
--- a/lib/libI77/wrtfmt.c
+++ b/lib/libI77/wrtfmt.c
@@ -6,6 +6,8 @@ extern int f__cursor;
int f__hiwater;
icilist *f__svic;
char *f__icptr;
+
+int
mv_cur(Void) /* shouldn't use fseek because it insists on calling fflush */
/* instead we know too much about stdio */
{
@@ -233,9 +235,9 @@ wrt_H(int a, char *s)
return(1);
}
#ifdef KR_headers
-wrt_L(n,len, sz) Uint *n; ftnlen sz;
+int wrt_L(n,len, sz) Uint *n; ftnlen sz;
#else
-wrt_L(Uint *n, int len, ftnlen sz)
+int wrt_L(Uint *n, int len, ftnlen sz)
#endif
{ int i;
long x;
@@ -307,9 +309,9 @@ wrt_G(ufloat *p, int w, int d, int e, ftnlen len)
return(wrt_E(p,w,d,e,len));
}
#ifdef KR_headers
-w_ed(p,ptr,len) struct syl *p; char *ptr; ftnlen len;
+int w_ed(p,ptr,len) struct syl *p; char *ptr; ftnlen len;
#else
-w_ed(struct syl *p, char *ptr, ftnlen len)
+int w_ed(struct syl *p, char *ptr, ftnlen len)
#endif
{
if(f__cursor && mv_cur()) return(mv_cur());
@@ -350,9 +352,9 @@ w_ed(struct syl *p, char *ptr, ftnlen len)
}
}
#ifdef KR_headers
-w_ned(p) struct syl *p;
+int w_ned(p) struct syl *p;
#else
-w_ned(struct syl *p)
+int w_ned(struct syl *p)
#endif
{
switch(p->op)
diff --git a/lib/libI77/wsfe.c b/lib/libI77/wsfe.c
index 7c7f014..d69f9af 100644
--- a/lib/libI77/wsfe.c
+++ b/lib/libI77/wsfe.c
@@ -5,9 +5,9 @@
extern int f__hiwater;
#ifdef KR_headers
-x_putc(c)
+int x_putc(c)
#else
-x_putc(int c)
+int x_putc(int c)
#endif
{
/* this uses \n as an indicator of record-end */
@@ -27,6 +27,8 @@ x_putc(int c)
#endif
return putc(c,f__cf);
}
+
+int
x_wSL(Void)
{
(*f__putn)('\n');
@@ -35,6 +37,8 @@ x_wSL(Void)
f__hiwater = 0;
return(1);
}
+
+int
xw_end(Void)
{
if(f__nonl == 0)
@@ -42,6 +46,8 @@ xw_end(Void)
f__hiwater = f__recpos = f__cursor = 0;
return(0);
}
+
+int
xw_rev(Void)
{
if(f__workdone) (*f__putn)('\n');
@@ -56,7 +62,7 @@ integer s_wsfe(cilist *a) /*start*/
#endif
{ int n;
if(!f__init) f_init();
- if(n=c_sfe(a)) return(n);
+ if( (n=c_sfe(a)) ) return(n);
f__reading=0;
f__sequential=1;
f__formatted=1;
diff --git a/lib/libI77/wsle.c b/lib/libI77/wsle.c
index 44b6972..1e47d5d 100644
--- a/lib/libI77/wsle.c
+++ b/lib/libI77/wsle.c
@@ -10,7 +10,7 @@ integer s_wsle(cilist *a)
#endif
{
int n;
- if(n=c_le(a)) return(n);
+ if( (n=c_le(a)) ) return(n);
f__reading=0;
f__external=1;
f__formatted=1;
diff --git a/lib/libI77/wsne.c b/lib/libI77/wsne.c
index 0febd52..9b7f9b6 100644
--- a/lib/libI77/wsne.c
+++ b/lib/libI77/wsne.c
@@ -11,7 +11,7 @@ s_wsne(cilist *a)
{
int n;
- if(n=c_le(a))
+ if( (n=c_le(a)) )
return(n);
f__reading=0;
f__external=1;
diff --git a/lib/libc/amd64/gen/isinf.c b/lib/libc/amd64/gen/isinf.c
index c328449..a121eda 100644
--- a/lib/libc/amd64/gen/isinf.c
+++ b/lib/libc/amd64/gen/isinf.c
@@ -30,15 +30,16 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: isinf.c,v 1.2 1995/01/23 01:27:00 davidg Exp $
*/
#if defined(LIBC_RCS) && !defined(lint)
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: isinf.c,v 1.2 1995/01/23 01:27:00 davidg Exp $";
#endif /* LIBC_RCS and not lint */
#include <sys/types.h>
+int
isnan(d)
double d;
{
@@ -52,6 +53,7 @@ isnan(d)
return(p->exp == 2047 && (p->manh || p->manl));
}
+int
isinf(d)
double d;
{
diff --git a/lib/libc/compat-43/creat.c b/lib/libc/compat-43/creat.c
index 31d60b8..a4f1234 100644
--- a/lib/libc/compat-43/creat.c
+++ b/lib/libc/compat-43/creat.c
@@ -37,6 +37,7 @@ static char sccsid[] = "@(#)creat.c 8.1 (Berkeley) 6/2/93";
#include <fcntl.h>
+int
#if __STDC__
creat(const char *path, mode_t mode)
#else
diff --git a/lib/libc/compat-43/getwd.c b/lib/libc/compat-43/getwd.c
index f105150e..9f0e633 100644
--- a/lib/libc/compat-43/getwd.c
+++ b/lib/libc/compat-43/getwd.c
@@ -47,7 +47,7 @@ getwd(buf)
{
char *p;
- if (p = getcwd(buf, MAXPATHLEN))
+ if ( (p = getcwd(buf, MAXPATHLEN)) )
return(p);
(void)strcpy(buf, strerror(errno));
return((char *)NULL);
diff --git a/lib/libc/compat-43/killpg.c b/lib/libc/compat-43/killpg.c
index f9b7901..ac3ba6e 100644
--- a/lib/libc/compat-43/killpg.c
+++ b/lib/libc/compat-43/killpg.c
@@ -42,6 +42,7 @@ static char sccsid[] = "@(#)killpg.c 8.1 (Berkeley) 6/2/93";
/*
* Backwards-compatible killpg().
*/
+int
#if __STDC__
killpg(pid_t pgid, int sig)
#else
diff --git a/lib/libc/compat-43/setpgrp.c b/lib/libc/compat-43/setpgrp.c
index df63ebd..dc0dd3f 100644
--- a/lib/libc/compat-43/setpgrp.c
+++ b/lib/libc/compat-43/setpgrp.c
@@ -38,6 +38,7 @@ static char sccsid[] = "@(#)setpgrp.c 8.1 (Berkeley) 6/2/93";
#include <sys/types.h>
#include <unistd.h>
+int
#if __STDC__
setpgrp(pid_t pid, pid_t pgid)
#else
diff --git a/lib/libc/compat-43/sigcompat.c b/lib/libc/compat-43/sigcompat.c
index 69b1870..56550d2 100644
--- a/lib/libc/compat-43/sigcompat.c
+++ b/lib/libc/compat-43/sigcompat.c
@@ -38,6 +38,7 @@ static char sccsid[] = "@(#)sigcompat.c 8.1 (Berkeley) 6/2/93";
#include <sys/param.h>
#include <signal.h>
+int
sigvec(signo, sv, osv)
int signo;
struct sigvec *sv, *osv;
@@ -52,6 +53,7 @@ sigvec(signo, sv, osv)
return (ret);
}
+int
sigsetmask(mask)
int mask;
{
@@ -63,6 +65,7 @@ sigsetmask(mask)
return (omask);
}
+int
sigblock(mask)
int mask;
{
@@ -74,6 +77,7 @@ sigblock(mask)
return (omask);
}
+int
sigpause(mask)
int mask;
{
diff --git a/lib/libc/db/btree/bt_open.c b/lib/libc/db/btree/bt_open.c
index f052249..5fc3168 100644
--- a/lib/libc/db/btree/bt_open.c
+++ b/lib/libc/db/btree/bt_open.c
@@ -125,7 +125,7 @@ __bt_open(fname, flags, mode, openinfo, dflags)
*/
if (b.psize &&
(b.psize < MINPSIZE || b.psize > MAX_PAGE_OFFSET + 1 ||
- b.psize & sizeof(indx_t) - 1))
+ b.psize & (sizeof(indx_t) - 1) ))
goto einval;
/* Minimum number of keys per page; absolute minimum is 2. */
@@ -245,7 +245,7 @@ __bt_open(fname, flags, mode, openinfo, dflags)
if (m.magic != BTREEMAGIC || m.version != BTREEVERSION)
goto eftype;
if (m.psize < MINPSIZE || m.psize > MAX_PAGE_OFFSET + 1 ||
- m.psize & sizeof(indx_t) - 1)
+ m.psize & (sizeof(indx_t) - 1) )
goto eftype;
if (m.flags & ~SAVEMETA)
goto eftype;
@@ -278,8 +278,8 @@ __bt_open(fname, flags, mode, openinfo, dflags)
t->bt_psize = b.psize;
/* Set the cache size; must be a multiple of the page size. */
- if (b.cachesize && b.cachesize & b.psize - 1)
- b.cachesize += (~b.cachesize & b.psize - 1) + 1;
+ if (b.cachesize && b.cachesize & (b.psize - 1) )
+ b.cachesize += (~b.cachesize & (b.psize - 1) ) + 1;
if (b.cachesize < b.psize * MINCACHE)
b.cachesize = b.psize * MINCACHE;
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c
index 68176e4..7d000dc 100644
--- a/lib/libc/db/hash/hash.c
+++ b/lib/libc/db/hash/hash.c
@@ -875,7 +875,7 @@ hash_realloc(p_ptr, oldsize, newsize)
{
register void *p;
- if (p = malloc(newsize)) {
+ if ( (p = malloc(newsize)) ) {
memmove(p, *p_ptr, oldsize);
memset((char *)p + oldsize, 0, newsize - oldsize);
free(*p_ptr);
diff --git a/lib/libc/db/hash/hash_bigkey.c b/lib/libc/db/hash/hash_bigkey.c
index 578314a..0cee07e 100644
--- a/lib/libc/db/hash/hash_bigkey.c
+++ b/lib/libc/db/hash/hash_bigkey.c
@@ -590,7 +590,7 @@ __big_split(hashp, op, np, big_keyp, addr, obucket, ret)
return (-1);
change = (__call_hash(hashp, key.data, key.size) != obucket);
- if (ret->next_addr = __find_last_page(hashp, &big_keyp)) {
+ if ( (ret->next_addr = __find_last_page(hashp, &big_keyp)) ) {
if (!(ret->nextp =
__get_buf(hashp, ret->next_addr, big_keyp, 0)))
return (-1);;
diff --git a/lib/libc/gen/closedir.c b/lib/libc/gen/closedir.c
index 3a4fc9d..6c46e70 100644
--- a/lib/libc/gen/closedir.c
+++ b/lib/libc/gen/closedir.c
@@ -40,6 +40,8 @@ static char sccsid[] = "@(#)closedir.c 8.1 (Berkeley) 6/10/93";
#include <stdlib.h>
#include <unistd.h>
+extern void _reclaim_telldir __P(( const DIR * ));
+
/*
* close a directory.
*/
diff --git a/lib/libc/gen/exec.c b/lib/libc/gen/exec.c
index 6af8868..b62ae63 100644
--- a/lib/libc/gen/exec.c
+++ b/lib/libc/gen/exec.c
@@ -105,7 +105,7 @@ execl(name, arg, va_alist)
#else
va_start(ap);
#endif
- if (argv = buildargv(ap, arg, NULL))
+ if ( (argv = buildargv(ap, arg, NULL)) )
(void)execve(name, argv, environ);
va_end(ap);
sverrno = errno;
@@ -133,7 +133,7 @@ execle(name, arg, va_alist)
#else
va_start(ap);
#endif
- if (argv = buildargv(ap, arg, &envp))
+ if ( (argv = buildargv(ap, arg, &envp)) )
(void)execve(name, argv, envp);
va_end(ap);
sverrno = errno;
@@ -161,7 +161,7 @@ execlp(name, arg, va_alist)
#else
va_start(ap);
#endif
- if (argv = buildargv(ap, arg, NULL))
+ if ( (argv = buildargv(ap, arg, NULL)) )
(void)execvp(name, argv);
va_end(ap);
sverrno = errno;
@@ -204,7 +204,7 @@ execvp(name, argv)
cur = path = strdup(path);
eacces = etxtbsy = 0;
- while (p = strsep(&cur, ":")) {
+ while ( (p = strsep(&cur, ":")) ) {
/*
* It's a SHELL path -- double, leading and trailing colons
* mean the current directory.
diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c
index 0c2ca13..96cd341 100644
--- a/lib/libc/gen/fnmatch.c
+++ b/lib/libc/gen/fnmatch.c
@@ -147,7 +147,7 @@ rangematch(pattern, test, flags)
* consistency with the regular expression syntax.
* J.T. Conklin (conklin@ngai.kaleida.com)
*/
- if (negate = (*pattern == '!' || *pattern == '^'))
+ if ( (negate = (*pattern == '!' || *pattern == '^')) )
++pattern;
for (ok = 0; (c = *pattern++) != ']';) {
diff --git a/lib/libc/gen/fts-compat.c b/lib/libc/gen/fts-compat.c
index 3915b00..8de23df 100644
--- a/lib/libc/gen/fts-compat.c
+++ b/lib/libc/gen/fts-compat.c
@@ -56,7 +56,7 @@ static int fts_palloc __P((FTS *, size_t));
static FTSENT *fts_sort __P((FTS *, FTSENT *, int));
static u_short fts_stat __P((FTS *, FTSENT *, int));
-#define ISDOT(a) (a[0] == '.' && (!a[1] || a[1] == '.' && !a[2]))
+#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])) )
#define ISSET(opt) (sp->fts_options & opt)
#define SET(opt) (sp->fts_options |= opt)
@@ -304,7 +304,7 @@ fts_read(sp)
if (p->fts_info == FTS_D) {
/* If skipped or crossed mount point, do post-order visit. */
if (instr == FTS_SKIP ||
- ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) {
+ (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) ) {
if (p->fts_flags & FTS_SYMFOLLOW)
(void)close(p->fts_symfd);
if (sp->fts_child) {
@@ -354,7 +354,7 @@ fts_read(sp)
/* Move to the next node on this level. */
next: tmp = p;
- if (p = p->fts_link) {
+ if ( (p = p->fts_link) ) {
free(tmp);
/*
@@ -640,7 +640,7 @@ fts_build(sp, type)
/* Read the directory, attaching each entry to the `link' pointer. */
adjaddr = NULL;
- for (head = tail = NULL, nitems = 0; dp = readdir(dirp);) {
+ for (head = tail = NULL, nitems = 0; (dp = readdir(dirp)); ) {
if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
continue;
@@ -680,8 +680,8 @@ mem1: saved_errno = errno;
p->fts_accpath = cur->fts_accpath;
} else if (nlinks == 0
#ifdef DT_DIR
- || nlinks > 0 &&
- dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN
+ || (nlinks > 0 &&
+ dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
#endif
) {
p->fts_accpath =
@@ -909,7 +909,7 @@ fts_lfree(head)
register FTSENT *p;
/* Free a linked list of structures. */
- while (p = head) {
+ while ( (p = head) ) {
head = head->fts_link;
free(p);
}
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
index 3915b00..8de23df 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
@@ -56,7 +56,7 @@ static int fts_palloc __P((FTS *, size_t));
static FTSENT *fts_sort __P((FTS *, FTSENT *, int));
static u_short fts_stat __P((FTS *, FTSENT *, int));
-#define ISDOT(a) (a[0] == '.' && (!a[1] || a[1] == '.' && !a[2]))
+#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])) )
#define ISSET(opt) (sp->fts_options & opt)
#define SET(opt) (sp->fts_options |= opt)
@@ -304,7 +304,7 @@ fts_read(sp)
if (p->fts_info == FTS_D) {
/* If skipped or crossed mount point, do post-order visit. */
if (instr == FTS_SKIP ||
- ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) {
+ (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) ) {
if (p->fts_flags & FTS_SYMFOLLOW)
(void)close(p->fts_symfd);
if (sp->fts_child) {
@@ -354,7 +354,7 @@ fts_read(sp)
/* Move to the next node on this level. */
next: tmp = p;
- if (p = p->fts_link) {
+ if ( (p = p->fts_link) ) {
free(tmp);
/*
@@ -640,7 +640,7 @@ fts_build(sp, type)
/* Read the directory, attaching each entry to the `link' pointer. */
adjaddr = NULL;
- for (head = tail = NULL, nitems = 0; dp = readdir(dirp);) {
+ for (head = tail = NULL, nitems = 0; (dp = readdir(dirp)); ) {
if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
continue;
@@ -680,8 +680,8 @@ mem1: saved_errno = errno;
p->fts_accpath = cur->fts_accpath;
} else if (nlinks == 0
#ifdef DT_DIR
- || nlinks > 0 &&
- dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN
+ || (nlinks > 0 &&
+ dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
#endif
) {
p->fts_accpath =
@@ -909,7 +909,7 @@ fts_lfree(head)
register FTSENT *p;
/* Free a linked list of structures. */
- while (p = head) {
+ while ( (p = head) ) {
head = head->fts_link;
free(p);
}
diff --git a/lib/libc/gen/getcwd.c b/lib/libc/gen/getcwd.c
index fbd445d..d3f5814 100644
--- a/lib/libc/gen/getcwd.c
+++ b/lib/libc/gen/getcwd.c
@@ -47,7 +47,7 @@ static char sccsid[] = "@(#)getcwd.c 8.1 (Berkeley) 6/4/93";
#define ISDOT(dp) \
(dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \
- dp->d_name[1] == '.' && dp->d_name[2] == '\0'))
+ (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
char *
getcwd(pt, size)
diff --git a/lib/libc/gen/getgrouplist.c b/lib/libc/gen/getgrouplist.c
index c65e1fa..702828e 100644
--- a/lib/libc/gen/getgrouplist.c
+++ b/lib/libc/gen/getgrouplist.c
@@ -68,7 +68,7 @@ getgrouplist(uname, agroup, groups, grpcnt)
* Scan the group file to find additional groups.
*/
setgrent();
- while (grp = getgrent()) {
+ while ( (grp = getgrent()) ) {
for (i = 0; i < ngroups; i++) {
if (grp->gr_gid == groups[i])
goto skip;
diff --git a/lib/libc/gen/getnetgrent.c b/lib/libc/gen/getnetgrent.c
index 9b9d0d9..69d2d94 100644
--- a/lib/libc/gen/getnetgrent.c
+++ b/lib/libc/gen/getnetgrent.c
@@ -280,7 +280,7 @@ int len;
{
char *ptr = list;
- while (ptr = strstr(ptr, group)) {
+ while ( (ptr = strstr(ptr, group)) ) {
ptr += strlen(group);
@@ -317,7 +317,7 @@ int *rotation;
*/
int
innetgr(group, host, user, dom)
- char *group, *host, *user, *dom;
+ const char *group, *host, *user, *dom;
{
char *hst, *usr, *dm;
#ifdef YP
diff --git a/lib/libc/gen/getpass.c b/lib/libc/gen/getpass.c
index 658f5b6..b053d34 100644
--- a/lib/libc/gen/getpass.c
+++ b/lib/libc/gen/getpass.c
@@ -83,7 +83,6 @@ getpass(prompt)
register int ch;
register char *p;
FILE *outfp;
- long omask;
static char buf[_PASSWORD_LEN + 1];
/*
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index 3dd7afb..1831458 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -49,6 +49,10 @@ static char sccsid[] = "@(#)getpwent.c 8.1 (Berkeley) 6/4/93";
#include <limits.h>
#include <grp.h>
+extern void setnetgrent __P(( char * ));
+extern int getnetgrent __P(( char **, char **, char ** ));
+extern int innetgr __P(( const char *, const char *, const char *, const char * ));
+
static struct passwd _pw_passwd; /* password structure */
static DB *_pw_db; /* password database */
static int _pw_keynum; /* key counter */
@@ -237,7 +241,7 @@ endpwent()
#endif
}
-static
+static int
__initdb()
{
static int warned;
@@ -273,7 +277,7 @@ __initdb()
return(0);
}
-static
+static int
__hashpw(key)
DBT *key;
{
@@ -289,7 +293,7 @@ __hashpw(key)
return(0);
t = line;
-#define EXPAND(e) e = t; while (*t++ = *p++);
+#define EXPAND(e) e = t; while ( (*t++ = *p++) );
EXPAND(_pw_passwd.pw_name);
EXPAND(_pw_passwd.pw_passwd);
bcopy(p, (char *)&_pw_passwd.pw_uid, sizeof(int));
diff --git a/lib/libc/gen/getttyent.c b/lib/libc/gen/getttyent.c
index 83f97e8..2671015 100644
--- a/lib/libc/gen/getttyent.c
+++ b/lib/libc/gen/getttyent.c
@@ -50,7 +50,7 @@ getttynam(tty)
register struct ttyent *t;
setttyent();
- while (t = getttyent())
+ while ( (t = getttyent()) )
if (!strcmp(tty, t->ty_name))
break;
endttyent();
@@ -120,7 +120,7 @@ getttyent()
tty.ty_comment = p;
if (*p == 0)
tty.ty_comment = 0;
- if (p = index(p, '\n'))
+ if ( (p = index(p, '\n')) )
*p = '\0';
return (&tty);
}
@@ -180,7 +180,7 @@ setttyent()
if (tf) {
rewind(tf);
return (1);
- } else if (tf = fopen(_PATH_TTYS, "r"))
+ } else if ( (tf = fopen(_PATH_TTYS, "r")) )
return (1);
return (0);
}
diff --git a/lib/libc/gen/initgroups.c b/lib/libc/gen/initgroups.c
index da64187..b1ddd86 100644
--- a/lib/libc/gen/initgroups.c
+++ b/lib/libc/gen/initgroups.c
@@ -39,6 +39,7 @@ static char sccsid[] = "@(#)initgroups.c 8.1 (Berkeley) 6/4/93";
#include <stdio.h>
#include <err.h>
+#include <unistd.h>
int
initgroups(uname, agroup)
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c
index cbece18..7292452 100644
--- a/lib/libc/gen/nlist.c
+++ b/lib/libc/gen/nlist.c
@@ -46,6 +46,8 @@ static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93";
#include <string.h>
#include <unistd.h>
+int __fdnlist __P(( int, struct nlist * ));
+
int
nlist(name, list)
const char *name;
diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c
index 0b8bda5..0d28046 100644
--- a/lib/libc/gen/popen.c
+++ b/lib/libc/gen/popen.c
@@ -64,7 +64,7 @@ popen(program, type)
FILE *iop;
int pdes[2], pid;
- if (*type != 'r' && *type != 'w' || type[1])
+ if ( (*type != 'r' && *type != 'w') || type[1])
return (NULL);
if ((cur = malloc(sizeof(struct pid))) == NULL)
diff --git a/lib/libc/gen/pwcache.c b/lib/libc/gen/pwcache.c
index 05773bd..a4328ae 100644
--- a/lib/libc/gen/pwcache.c
+++ b/lib/libc/gen/pwcache.c
@@ -44,7 +44,7 @@ static char sccsid[] = "@(#)pwcache.c 8.1 (Berkeley) 6/4/93";
#include <utmp.h>
#define NCACHE 64 /* power of 2 */
-#define MASK NCACHE - 1 /* bits to store with */
+#define MASK (NCACHE - 1) /* bits to store with */
char *
user_from_uid(uid, nouser)
diff --git a/lib/libc/gen/raise.c b/lib/libc/gen/raise.c
index 75ecaa1..2562c81 100644
--- a/lib/libc/gen/raise.c
+++ b/lib/libc/gen/raise.c
@@ -38,6 +38,7 @@ static char sccsid[] = "@(#)raise.c 8.1 (Berkeley) 6/4/93";
#include <signal.h>
#include <unistd.h>
+int
raise(s)
int s;
{
diff --git a/lib/libc/gen/rewinddir.c b/lib/libc/gen/rewinddir.c
index b46bcf3..2076ddd 100644
--- a/lib/libc/gen/rewinddir.c
+++ b/lib/libc/gen/rewinddir.c
@@ -38,6 +38,8 @@ static char sccsid[] = "@(#)rewinddir.c 8.1 (Berkeley) 6/8/93";
#include <sys/types.h>
#include <dirent.h>
+extern void _seekdir __P(( DIR *, long ));
+
void
rewinddir(dirp)
DIR *dirp;
diff --git a/lib/libc/gen/seekdir.c b/lib/libc/gen/seekdir.c
index 48b4646..1934bcc 100644
--- a/lib/libc/gen/seekdir.c
+++ b/lib/libc/gen/seekdir.c
@@ -38,6 +38,8 @@ static char sccsid[] = "@(#)seekdir.c 8.1 (Berkeley) 6/4/93";
#include <sys/param.h>
#include <dirent.h>
+extern void _seekdir __P(( DIR *, long ));
+
/*
* Seek to an entry in a directory.
* _seekdir is in telldir.c so that it can share opaque data structures.
diff --git a/lib/libc/gen/setproctitle.c b/lib/libc/gen/setproctitle.c
index 08efa99..1f9f4b5 100644
--- a/lib/libc/gen/setproctitle.c
+++ b/lib/libc/gen/setproctitle.c
@@ -14,7 +14,7 @@
* 3. Absolutely no warranty of function or purpose is made by the author
* Peter Wemm.
*
- * $Id: setproctitle.c,v 1.1 1995/12/26 22:50:08 peter Exp $
+ * $Id: setproctitle.c,v 1.2 1996/02/24 14:37:29 peter Exp $
*/
#include <sys/types.h>
@@ -67,7 +67,6 @@ setproctitle(fmt, va_alist)
va_dcl
#endif
{
- char *p;
static char buf[SPT_BUFSIZE];
static char *ps_argv[2];
va_list ap;
diff --git a/lib/libc/gen/siginterrupt.c b/lib/libc/gen/siginterrupt.c
index 3105d13..06960ab 100644
--- a/lib/libc/gen/siginterrupt.c
+++ b/lib/libc/gen/siginterrupt.c
@@ -41,6 +41,7 @@ static char sccsid[] = "@(#)siginterrupt.c 8.1 (Berkeley) 6/4/93";
* Set signal state to prevent restart of system calls
* after an instance of the indicated signal.
*/
+int
siginterrupt(sig, flag)
int sig, flag;
{
diff --git a/lib/libc/gen/sigsetops.c b/lib/libc/gen/sigsetops.c
index e6acb77..c3bd870 100644
--- a/lib/libc/gen/sigsetops.c
+++ b/lib/libc/gen/sigsetops.c
@@ -45,6 +45,7 @@ static char sccsid[] = "@(#)sigsetops.c 8.1 (Berkeley) 6/4/93";
#undef sigdelset
#undef sigismember
+int
sigemptyset(set)
sigset_t *set;
{
@@ -52,6 +53,7 @@ sigemptyset(set)
return (0);
}
+int
sigfillset(set)
sigset_t *set;
{
@@ -59,6 +61,7 @@ sigfillset(set)
return (0);
}
+int
sigaddset(set, signo)
sigset_t *set;
int signo;
@@ -67,6 +70,7 @@ sigaddset(set, signo)
return (0);
}
+int
sigdelset(set, signo)
sigset_t *set;
int signo;
@@ -75,6 +79,7 @@ sigdelset(set, signo)
return (0);
}
+int
sigismember(set, signo)
const sigset_t *set;
int signo;
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c
index 1949332..a355eb2 100644
--- a/lib/libc/gen/syslog.c
+++ b/lib/libc/gen/syslog.c
@@ -36,7 +36,7 @@
static char sccsid[] = "From: @(#)syslog.c 8.4 (Berkeley) 3/18/94";
*/
static const char rcsid[] =
- "$Id: syslog.c,v 1.7 1995/10/22 14:37:08 phk Exp $";
+ "$Id: syslog.c,v 1.8 1996/03/02 19:56:16 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -202,7 +202,7 @@ vsyslog(pri, fmt, ap)
}
/* Substitute error message for %m. */
- for ( ; ch = *fmt; ++fmt)
+ for ( ; (ch = *fmt); ++fmt)
if (ch == '%' && fmt[1] == 'm') {
++fmt;
fputs(strerror(saved_errno), fmt_fp);
diff --git a/lib/libc/gen/timezone.c b/lib/libc/gen/timezone.c
index 370493b..fe3ce23 100644
--- a/lib/libc/gen/timezone.c
+++ b/lib/libc/gen/timezone.c
@@ -62,8 +62,8 @@ timezone(zone, dst)
register char *beg,
*end;
- if (beg = getenv("TZNAME")) { /* set in environment */
- if (end = index(beg, ',')) { /* "PST,PDT" */
+ if ( (beg = getenv("TZNAME")) ) { /* set in environment */
+ if ( (end = index(beg, ',')) ) {/* "PST,PDT" */
if (dst)
return(++end);
*end = '\0';
@@ -82,22 +82,22 @@ static struct zone {
char *stdzone;
char *dlzone;
} zonetab[] = {
- -1*60, "MET", "MET DST", /* Middle European */
- -2*60, "EET", "EET DST", /* Eastern European */
- 4*60, "AST", "ADT", /* Atlantic */
- 5*60, "EST", "EDT", /* Eastern */
- 6*60, "CST", "CDT", /* Central */
- 7*60, "MST", "MDT", /* Mountain */
- 8*60, "PST", "PDT", /* Pacific */
+ {-1*60, "MET", "MET DST"}, /* Middle European */
+ {-2*60, "EET", "EET DST"}, /* Eastern European */
+ {4*60, "AST", "ADT"}, /* Atlantic */
+ {5*60, "EST", "EDT"}, /* Eastern */
+ {6*60, "CST", "CDT"}, /* Central */
+ {7*60, "MST", "MDT"}, /* Mountain */
+ {8*60, "PST", "PDT"}, /* Pacific */
#ifdef notdef
/* there's no way to distinguish this from WET */
- 0, "GMT", 0, /* Greenwich */
+ {0, "GMT", 0}, /* Greenwich */
#endif
- 0*60, "WET", "WET DST", /* Western European */
- -10*60, "EST", "EST", /* Aust: Eastern */
- -10*60+30, "CST", "CST", /* Aust: Central */
- -8*60, "WST", 0, /* Aust: Western */
- -1
+ {0*60, "WET", "WET DST"}, /* Western European */
+ {-10*60,"EST", "EST"}, /* Aust: Eastern */
+ {-10*60+30,"CST", "CST"}, /* Aust: Central */
+ {-8*60, "WST", 0}, /* Aust: Western */
+ {-1}
};
/*
diff --git a/lib/libc/gen/ttyname.c b/lib/libc/gen/ttyname.c
index 39c640e..7ec5429 100644
--- a/lib/libc/gen/ttyname.c
+++ b/lib/libc/gen/ttyname.c
@@ -177,7 +177,7 @@ ttyname(fd)
if (fstat(fd, &sb) || !S_ISCHR(sb.st_mode))
return (NULL);
- if (db = dbopen(_PATH_DEVDB, O_RDONLY, 0, DB_HASH, NULL)) {
+ if ( (db = dbopen(_PATH_DEVDB, O_RDONLY, 0, DB_HASH, NULL)) ) {
memset(&bkey, 0, sizeof(bkey));
bkey.type = S_IFCHR;
bkey.dev = sb.st_rdev;
@@ -206,7 +206,7 @@ oldttyname(fd, sb)
if ((dp = opendir(_PATH_DEV)) == NULL)
return (NULL);
- while (dirp = readdir(dp)) {
+ while ( (dirp = readdir(dp)) ) {
if (dirp->d_fileno != sb->st_ino)
continue;
bcopy(dirp->d_name, buf + sizeof(_PATH_DEV) - 1,
diff --git a/lib/libc/gen/ttyslot.c b/lib/libc/gen/ttyslot.c
index 066f2f9..2f72ebb 100644
--- a/lib/libc/gen/ttyslot.c
+++ b/lib/libc/gen/ttyslot.c
@@ -51,12 +51,12 @@ ttyslot()
setttyent();
for (cnt = 0; cnt < 3; ++cnt)
- if (name = ttyname(cnt)) {
- if (p = rindex(name, '/'))
+ if ( (name = ttyname(cnt)) ) {
+ if ( (p = rindex(name, '/')) )
++p;
else
p = name;
- for (slot = 1; ttyp = getttyent(); ++slot)
+ for (slot = 1; (ttyp = getttyent()); ++slot)
if (!strcmp(ttyp->ty_name, p)) {
endttyent();
return(slot);
diff --git a/lib/libc/gen/unvis.c b/lib/libc/gen/unvis.c
index ebeb771..32405df 100644
--- a/lib/libc/gen/unvis.c
+++ b/lib/libc/gen/unvis.c
@@ -224,7 +224,7 @@ strunvis(dst, src)
char *start = dst;
int state = 0;
- while (c = *src++) {
+ while ( (c = *src++) ) {
again:
switch (unvis(dst, c, &state, 0)) {
case UNVIS_VALID:
diff --git a/lib/libc/gen/vis.c b/lib/libc/gen/vis.c
index 66954e7..61aa836 100644
--- a/lib/libc/gen/vis.c
+++ b/lib/libc/gen/vis.c
@@ -159,7 +159,7 @@ strvis(dst, src, flag)
register char c;
char *start;
- for (start = dst; c = *src;)
+ for (start = dst; (c = *src); )
dst = vis(dst, c, flag, *++src);
*dst = '\0';
return (dst - start);
diff --git a/lib/libc/i386/gen/isinf.c b/lib/libc/i386/gen/isinf.c
index c328449..a121eda 100644
--- a/lib/libc/i386/gen/isinf.c
+++ b/lib/libc/i386/gen/isinf.c
@@ -30,15 +30,16 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: isinf.c,v 1.2 1995/01/23 01:27:00 davidg Exp $
*/
#if defined(LIBC_RCS) && !defined(lint)
-static const char rcsid[] = "$Id$";
+static const char rcsid[] = "$Id: isinf.c,v 1.2 1995/01/23 01:27:00 davidg Exp $";
#endif /* LIBC_RCS and not lint */
#include <sys/types.h>
+int
isnan(d)
double d;
{
@@ -52,6 +53,7 @@ isnan(d)
return(p->exp == 2047 && (p->manh || p->manl));
}
+int
isinf(d)
double d;
{
diff --git a/lib/libc/net/ether_addr.c b/lib/libc/net/ether_addr.c
index 934a76b..2d2101d 100644
--- a/lib/libc/net/ether_addr.c
+++ b/lib/libc/net/ether_addr.c
@@ -35,7 +35,7 @@
* Center for Telecommunications Research
* Columbia University, New York City
*
- * $Id: ether_addr.c,v 1.2 1995/08/07 03:42:14 wpaul Exp $
+ * $Id: ether_addr.c,v 1.3 1996/03/16 21:25:59 wpaul Exp $
*/
@@ -90,11 +90,20 @@ struct ether_addr *ether_aton(a)
{
int i;
static struct ether_addr o;
+ unsigned int o0, o1, o2, o3, o4, o5;
+
+ i = sscanf(a, "%x:%x:%x:%x:%x:%x", &o0, &o1, &o2, &o3, &o4, &o5);
- i = sscanf(a, "%x:%x:%x:%x:%x:%x", o.octet[0], o.octet[1], o.octet[2],
- o.octet[3], o.octet[4], o.octet[5]);
if (i != 6)
return (NULL);
+
+ o.octet[0]=o0;
+ o.octet[1]=o1;
+ o.octet[2]=o2;
+ o.octet[3]=o3;
+ o.octet[4]=o4;
+ o.octet[5]=o5;
+
return ((struct ether_addr *)&o);
}
diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c
index 46213f8..e7e09ab 100644
--- a/lib/libc/net/gethostbydns.c
+++ b/lib/libc/net/gethostbydns.c
@@ -53,7 +53,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id: gethostbydns.c,v 1.7 1995/10/22 14:39:02 phk Exp $";
+static char rcsid[] = "$Id: gethostbydns.c,v 1.8 1996/01/13 09:03:40 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -73,6 +73,8 @@ static char rcsid[] = "$Id: gethostbydns.c,v 1.7 1995/10/22 14:39:02 phk Exp $";
#include "res_config.h"
+extern void _res_close __P((void));
+
#define MAXALIASES 35
#define MAXADDRS 35
@@ -85,8 +87,6 @@ static struct hostent host;
static char *host_aliases[MAXALIASES];
static char hostbuf[8*1024];
static struct in_addr host_addr;
-static FILE *hostf = NULL;
-static int stayopen = 0;
#ifdef RESOLVSORT
static void addrsort __P((char **, int));
diff --git a/lib/libc/net/gethostbyht.c b/lib/libc/net/gethostbyht.c
index 9f1fa4c..a4b2203 100644
--- a/lib/libc/net/gethostbyht.c
+++ b/lib/libc/net/gethostbyht.c
@@ -53,7 +53,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id: gethostbyht.c,v 1.2 1995/05/30 05:40:44 rgrimes Exp $";
+static char rcsid[] = "$Id: gethostbyht.c,v 1.3 1996/01/13 09:03:45 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -135,7 +135,7 @@ again:
cp++;
host.h_name = cp;
q = host.h_aliases = host_aliases;
- if (cp = strpbrk(cp, " \t"))
+ if ( (cp = strpbrk(cp, " \t")) )
*cp++ = '\0';
while (cp && *cp) {
if (*cp == ' ' || *cp == '\t') {
@@ -144,7 +144,7 @@ again:
}
if (q < &host_aliases[MAXALIASES - 1])
*q++ = cp;
- if (cp = strpbrk(cp, " \t"))
+ if ( (cp = strpbrk(cp, " \t")) )
*cp++ = '\0';
}
*q = NULL;
@@ -160,7 +160,7 @@ _gethostbyhtname(name)
register char **cp;
sethostent(0);
- while (p = gethostent()) {
+ while ( (p = gethostent()) ) {
if (strcasecmp(p->h_name, name) == 0)
break;
for (cp = p->h_aliases; *cp != 0; cp++)
@@ -180,7 +180,7 @@ _gethostbyhtaddr(addr, len, type)
register struct hostent *p;
sethostent(0);
- while (p = gethostent())
+ while ( (p = gethostent()) )
if (p->h_addrtype == type && !bcmp(p->h_addr, addr, len))
break;
endhostent();
diff --git a/lib/libc/net/gethostbynis.c b/lib/libc/net/gethostbynis.c
index f01f105..2f012b8 100644
--- a/lib/libc/net/gethostbynis.c
+++ b/lib/libc/net/gethostbynis.c
@@ -24,8 +24,8 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id: gethostbynis.c,v 1.1 1994/09/25 02:12:14 pst Exp $";
-static char rcsid[] = "$Id: gethostbynis.c,v 1.1 1994/09/25 02:12:14 pst Exp $";
+static char sccsid[] = "@(#)$Id: gethostbynis.c,v 1.2 1996/03/16 21:25:58 wpaul Exp $";
+static char rcsid[] = "$Id: gethostbynis.c,v 1.2 1996/03/16 21:25:58 wpaul Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -34,6 +34,7 @@ static char rcsid[] = "$Id: gethostbynis.c,v 1.1 1994/09/25 02:12:14 pst Exp $";
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <string.h>
diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c
index 54f78d0..fff18cb 100644
--- a/lib/libc/net/gethostnamadr.c
+++ b/lib/libc/net/gethostnamadr.c
@@ -24,8 +24,8 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id: gethostnamadr.c,v 1.6 1995/03/24 15:38:54 ache Exp $";
-static char rcsid[] = "$Id: gethostnamadr.c,v 1.6 1995/03/24 15:38:54 ache Exp $";
+static char sccsid[] = "@(#)$Id: gethostnamadr.c,v 1.7 1995/05/30 05:40:45 rgrimes Exp $";
+static char rcsid[] = "$Id: gethostnamadr.c,v 1.7 1995/05/30 05:40:45 rgrimes Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -38,6 +38,11 @@ static char rcsid[] = "$Id: gethostnamadr.c,v 1.6 1995/03/24 15:38:54 ache Exp $
#include <errno.h>
#include <string.h>
+extern void _sethosthtent __P(( int ));
+extern void _endhosthtent __P(( void ));
+extern void _sethostdnsent __P(( int ));
+extern void _endhostdnsent __P(( void ));
+
extern struct hostent * _gethostbyhtname __P((const char *));
extern struct hostent * _gethostbydnsname __P((const char *));
extern struct hostent * _gethostbynisname __P((const char *));
diff --git a/lib/libc/net/getnetbydns.c b/lib/libc/net/getnetbydns.c
index 4464fed..14fe5d6 100644
--- a/lib/libc/net/getnetbydns.c
+++ b/lib/libc/net/getnetbydns.c
@@ -60,7 +60,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id: getnetbydns.c,v 1.4 1995/10/22 14:39:04 phk Exp $";
+static char rcsid[] = "$Id: getnetbydns.c,v 1.5 1996/01/13 09:03:51 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -80,6 +80,7 @@ static char rcsid[] = "$Id: getnetbydns.c,v 1.4 1995/10/22 14:39:04 phk Exp $";
#include "res_config.h"
+extern void _res_close __P((void));
extern int h_errno;
#define BYADDR 0
diff --git a/lib/libc/net/getnetbyht.c b/lib/libc/net/getnetbyht.c
index 24ca2ed..a9707df 100644
--- a/lib/libc/net/getnetbyht.c
+++ b/lib/libc/net/getnetbyht.c
@@ -141,7 +141,7 @@ _getnetbyhtname(name)
register char **cp;
setnetent(_net_stayopen);
- while (p = getnetent()) {
+ while ( (p = getnetent()) ) {
if (strcasecmp(p->n_name, name) == 0)
break;
for (cp = p->n_aliases; *cp != 0; cp++)
@@ -162,7 +162,7 @@ _getnetbyhtaddr(net, type)
register struct netent *p;
setnetent(_net_stayopen);
- while (p = getnetent())
+ while ( (p = getnetent()) )
if (p->n_addrtype == type && p->n_net == net)
break;
if (!_net_stayopen)
diff --git a/lib/libc/net/getnetnamadr.c b/lib/libc/net/getnetnamadr.c
index 5d99c8f..b522d75 100644
--- a/lib/libc/net/getnetnamadr.c
+++ b/lib/libc/net/getnetnamadr.c
@@ -24,8 +24,8 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id: getnetnamadr.c,v 1.3 1995/03/24 15:51:30 ache Exp $";
-static char rcsid[] = "$Id: getnetnamadr.c,v 1.3 1995/03/24 15:51:30 ache Exp $";
+static char sccsid[] = "@(#)$Id: getnetnamadr.c,v 1.4 1995/05/30 05:40:48 rgrimes Exp $";
+static char rcsid[] = "$Id: getnetnamadr.c,v 1.4 1995/05/30 05:40:48 rgrimes Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -38,6 +38,13 @@ static char rcsid[] = "$Id: getnetnamadr.c,v 1.3 1995/03/24 15:51:30 ache Exp $"
#include <errno.h>
#include <string.h>
+extern void _setnetent __P(( int ));
+extern void _endnetent __P(( void ));
+extern void _setnethtent __P(( int ));
+extern void _endnethtent __P(( void ));
+extern void _setnetdnsent __P(( int ));
+extern void _endnetdnsent __P(( void ));
+
extern struct netent * _getnetbyhtname __P((const char *));
extern struct netent * _getnetbydnsname __P((const char *));
extern struct netent * _getnetbynisname __P((const char *));
diff --git a/lib/libc/net/getproto.c b/lib/libc/net/getproto.c
index 92f562b..46f46d3 100644
--- a/lib/libc/net/getproto.c
+++ b/lib/libc/net/getproto.c
@@ -46,7 +46,7 @@ getprotobynumber(proto)
register struct protoent *p;
setprotoent(_proto_stayopen);
- while (p = getprotoent())
+ while ( (p = getprotoent()) )
if (p->p_proto == proto)
break;
if (!_proto_stayopen)
diff --git a/lib/libc/net/getprotoname.c b/lib/libc/net/getprotoname.c
index 3ee6754..0832acf 100644
--- a/lib/libc/net/getprotoname.c
+++ b/lib/libc/net/getprotoname.c
@@ -48,7 +48,7 @@ getprotobyname(name)
register char **cp;
setprotoent(_proto_stayopen);
- while (p = getprotoent()) {
+ while ( (p = getprotoent()) ) {
if (strcmp(p->p_name, name) == 0)
break;
for (cp = p->p_aliases; *cp != 0; cp++)
diff --git a/lib/libc/net/getservbyname.c b/lib/libc/net/getservbyname.c
index fcff7cf..124f5ac 100644
--- a/lib/libc/net/getservbyname.c
+++ b/lib/libc/net/getservbyname.c
@@ -56,7 +56,7 @@ getservbyname(name, proto)
#endif
setservent(_serv_stayopen);
- while (p = getservent()) {
+ while ( (p = getservent()) ) {
if (strcmp(name, p->s_name) == 0)
goto gotname;
for (cp = p->s_aliases; *cp; cp++)
diff --git a/lib/libc/net/getservbyport.c b/lib/libc/net/getservbyport.c
index a24f8df..ef9a2e8 100644
--- a/lib/libc/net/getservbyport.c
+++ b/lib/libc/net/getservbyport.c
@@ -56,7 +56,7 @@ getservbyport(port, proto)
#endif
setservent(_serv_stayopen);
- while (p = getservent()) {
+ while ( (p = getservent()) ) {
if (p->s_port != port)
continue;
if (proto == 0 || strcmp(p->s_proto, proto) == 0)
diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c
index 6797b5a..d28f40c 100644
--- a/lib/libc/net/getservent.c
+++ b/lib/libc/net/getservent.c
@@ -48,6 +48,8 @@ static char sccsid[] = "@(#)getservent.c 8.1 (Berkeley) 6/4/93";
static int serv_stepping_yp = 0;
#endif
+extern int _yp_check __P(( char ** ));
+
#define MAXALIASES 35
static FILE *servf = NULL;
diff --git a/lib/libc/net/inet_network.c b/lib/libc/net/inet_network.c
index c3a96a6..6da2e8b 100644
--- a/lib/libc/net/inet_network.c
+++ b/lib/libc/net/inet_network.c
@@ -60,7 +60,7 @@ again:
base = 8, cp++;
if (*cp == 'x' || *cp == 'X')
base = 16, cp++;
- while (c = *cp) {
+ while ( (c = *cp) ) {
if (isdigit(c)) {
val = (val * base) + (c - '0');
cp++;
diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c
index 3d6c649..7e396c0 100644
--- a/lib/libc/net/rcmd.c
+++ b/lib/libc/net/rcmd.c
@@ -57,6 +57,8 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
#include <rpcsvc/ypclnt.h>
#endif
+extern int innetgr __P(( const char *, const char *, const char *, const char * ));
+
#define max(a, b) ((a > b) ? a : b)
int __ivaliduser __P((FILE *, u_long, const char *, const char *));
diff --git a/lib/libc/net/res_comp.c b/lib/libc/net/res_comp.c
index fbe5e95..523aa19 100644
--- a/lib/libc/net/res_comp.c
+++ b/lib/libc/net/res_comp.c
@@ -53,7 +53,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id: res_comp.c,v 1.3 1995/05/30 05:40:54 rgrimes Exp $";
+static char rcsid[] = "$Id: res_comp.c,v 1.4 1996/01/07 09:14:54 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -95,7 +95,7 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length)
/*
* fetch next label in domain name
*/
- while (n = *cp++) {
+ while ( (n = *cp++) ) {
/*
* Check for indirection
*/
@@ -298,7 +298,7 @@ dn_find(exp_dn, msg, dnptrs, lastdnptr)
for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
dn = exp_dn;
sp = cp = *cpp;
- while (n = *cp++) {
+ while ( (n = *cp++) ) {
/*
* check for indirection
*/
diff --git a/lib/libc/net/res_debug.c b/lib/libc/net/res_debug.c
index fdcb1b8..ad65fc7 100644
--- a/lib/libc/net/res_debug.c
+++ b/lib/libc/net/res_debug.c
@@ -53,7 +53,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id: res_debug.c,v 1.6 1996/01/07 09:14:55 peter Exp $";
+static char rcsid[] = "$Id: res_debug.c,v 1.7 1996/02/06 20:35:48 wollman Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -171,7 +171,7 @@ do_rrset(msg, len, cp, cnt, pflag, file, hs)
* Print answer records.
*/
sflag = (_res.pfcode & pflag);
- if (n = ntohs(cnt)) {
+ if ( (n = ntohs(cnt)) ) {
if ((!_res.pfcode) ||
((sflag) && (_res.pfcode & RES_PRF_HEAD1)))
fprintf(file, hs);
@@ -286,7 +286,7 @@ __fp_nquery(msg, len, file)
/*
* Print question records.
*/
- if (n = ntohs(hp->qdcount)) {
+ if ( (n = ntohs(hp->qdcount)) ) {
if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES))
fprintf(file, ";; QUESTIONS:\n");
while (--n >= 0) {
@@ -490,7 +490,7 @@ __p_rr(cp, msg, file)
case T_HINFO:
case T_ISDN:
cp2 = cp + dlen;
- if (n = *cp++) {
+ if ( (n = *cp++) ) {
fprintf(file, "\t%.*s", n, cp);
cp += n;
}
@@ -549,7 +549,7 @@ __p_rr(cp, msg, file)
(void) fputs("\t\"", file);
cp2 = cp1 + dlen;
while (cp < cp2) {
- if (n = (unsigned char) *cp++) {
+ if ( (n = (unsigned char) *cp++) ) {
for (c = n; c > 0 && cp < cp2; c--)
if ((*cp == '\n') || (*cp == '"')) {
(void) putc('\\', file);
diff --git a/lib/libc/net/res_send.c b/lib/libc/net/res_send.c
index 88df305..eb1b321 100644
--- a/lib/libc/net/res_send.c
+++ b/lib/libc/net/res_send.c
@@ -53,7 +53,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id: res_send.c,v 1.6 1995/08/21 09:15:40 bde Exp $";
+static char rcsid[] = "$Id: res_send.c,v 1.7 1996/01/07 09:15:02 peter Exp $";
#endif /* LIBC_SCCS and not lint */
/* change this to "0"
@@ -716,7 +716,7 @@ res_send(buf, buflen, ans, anssiz)
* This routine is not expected to be user visible.
*/
void
-_res_close()
+_res_close(void)
{
if (s >= 0) {
(void) close(s);
diff --git a/lib/libc/nls/msgcat.c b/lib/libc/nls/msgcat.c
index 8df18ae..1110810 100644
--- a/lib/libc/nls/msgcat.c
+++ b/lib/libc/nls/msgcat.c
@@ -1,4 +1,4 @@
-/* $Id: msgcat.c,v 1.3 1995/06/17 03:02:21 ache Exp $ */
+/* $Id: msgcat.c,v 1.4 1995/10/22 14:39:22 phk Exp $ */
/***********************************************************
Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts.
@@ -312,13 +312,13 @@ int type;
if (strncmp(header.magic, MCMagic, MCMagicLen) != 0) CORRUPT();
if (header.majorVer != MCMajorVer) {
- fprintf(stderr, "%s: %s is version %d, we need %d.\n", ERRNAME,
+ fprintf(stderr, "%s: %s is version %ld, we need %ld.\n", ERRNAME,
catpath, header.majorVer, MCMajorVer);
return(0);
}
if (header.numSets <= 0) {
- fprintf(stderr, "%s: %s has %d sets!\n", ERRNAME, catpath,
+ fprintf(stderr, "%s: %s has %ld sets!\n", ERRNAME, catpath,
header.numSets);
return(0);
}
diff --git a/lib/libc/nls/msgcat.h b/lib/libc/nls/msgcat.h
index 4fabb59..354ca1e 100644
--- a/lib/libc/nls/msgcat.h
+++ b/lib/libc/nls/msgcat.h
@@ -1,4 +1,4 @@
-/* $Id: msgcat.h,v 1.1 1995/03/30 12:47:27 jkh Exp $ */
+/* $Id: msgcat.h,v 1.2 1995/05/30 05:41:00 rgrimes Exp $ */
/* -*-c++-*- */
@@ -66,7 +66,7 @@ up-to-date. Many thanks.
#define MCLastMsg 0
#define MCLastSet 0
-#define MCMajorVer 1
+#define MCMajorVer 1L
#define MCMinorVer 0
/*
diff --git a/lib/libc/regex/cclass.h b/lib/libc/regex/cclass.h
index a29a92e..cabe7fa 100644
--- a/lib/libc/regex/cclass.h
+++ b/lib/libc/regex/cclass.h
@@ -43,28 +43,28 @@ static struct cclass {
char *chars;
char *multis;
} cclasses[] = {
- "alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
-0123456789", "",
- "alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
- "",
- "blank", " \t", "",
- "cntrl", "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\
-\25\26\27\30\31\32\33\34\35\36\37\177", "",
- "digit", "0123456789", "",
- "graph", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
+ {"alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
+0123456789", ""},
+ {"alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
+ ""},
+ {"blank", " \t", ""},
+ {"cntrl", "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\
+\25\26\27\30\31\32\33\34\35\36\37\177", ""},
+ {"digit", "0123456789", ""},
+ {"graph", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
- "",
- "lower", "abcdefghijklmnopqrstuvwxyz",
- "",
- "print", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
+ ""},
+ {"lower", "abcdefghijklmnopqrstuvwxyz",
+ ""},
+ {"print", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ",
- "",
- "punct", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
- "",
- "space", "\t\n\v\f\r ", "",
- "upper", "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
- "",
- "xdigit", "0123456789ABCDEFabcdef",
- "",
- NULL, 0, ""
+ ""},
+ {"punct", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
+ ""},
+ {"space", "\t\n\v\f\r ", ""},
+ {"upper", "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
+ ""},
+ {"xdigit", "0123456789ABCDEFabcdef",
+ ""},
+ {NULL, 0, ""}
};
diff --git a/lib/libc/regex/cname.h b/lib/libc/regex/cname.h
index c1632eb..72bbe5e 100644
--- a/lib/libc/regex/cname.h
+++ b/lib/libc/regex/cname.h
@@ -42,100 +42,100 @@ static struct cname {
char *name;
char code;
} cnames[] = {
- "NUL", '\0',
- "SOH", '\001',
- "STX", '\002',
- "ETX", '\003',
- "EOT", '\004',
- "ENQ", '\005',
- "ACK", '\006',
- "BEL", '\007',
- "alert", '\007',
- "BS", '\010',
- "backspace", '\b',
- "HT", '\011',
- "tab", '\t',
- "LF", '\012',
- "newline", '\n',
- "VT", '\013',
- "vertical-tab", '\v',
- "FF", '\014',
- "form-feed", '\f',
- "CR", '\015',
- "carriage-return", '\r',
- "SO", '\016',
- "SI", '\017',
- "DLE", '\020',
- "DC1", '\021',
- "DC2", '\022',
- "DC3", '\023',
- "DC4", '\024',
- "NAK", '\025',
- "SYN", '\026',
- "ETB", '\027',
- "CAN", '\030',
- "EM", '\031',
- "SUB", '\032',
- "ESC", '\033',
- "IS4", '\034',
- "FS", '\034',
- "IS3", '\035',
- "GS", '\035',
- "IS2", '\036',
- "RS", '\036',
- "IS1", '\037',
- "US", '\037',
- "space", ' ',
- "exclamation-mark", '!',
- "quotation-mark", '"',
- "number-sign", '#',
- "dollar-sign", '$',
- "percent-sign", '%',
- "ampersand", '&',
- "apostrophe", '\'',
- "left-parenthesis", '(',
- "right-parenthesis", ')',
- "asterisk", '*',
- "plus-sign", '+',
- "comma", ',',
- "hyphen", '-',
- "hyphen-minus", '-',
- "period", '.',
- "full-stop", '.',
- "slash", '/',
- "solidus", '/',
- "zero", '0',
- "one", '1',
- "two", '2',
- "three", '3',
- "four", '4',
- "five", '5',
- "six", '6',
- "seven", '7',
- "eight", '8',
- "nine", '9',
- "colon", ':',
- "semicolon", ';',
- "less-than-sign", '<',
- "equals-sign", '=',
- "greater-than-sign", '>',
- "question-mark", '?',
- "commercial-at", '@',
- "left-square-bracket", '[',
- "backslash", '\\',
- "reverse-solidus", '\\',
- "right-square-bracket", ']',
- "circumflex", '^',
- "circumflex-accent", '^',
- "underscore", '_',
- "low-line", '_',
- "grave-accent", '`',
- "left-brace", '{',
- "left-curly-bracket", '{',
- "vertical-line", '|',
- "right-brace", '}',
- "right-curly-bracket", '}',
- "tilde", '~',
- "DEL", '\177',
- NULL, 0,
+ {"NUL", '\0'},
+ {"SOH", '\001'},
+ {"STX", '\002'},
+ {"ETX", '\003'},
+ {"EOT", '\004'},
+ {"ENQ", '\005'},
+ {"ACK", '\006'},
+ {"BEL", '\007'},
+ {"alert", '\007'},
+ {"BS", '\010'},
+ {"backspace", '\b'},
+ {"HT", '\011'},
+ {"tab", '\t'},
+ {"LF", '\012'},
+ {"newline", '\n'},
+ {"VT", '\013'},
+ {"vertical-tab", '\v'},
+ {"FF", '\014'},
+ {"form-feed", '\f'},
+ {"CR", '\015'},
+ {"carriage-return", '\r'},
+ {"SO", '\016'},
+ {"SI", '\017'},
+ {"DLE", '\020'},
+ {"DC1", '\021'},
+ {"DC2", '\022'},
+ {"DC3", '\023'},
+ {"DC4", '\024'},
+ {"NAK", '\025'},
+ {"SYN", '\026'},
+ {"ETB", '\027'},
+ {"CAN", '\030'},
+ {"EM", '\031'},
+ {"SUB", '\032'},
+ {"ESC", '\033'},
+ {"IS4", '\034'},
+ {"FS", '\034'},
+ {"IS3", '\035'},
+ {"GS", '\035'},
+ {"IS2", '\036'},
+ {"RS", '\036'},
+ {"IS1", '\037'},
+ {"US", '\037'},
+ {"space", ' '},
+ {"exclamation-mark", '!'},
+ {"quotation-mark", '"'},
+ {"number-sign", '#'},
+ {"dollar-sign", '$'},
+ {"percent-sign", '%'},
+ {"ampersand", '&'},
+ {"apostrophe", '\''},
+ {"left-parenthesis", '('},
+ {"right-parenthesis", ')'},
+ {"asterisk", '*'},
+ {"plus-sign", '+'},
+ {"comma", ','},
+ {"hyphen", '-'},
+ {"hyphen-minus", '-'},
+ {"period", '.'},
+ {"full-stop", '.'},
+ {"slash", '/'},
+ {"solidus", '/'},
+ {"zero", '0'},
+ {"one", '1'},
+ {"two", '2'},
+ {"three", '3'},
+ {"four", '4'},
+ {"five", '5'},
+ {"six", '6'},
+ {"seven", '7'},
+ {"eight", '8'},
+ {"nine", '9'},
+ {"colon", ':'},
+ {"semicolon", ';'},
+ {"less-than-sign", '<'},
+ {"equals-sign", '='},
+ {"greater-than-sign", '>'},
+ {"question-mark", '?'},
+ {"commercial-at", '@'},
+ {"left-square-bracket", '['},
+ {"backslash", '\\'},
+ {"reverse-solidus", '\\'},
+ {"right-square-bracket",']'},
+ {"circumflex", '^'},
+ {"circumflex-accent", '^'},
+ {"underscore", '_'},
+ {"low-line", '_'},
+ {"grave-accent", '`'},
+ {"left-brace", '{'},
+ {"left-curly-bracket", '{'},
+ {"vertical-line", '|'},
+ {"right-brace", '}'},
+ {"right-curly-bracket", '}'},
+ {"tilde", '~'},
+ {"DEL", '\177'},
+ {NULL, 0}
};
diff --git a/lib/libc/regex/engine.c b/lib/libc/regex/engine.c
index 8b54837..e7917b9 100644
--- a/lib/libc/regex/engine.c
+++ b/lib/libc/regex/engine.c
@@ -148,8 +148,8 @@ int eflags;
struct match mv;
register struct match *m = &mv;
register char *dp;
- const register sopno gf = g->firststate+1; /* +1 for OEND */
- const register sopno gl = g->laststate;
+ register const sopno gf = g->firststate+1; /* +1 for OEND */
+ register const sopno gl = g->laststate;
char *start;
char *stop;
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c
index 10412aa..f7962ea 100644
--- a/lib/libc/regex/regcomp.c
+++ b/lib/libc/regex/regcomp.c
@@ -103,9 +103,11 @@ static int freezeset __P((struct parse *p, cset *cs));
static int firstch __P((struct parse *p, cset *cs));
static int nch __P((struct parse *p, cset *cs));
static void mcadd __P((struct parse *p, cset *cs, char *cp));
+#if used
static void mcsub __P((cset *cs, char *cp));
static int mcin __P((cset *cs, char *cp));
static char *mcfind __P((cset *cs, char *cp));
+#endif
static void mcinvert __P((struct parse *p, cset *cs));
static void mccase __P((struct parse *p, cset *cs));
static int isinsets __P((struct re_guts *g, int c));
@@ -295,7 +297,7 @@ int stop; /* character this ERE should end at */
conc = HERE();
while (MORE() && (c = PEEK()) != '|' && c != stop)
p_ere_exp(p);
- REQUIRE(HERE() != conc, REG_EMPTY); /* require nonempty */
+ (void)REQUIRE(HERE() != conc, REG_EMPTY); /* require nonempty */
if (!EAT('|'))
break; /* NOTE BREAK OUT */
@@ -342,7 +344,7 @@ register struct parse *p;
pos = HERE();
switch (c) {
case '(':
- REQUIRE(MORE(), REG_EPAREN);
+ (void)REQUIRE(MORE(), REG_EPAREN);
p->g->nsub++;
subno = p->g->nsub;
if (subno < NPAREN)
@@ -355,7 +357,7 @@ register struct parse *p;
assert(p->pend[subno] != 0);
}
EMIT(ORPAREN, subno);
- MUSTEAT(')', REG_EPAREN);
+ (void)MUSTEAT(')', REG_EPAREN);
break;
#ifndef POSIX_MISTAKE
case ')': /* happens only if no current unmatched ( */
@@ -398,12 +400,12 @@ register struct parse *p;
p_bracket(p);
break;
case '\\':
- REQUIRE(MORE(), REG_EESCAPE);
+ (void)REQUIRE(MORE(), REG_EESCAPE);
c = GETNEXT();
ordinary(p, c);
break;
case '{': /* okay as ordinary except if digit follows */
- REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT);
+ (void)REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT);
/* FALLTHROUGH */
default:
ordinary(p, c);
@@ -419,7 +421,7 @@ register struct parse *p;
return; /* no repetition, we're done */
NEXT();
- REQUIRE(!wascaret, REG_BADRPT);
+ (void)REQUIRE(!wascaret, REG_BADRPT);
switch (c) {
case '*': /* implemented as +? */
/* this case does not require the (y|) trick, noKLUDGE */
@@ -446,7 +448,7 @@ register struct parse *p;
if (EAT(',')) {
if (isdigit(PEEK())) {
count2 = p_count(p);
- REQUIRE(count <= count2, REG_BADBR);
+ (void)REQUIRE(count <= count2, REG_BADBR);
} else /* single number with comma */
count2 = INFINITY;
} else /* just a single number */
@@ -455,7 +457,7 @@ register struct parse *p;
if (!EAT('}')) { /* error heuristics */
while (MORE() && PEEK() != '}')
NEXT();
- REQUIRE(MORE(), REG_EBRACE);
+ (void)REQUIRE(MORE(), REG_EBRACE);
SETERROR(REG_BADBR);
}
break;
@@ -478,7 +480,7 @@ static void
p_str(p)
register struct parse *p;
{
- REQUIRE(MORE(), REG_EMPTY);
+ (void)REQUIRE(MORE(), REG_EMPTY);
while (MORE())
ordinary(p, GETNEXT());
}
@@ -521,7 +523,7 @@ register int end2; /* second terminating character */
p->g->neol++;
}
- REQUIRE(HERE() != start, REG_EMPTY); /* require nonempty */
+ (void)REQUIRE(HERE() != start, REG_EMPTY); /* require nonempty */
}
/*
@@ -546,7 +548,7 @@ int starordinary; /* is a leading * an ordinary character? */
assert(MORE()); /* caller should have ensured this */
c = GETNEXT();
if (c == '\\') {
- REQUIRE(MORE(), REG_EESCAPE);
+ (void)REQUIRE(MORE(), REG_EESCAPE);
c = BACKSL | (unsigned char)GETNEXT();
}
switch (c) {
@@ -576,7 +578,7 @@ int starordinary; /* is a leading * an ordinary character? */
assert(p->pend[subno] != 0);
}
EMIT(ORPAREN, subno);
- REQUIRE(EATTWO('\\', ')'), REG_EPAREN);
+ (void)REQUIRE(EATTWO('\\', ')'), REG_EPAREN);
break;
case BACKSL|')': /* should not get here -- must be user */
case BACKSL|'}':
@@ -606,7 +608,7 @@ int starordinary; /* is a leading * an ordinary character? */
p->g->backrefs = 1;
break;
case '*':
- REQUIRE(starordinary, REG_BADRPT);
+ (void)REQUIRE(starordinary, REG_BADRPT);
/* FALLTHROUGH */
default:
ordinary(p, c &~ BACKSL);
@@ -624,7 +626,7 @@ int starordinary; /* is a leading * an ordinary character? */
if (EAT(',')) {
if (MORE() && isdigit(PEEK())) {
count2 = p_count(p);
- REQUIRE(count <= count2, REG_BADBR);
+ (void)REQUIRE(count <= count2, REG_BADBR);
} else /* single number with comma */
count2 = INFINITY;
} else /* just a single number */
@@ -633,7 +635,7 @@ int starordinary; /* is a leading * an ordinary character? */
if (!EATTWO('\\', '}')) { /* error heuristics */
while (MORE() && !SEETWO('\\', '}'))
NEXT();
- REQUIRE(MORE(), REG_EBRACE);
+ (void)REQUIRE(MORE(), REG_EBRACE);
SETERROR(REG_BADBR);
}
} else if (c == (unsigned char)'$') /* $ (but not \$) ends it */
@@ -658,7 +660,7 @@ register struct parse *p;
ndigits++;
}
- REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR);
+ (void)REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR);
return(count);
}
@@ -698,7 +700,7 @@ register struct parse *p;
p_b_term(p, cs);
if (EAT('-'))
CHadd(cs, '-');
- MUSTEAT(']', REG_EBRACK);
+ (void)MUSTEAT(']', REG_EBRACK);
if (p->error != 0) /* don't mess things up further */
return;
@@ -769,21 +771,21 @@ register cset *cs;
switch (c) {
case ':': /* character class */
NEXT2();
- REQUIRE(MORE(), REG_EBRACK);
+ (void)REQUIRE(MORE(), REG_EBRACK);
c = PEEK();
- REQUIRE(c != '-' && c != ']', REG_ECTYPE);
+ (void)REQUIRE(c != '-' && c != ']', REG_ECTYPE);
p_b_cclass(p, cs);
- REQUIRE(MORE(), REG_EBRACK);
- REQUIRE(EATTWO(':', ']'), REG_ECTYPE);
+ (void)REQUIRE(MORE(), REG_EBRACK);
+ (void)REQUIRE(EATTWO(':', ']'), REG_ECTYPE);
break;
case '=': /* equivalence class */
NEXT2();
- REQUIRE(MORE(), REG_EBRACK);
+ (void)REQUIRE(MORE(), REG_EBRACK);
c = PEEK();
- REQUIRE(c != '-' && c != ']', REG_ECOLLATE);
+ (void)REQUIRE(c != '-' && c != ']', REG_ECOLLATE);
p_b_eclass(p, cs);
- REQUIRE(MORE(), REG_EBRACK);
- REQUIRE(EATTWO('=', ']'), REG_ECOLLATE);
+ (void)REQUIRE(MORE(), REG_EBRACK);
+ (void)REQUIRE(EATTWO('=', ']'), REG_ECOLLATE);
break;
default: /* symbol, ordinary character, or range */
/* xxx revision needed for multichar stuff */
@@ -798,7 +800,7 @@ register cset *cs;
} else
finish = start;
/* xxx what about signed chars here... */
- REQUIRE(start <= finish, REG_ERANGE);
+ (void)REQUIRE(start <= finish, REG_ERANGE);
for (i = start; i <= finish; i++)
CHadd(cs, i);
break;
@@ -866,13 +868,13 @@ register struct parse *p;
{
register char value;
- REQUIRE(MORE(), REG_EBRACK);
+ (void)REQUIRE(MORE(), REG_EBRACK);
if (!EATTWO('[', '.'))
return(GETNEXT());
/* collating symbol */
value = p_b_coll_elem(p, '.');
- REQUIRE(EATTWO('.', ']'), REG_ECOLLATE);
+ (void)REQUIRE(EATTWO('.', ']'), REG_ECOLLATE);
return(value);
}
@@ -1264,6 +1266,7 @@ register char *cp;
cs->multis[cs->smultis - 1] = '\0';
}
+#if used
/*
- mcsub - subtract a collating element from a cset
== static void mcsub(register cset *cs, register char *cp);
@@ -1321,6 +1324,7 @@ register char *cp;
return(p);
return(NULL);
}
+#endif
/*
- mcinvert - invert the list of collating elements in a cset
diff --git a/lib/libc/regex/regerror.c b/lib/libc/regex/regerror.c
index 212f709..1ed6771 100644
--- a/lib/libc/regex/regerror.c
+++ b/lib/libc/regex/regerror.c
@@ -88,23 +88,23 @@ static struct rerr {
char *name;
char *explain;
} rerrs[] = {
- REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match",
- REG_BADPAT, "REG_BADPAT", "invalid regular expression",
- REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element",
- REG_ECTYPE, "REG_ECTYPE", "invalid character class",
- REG_EESCAPE, "REG_EESCAPE", "trailing backslash (\\)",
- REG_ESUBREG, "REG_ESUBREG", "invalid backreference number",
- REG_EBRACK, "REG_EBRACK", "brackets ([ ]) not balanced",
- REG_EPAREN, "REG_EPAREN", "parentheses not balanced",
- REG_EBRACE, "REG_EBRACE", "braces not balanced",
- REG_BADBR, "REG_BADBR", "invalid repetition count(s)",
- REG_ERANGE, "REG_ERANGE", "invalid character range",
- REG_ESPACE, "REG_ESPACE", "out of memory",
- REG_BADRPT, "REG_BADRPT", "repetition-operator operand invalid",
- REG_EMPTY, "REG_EMPTY", "empty (sub)expression",
- REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug",
- REG_INVARG, "REG_INVARG", "invalid argument to regex routine",
- 0, "", "*** unknown regexp error code ***",
+ {REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match"},
+ {REG_BADPAT, "REG_BADPAT", "invalid regular expression"},
+ {REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element"},
+ {REG_ECTYPE, "REG_ECTYPE", "invalid character class"},
+ {REG_EESCAPE, "REG_EESCAPE", "trailing backslash (\\)"},
+ {REG_ESUBREG, "REG_ESUBREG", "invalid backreference number"},
+ {REG_EBRACK, "REG_EBRACK", "brackets ([ ]) not balanced"},
+ {REG_EPAREN, "REG_EPAREN", "parentheses not balanced"},
+ {REG_EBRACE, "REG_EBRACE", "braces not balanced"},
+ {REG_BADBR, "REG_BADBR", "invalid repetition count(s)"},
+ {REG_ERANGE, "REG_ERANGE", "invalid character range"},
+ {REG_ESPACE, "REG_ESPACE", "out of memory"},
+ {REG_BADRPT, "REG_BADRPT", "repetition-operator operand invalid"},
+ {REG_EMPTY, "REG_EMPTY", "empty (sub)expression"},
+ {REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug"},
+ {REG_INVARG, "REG_INVARG", "invalid argument to regex routine"},
+ {0, "", "*** unknown regexp error code ***"}
};
/*
diff --git a/lib/libc/stdlib/atoi.c b/lib/libc/stdlib/atoi.c
index a13c0e2..48e508a 100644
--- a/lib/libc/stdlib/atoi.c
+++ b/lib/libc/stdlib/atoi.c
@@ -38,6 +38,7 @@ static char sccsid[] = "@(#)atoi.c 8.1 (Berkeley) 6/4/93";
#include <stdlib.h>
#include <stddef.h>
+int
atoi(str)
const char *str;
{
diff --git a/lib/libc/stdlib/calloc.c b/lib/libc/stdlib/calloc.c
index d7c8e07..7a83603 100644
--- a/lib/libc/stdlib/calloc.c
+++ b/lib/libc/stdlib/calloc.c
@@ -46,7 +46,7 @@ calloc(num, size)
register void *p;
size *= num;
- if (p = malloc(size))
+ if ( (p = malloc(size)) )
bzero(p, size);
return(p);
}
diff --git a/lib/libc/stdlib/getsubopt.c b/lib/libc/stdlib/getsubopt.c
index afd577a..bc055b8 100644
--- a/lib/libc/stdlib/getsubopt.c
+++ b/lib/libc/stdlib/getsubopt.c
@@ -46,6 +46,7 @@ static char sccsid[] = "@(#)getsubopt.c 8.1 (Berkeley) 6/4/93";
*/
char *suboptarg;
+int
getsubopt(optionp, tokens, valuep)
register char **optionp, **valuep;
register char * const *tokens;
diff --git a/lib/libc/stdlib/setenv.c b/lib/libc/stdlib/setenv.c
index 4a28f25..d981277 100644
--- a/lib/libc/stdlib/setenv.c
+++ b/lib/libc/stdlib/setenv.c
@@ -46,6 +46,7 @@ char *__findenv __P((const char *, int *));
* Set the value of the environmental variable "name" to be
* "value". If rewrite is set, replace any current value.
*/
+int
setenv(name, value, rewrite)
register const char *name;
register const char *value;
@@ -63,7 +64,7 @@ setenv(name, value, rewrite)
if (!rewrite)
return (0);
if (strlen(c) >= l_value) { /* old larger; copy over */
- while (*c++ = *value++);
+ while ( (*c++ = *value++) );
return (0);
}
} else { /* create new slot */
@@ -93,7 +94,7 @@ setenv(name, value, rewrite)
malloc((size_t)((int)(c - name) + l_value + 2))))
return (-1);
for (c = environ[offset]; (*c = *name++) && *c != '='; ++c);
- for (*c++ = '='; *c++ = *value++;);
+ for (*c++ = '='; (*c++ = *value++); );
return (0);
}
diff --git a/lib/libc/stdlib/strtod.c b/lib/libc/stdlib/strtod.c
index 0ccd6fd..27fb499 100644
--- a/lib/libc/stdlib/strtod.c
+++ b/lib/libc/stdlib/strtod.c
@@ -382,7 +382,7 @@ Balloc
int x;
Bigint *rv;
- if (rv = freelist[k]) {
+ if ( (rv = freelist[k]) ) {
freelist[k] = rv->next;
} else {
x = 1 << k;
@@ -628,7 +628,7 @@ mult
xc0 = c->x;
#ifdef Pack_32
for (; xb < xbe; xb++, xc0++) {
- if (y = *xb & 0xffff) {
+ if ( (y = *xb & 0xffff) ) {
x = xa;
xc = xc0;
carry = 0;
@@ -641,7 +641,7 @@ mult
} while (x < xae);
*xc = carry;
}
- if (y = *xb >> 16) {
+ if ( (y = *xb >> 16) ) {
x = xa;
xc = xc0;
carry = 0;
@@ -690,7 +690,7 @@ pow5mult
int i;
static int p05[3] = { 5, 25, 125 };
- if (i = k & 3)
+ if ( (i = k & 3) )
b = multadd(b, p05[i-1], 0);
if (!(k >>= 2))
@@ -752,7 +752,7 @@ lshift
*x1++ = *x << k | z;
z = *x++ >> k1;
} while (x < xe);
- if (*x1 = z)
+ if ( (*x1 = z) )
++n1;
}
#else
@@ -918,7 +918,7 @@ ulp
} else {
word0(a) = 0;
L -= Exp_shift;
- word1(a) = L >= 31 ? 1 : 1 << 31 - L;
+ word1(a) = L >= 31 ? 1 : 1 << (31 - L);
}
}
#endif
@@ -953,16 +953,16 @@ b2d
*e = 32 - k;
#ifdef Pack_32
if (k < Ebits) {
- d0 = Exp_1 | y >> Ebits - k;
+ d0 = Exp_1 | (y >> (Ebits - k));
w = xa > xa0 ? *--xa : 0;
- d1 = y << (32-Ebits) + k | w >> Ebits - k;
+ d1 = (y << ((32-Ebits) + k)) | (w >> (Ebits - k));
goto ret_d;
}
z = xa > xa0 ? *--xa : 0;
if (k -= Ebits) {
- d0 = Exp_1 | y << k | z >> 32 - k;
+ d0 = Exp_1 | (y << k) | (z >> (32 - k));
y = xa > xa0 ? *--xa : 0;
- d1 = z << k | y >> 32 - k;
+ d1 = (z << k) | (y >> (32 - k));
} else {
d0 = Exp_1 | y;
d1 = z;
@@ -1029,13 +1029,13 @@ d2b
z |= Exp_msk11;
#endif
#else
- if (de = (int)(d0 >> Exp_shift))
+ if ( (de = (int)(d0 >> Exp_shift)) )
z |= Exp_msk1;
#endif
#ifdef Pack_32
- if (y = d1) {
- if (k = lo0bits(&y)) {
- x[0] = y | z << 32 - k;
+ if ( (y = d1) ) {
+ if ( (k = lo0bits(&y)) ) {
+ x[0] = y | (z << (32 - k));
z >>= k;
}
else
@@ -1371,9 +1371,9 @@ strtod
/* Get starting approximation = rv * 10**e1 */
if (e1 > 0) {
- if (i = e1 & 15)
+ if ( (i = e1 & 15) )
rv *= tens[i];
- if (e1 &= ~15) {
+ if ( (e1 &= ~15) ) {
if (e1 > DBL_MAX_10_EXP) {
ovfl:
errno = ERANGE;
@@ -1413,9 +1413,9 @@ strtod
}
} else if (e1 < 0) {
e1 = -e1;
- if (i = e1 & 15)
+ if ( (i = e1 & 15) )
rv /= tens[i];
- if (e1 &= ~15) {
+ if ( (e1 &= ~15) ) {
e1 >>= 4;
for (j = 0; e1 > 1; j++, e1 >>= 1)
if (e1 & 1)
@@ -1946,13 +1946,13 @@ __dtoa
#ifdef Sudden_Underflow
i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1));
#else
- if (i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1))) {
+ if ( (i = (int)((word0(d) >> Exp_shift1) & (Exp_mask>>Exp_shift1))) ) {
#endif
d2 = d;
word0(d2) &= Frac_mask1;
word0(d2) |= Exp_11;
#ifdef IBM
- if (j = 11 - hi0bits(word0(d2) & Frac_mask))
+ if ( (j = 11 - hi0bits(word0(d2) & Frac_mask)) )
d2 /= 1 << j;
#endif
@@ -1989,8 +1989,8 @@ __dtoa
/* d is denormalized */
i = bbits + be + (Bias + (P-1) - 1);
- x = i > 32 ? word0(d) << 64 - i | word1(d) >> i - 32
- : word1(d) << 32 - i;
+ x = i > 32 ? ((word0(d) << (64 - i)) | (word1(d) >> (i - 32)))
+ : (word1(d) << (32 - i));
d2 = x;
word0(d2) -= 31*Exp_msk1; /* adjust exponent */
i -= (Bias + (P-1) - 1) + 1;
@@ -2087,7 +2087,7 @@ __dtoa
ds *= bigtens[i];
}
d /= ds;
- } else if (j1 = -k) {
+ } else if ( (j1 = -k) ) {
d *= tens[j1 & 0xf];
for (j = j1 >> 4; j; j >>= 1, i++)
if (j & 1) {
@@ -2186,7 +2186,7 @@ __dtoa
*s++ = '0' + (int)L;
if (i == ilim) {
d += d;
- if (d > ds || d == ds && L & 1) {
+ if (d > ds || (d == ds && L & 1)) {
bump_up:
while (*--s == '9')
if (s == s0) {
@@ -2250,7 +2250,7 @@ __dtoa
Bfree(b);
b = b1;
}
- if (j = b5 - m5)
+ if ( (j = b5 - m5) )
b = pow5mult(b, j);
} else
b = pow5mult(b, b5);
@@ -2283,10 +2283,10 @@ __dtoa
* can do shifts and ors to compute the numerator for q.
*/
#ifdef Pack_32
- if (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f)
+ if ( (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f) )
i = 32 - i;
#else
- if (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0xf)
+ if ( (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0xf) )
i = 16 - i;
#endif
if (i > 4) {
@@ -2359,15 +2359,15 @@ __dtoa
goto ret;
}
#endif
- if (j < 0 || j == 0 && !mode
+ if (j < 0 || (j == 0 && !mode
#ifndef ROUND_BIASED
&& !(word1(d) & 1)
#endif
- ) {
+ )) {
if (j1 > 0) {
b = lshift(b, 1);
j1 = cmp(b, S);
- if ((j1 > 0 || j1 == 0 && dig & 1)
+ if ((j1 > 0 || (j1 == 0 && dig & 1))
&& dig++ == '9')
goto round_9_up;
}
@@ -2406,7 +2406,7 @@ __dtoa
b = lshift(b, 1);
j = cmp(b, S);
- if (j > 0 || j == 0 && dig & 1) {
+ if (j > 0 || (j == 0 && dig & 1)) {
roundoff:
while (*--s == '9')
if (s == s0) {
diff --git a/lib/libc/stdlib/strtol.c b/lib/libc/stdlib/strtol.c
index 3e6ec70..18e3972 100644
--- a/lib/libc/stdlib/strtol.c
+++ b/lib/libc/stdlib/strtol.c
@@ -112,7 +112,7 @@ strtol(nptr, endptr, base)
break;
if (c >= base)
break;
- if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
+ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
any = -1;
else {
any = 1;
diff --git a/lib/libc/stdlib/strtoll.c b/lib/libc/stdlib/strtoll.c
index a5720df..2666749 100644
--- a/lib/libc/stdlib/strtoll.c
+++ b/lib/libc/stdlib/strtoll.c
@@ -119,7 +119,7 @@ strtoq(nptr, endptr, base)
break;
if (c >= base)
break;
- if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
+ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
any = -1;
else {
any = 1;
diff --git a/lib/libc/stdlib/strtoq.c b/lib/libc/stdlib/strtoq.c
index a5720df..2666749 100644
--- a/lib/libc/stdlib/strtoq.c
+++ b/lib/libc/stdlib/strtoq.c
@@ -119,7 +119,7 @@ strtoq(nptr, endptr, base)
break;
if (c >= base)
break;
- if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
+ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
any = -1;
else {
any = 1;
diff --git a/lib/libc/stdlib/strtoul.c b/lib/libc/stdlib/strtoul.c
index 0bf6b82..304150a 100644
--- a/lib/libc/stdlib/strtoul.c
+++ b/lib/libc/stdlib/strtoul.c
@@ -90,7 +90,7 @@ strtoul(nptr, endptr, base)
break;
if (c >= base)
break;
- if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
+ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
any = -1;
else {
any = 1;
diff --git a/lib/libc/stdlib/strtoull.c b/lib/libc/stdlib/strtoull.c
index 16dda0b..7656a3c 100644
--- a/lib/libc/stdlib/strtoull.c
+++ b/lib/libc/stdlib/strtoull.c
@@ -97,7 +97,7 @@ strtouq(nptr, endptr, base)
break;
if (c >= base)
break;
- if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
+ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
any = -1;
else {
any = 1;
diff --git a/lib/libc/stdlib/strtouq.c b/lib/libc/stdlib/strtouq.c
index 16dda0b..7656a3c 100644
--- a/lib/libc/stdlib/strtouq.c
+++ b/lib/libc/stdlib/strtouq.c
@@ -97,7 +97,7 @@ strtouq(nptr, endptr, base)
break;
if (c >= base)
break;
- if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
+ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
any = -1;
else {
any = 1;
diff --git a/lib/libc/stdtime/strftime.c b/lib/libc/stdtime/strftime.c
index 21f2756..5e272be 100644
--- a/lib/libc/stdtime/strftime.c
+++ b/lib/libc/stdtime/strftime.c
@@ -17,7 +17,7 @@
#ifdef LIBC_RCS
static const char rcsid[] =
- "$Id: strftime.c,v 1.7 1996/05/27 04:10:27 scrappy Exp $";
+ "$Id: strftime.c,v 1.8 1996/05/27 06:54:01 scrappy Exp $";
#endif
#ifndef lint
@@ -60,7 +60,6 @@ struct lc_time_T {
};
static struct lc_time_T localebuf;
-static struct lc_time_T * _loc P((void));
static int using_locale;
#define Locale (using_locale ? &localebuf : &C_time_locale)
diff --git a/lib/libc/string/strcoll.c b/lib/libc/string/strcoll.c
index c8fff23..405a78b 100644
--- a/lib/libc/string/strcoll.c
+++ b/lib/libc/string/strcoll.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: strcoll.c,v 1.4 1995/04/16 22:43:45 ache Exp $
+ * $Id: strcoll.c,v 1.5 1996/06/09 14:56:06 ache Exp $
*/
#include <stdlib.h>
@@ -51,8 +51,8 @@ strcoll(s, s2)
return (-1);
else if (islower(*us1) && isupper(*us2))
return (1);
- *us1++;
- *us2++;
+ us1++;
+ us2++;
}
return (tolower(*us1) - tolower(*us2));
}
diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c
index 9554394..72f57e9 100644
--- a/lib/libc/yp/yplib.c
+++ b/lib/libc/yp/yplib.c
@@ -28,7 +28,7 @@
*/
#ifndef LINT
-static char *rcsid = "$Id: yplib.c,v 1.21 1996/06/03 13:19:10 jraynard Exp $";
+static char *rcsid = "$Id: yplib.c,v 1.22 1996/06/04 17:35:15 jraynard Exp $";
#endif
#include <sys/param.h>
@@ -217,7 +217,7 @@ _yp_dobind(dom, ypdb)
struct ypbind_resp ypbr;
struct timeval tv;
struct sockaddr_in clnt_sin;
- int clnt_sock, lfd, fd;
+ int clnt_sock, fd;
pid_t gpid;
CLIENT *client;
int new = 0, r;
diff --git a/lib/libcom_err/error_message.c b/lib/libcom_err/error_message.c
index 99dab1e..51ac568 100644
--- a/lib/libcom_err/error_message.c
+++ b/lib/libcom_err/error_message.c
@@ -1,6 +1,6 @@
/*
- * $Header: error_message.c,v 1.2 89/01/25 09:08:57 shanzer Exp $
- * $Source: /paris/source/4.3/athena.lib/et.new/RCS/error_message.c,v $
+ * $Header: /home/ncvs/src/lib/libcom_err/error_message.c,v 1.1.1.1 1995/01/14 22:23:41 wollman Exp $
+ * $Source: /home/ncvs/src/lib/libcom_err/error_message.c,v $
* $Locker: $
*
* Copyright 1987 by the Student Information Processing Board
@@ -10,12 +10,13 @@
*/
#include <stdio.h>
+#include <string.h>
#include "error_table.h"
#include "mit-sipb-copyright.h"
#include "internal.h"
static const char rcsid[] =
- "$Header: error_message.c,v 1.2 89/01/25 09:08:57 shanzer Exp $";
+ "$Header: /home/ncvs/src/lib/libcom_err/error_message.c,v 1.1.1.1 1995/01/14 22:23:41 wollman Exp $";
static const char copyright[] =
"Copyright 1986, 1987, 1988 by the Student Information Processing Board\nand the department of Information Systems\nof the Massachusetts Institute of Technology";
diff --git a/lib/libcompat/4.1/ftime.3 b/lib/libcompat/4.1/ftime.3
index 61d02a6..c1e9c3a 100644
--- a/lib/libcompat/4.1/ftime.3
+++ b/lib/libcompat/4.1/ftime.3
@@ -40,7 +40,7 @@
.Sh SYNOPSIS
.Fd #include <sys/types.h>
.Fd #include <sys/timeb.h>
-.Ft struct timeb *
+.Ft int
.Fn ftime "struct timeb *tp"
.Sh DESCRIPTION
.Bf -symbolic
diff --git a/lib/libcompat/4.1/ftime.c b/lib/libcompat/4.1/ftime.c
index ccd3a64..8f6efb1 100644
--- a/lib/libcompat/4.1/ftime.c
+++ b/lib/libcompat/4.1/ftime.c
@@ -29,13 +29,14 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: ftime.c,v 1.3 1994/05/06 06:42:21 cgd Exp $";
+static char rcsid[] = "$Id: ftime.c,v 1.1.1.1 1994/05/27 10:33:22 rgrimes Exp $";
#endif /* not lint */
#include <sys/types.h>
#include <sys/time.h>
#include <sys/timeb.h>
+int
ftime(tbp)
struct timeb *tbp;
{
diff --git a/lib/libcompat/4.3/cfree.c b/lib/libcompat/4.3/cfree.c
index 8bade2e..7f029ff 100644
--- a/lib/libcompat/4.3/cfree.c
+++ b/lib/libcompat/4.3/cfree.c
@@ -35,6 +35,8 @@
static char sccsid[] = "@(#)cfree.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
+#include <stdlib.h>
+
void
cfree(p)
void *p;
diff --git a/lib/libcompat/4.3/insque.c b/lib/libcompat/4.3/insque.c
index 55818fd..3035976 100644
--- a/lib/libcompat/4.3/insque.c
+++ b/lib/libcompat/4.3/insque.c
@@ -46,6 +46,7 @@ struct vaxque { /* queue format expected by VAX queue instructions */
struct vaxque *vq_prev;
};
+void
insque(e, prev)
register struct vaxque *e, *prev;
{
diff --git a/lib/libcompat/4.3/lsearch.c b/lib/libcompat/4.3/lsearch.c
index baf90ed..be650b4 100644
--- a/lib/libcompat/4.3/lsearch.c
+++ b/lib/libcompat/4.3/lsearch.c
@@ -40,6 +40,7 @@ static char sccsid[] = "@(#)lsearch.c 8.1 (Berkeley) 6/4/93";
#include <sys/types.h>
#include <unistd.h>
+#include <string.h>
static char *linear_base();
diff --git a/lib/libcompat/4.3/remque.c b/lib/libcompat/4.3/remque.c
index 39ebfe0..e0f9aa3 100644
--- a/lib/libcompat/4.3/remque.c
+++ b/lib/libcompat/4.3/remque.c
@@ -46,6 +46,7 @@ struct vaxque { /* queue format expected by VAX queue instructions */
struct vaxque *vq_prev;
};
+void
remque(e)
register struct vaxque *e;
{
diff --git a/lib/libcompat/4.3/rexec.c b/lib/libcompat/4.3/rexec.c
index 5b1afc8..beb2108 100644
--- a/lib/libcompat/4.3/rexec.c
+++ b/lib/libcompat/4.3/rexec.c
@@ -291,6 +291,7 @@ bad:
return (-1);
}
+int
rexec(ahost, rport, name, pass, cmd, fd2p)
char **ahost;
int rport;
diff --git a/lib/libcrypt/crypt.c b/lib/libcrypt/crypt.c
index 0b47561..7f980e5 100644
--- a/lib/libcrypt/crypt.c
+++ b/lib/libcrypt/crypt.c
@@ -6,16 +6,17 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: crypt.c,v 1.2 1994/11/07 21:07:09 phk Exp $
+ * $Id: crypt.c,v 1.3 1995/05/30 05:42:22 rgrimes Exp $
*
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Header: /home/ncvs/src/lib/libcrypt/crypt.c,v 1.2 1994/11/07 21:07:09 phk Exp $";
+static char rcsid[] = "$Header: /home/ncvs/src/lib/libcrypt/crypt.c,v 1.3 1995/05/30 05:42:22 rgrimes Exp $";
#endif /* LIBC_SCCS and not lint */
#include <unistd.h>
#include <stdio.h>
+#include <string.h>
#include <md5.h>
static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */
diff --git a/lib/libcurses/cr_put.c b/lib/libcurses/cr_put.c
index b69b01a..f17bb2a 100644
--- a/lib/libcurses/cr_put.c
+++ b/lib/libcurses/cr_put.c
@@ -298,7 +298,7 @@ plod(cnt, in_refresh)
* If it will be cheaper, or if we can't back up, then send a return
* preliminarily.
*/
- if (j > i + 1 || outcol > destcol && !BS && !BC) {
+ if ((j > i + 1) || (outcol > destcol && !BS && !BC)) {
/*
* BUG: this doesn't take the (possibly long) length of CR
* into account.
diff --git a/lib/libcurses/cur_hash.c b/lib/libcurses/cur_hash.c
index de6ab11..b358184 100644
--- a/lib/libcurses/cur_hash.c
+++ b/lib/libcurses/cur_hash.c
@@ -52,7 +52,7 @@ __hash(s, len)
i = 0;
while (i < len) {
h = (h << 4) + s[i];
- if (g = h & 0xf0000000) {
+ if ( (g = h & 0xf0000000) ) {
h = h ^ (g >> 24);
h = h ^ g;
}
diff --git a/lib/libcurses/refresh.c b/lib/libcurses/refresh.c
index 6350f1f..1719454 100644
--- a/lib/libcurses/refresh.c
+++ b/lib/libcurses/refresh.c
@@ -745,7 +745,7 @@ scrolln(starts, startw, curs, bot, top)
if (n > 0) {
/* Scroll up the screen. */
- if ((!DB && SF != NULL || n == 1) && bot == curscr->maxy - 1 && top == 0) {
+ if (((!DB && SF != NULL) || n == 1) && (bot == curscr->maxy - 1) && top == 0) {
__mvcur(oy, ox, curscr->maxy - 1, 0, 1);
if (n == 1)
goto f_nl1;
@@ -807,7 +807,7 @@ scrolln(starts, startw, curs, bot, top)
/* Scroll down the screen. */
if (!DA && (SR != NULL || sr != NULL) && bot == curscr->maxy - 1 && top == 0) {
__mvcur(oy, ox, 0, 0, 1);
- if (SR == NULL || sr != NULL && -n == 1) {
+ if (SR == NULL || (sr != NULL && -n == 1)) {
for (i = n; i < 0; i++)
tputs(sr, 1, __cputchar);
} else
diff --git a/lib/libcurses/setterm.c b/lib/libcurses/setterm.c
index 14ce6ee..252c599 100644
--- a/lib/libcurses/setterm.c
+++ b/lib/libcurses/setterm.c
@@ -156,13 +156,13 @@ setterm(type)
ttytype = longname(genbuf, __ttytype);
__usecs =
- (AL == NULL && al == NULL || DL == NULL && dl == NULL) &&
- !NS && (SC != NULL && RC != NULL || HO != NULL) &&
+ ((AL == NULL && al == NULL) || (DL == NULL && dl == NULL)) &&
+ !NS && ((SC != NULL && RC != NULL) || HO != NULL) &&
CS != NULL && (SR != NULL || sr != NULL);
/* If no scrolling commands, no quick change. */
__noqch = !__usecs &&
- (AL == NULL && al == NULL || DL == NULL && dl == NULL);
+ ((AL == NULL && al == NULL) || (DL == NULL && dl == NULL));
return (unknown ? ERR : OK);
}
diff --git a/lib/libedit/term.c b/lib/libedit/term.c
index f98d02f..6563f63 100644
--- a/lib/libedit/term.c
+++ b/lib/libedit/term.c
@@ -51,6 +51,7 @@ static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95";
#include <unistd.h>
#include <termcap.h>
#include <sys/types.h>
+#include <sys/ioctl.h>
#include "el.h"
diff --git a/lib/libipx/ipx_addr.c b/lib/libipx/ipx_addr.c
index 65fbd6f..b83f8be 100644
--- a/lib/libipx/ipx_addr.c
+++ b/lib/libipx/ipx_addr.c
@@ -64,7 +64,7 @@ ipx_addr(name)
* form 2-272.AA001234H.01777, i.e. XDE standard.
* Great efforts are made to insure backward compatability.
*/
- if (hostname = strchr(buf, '#'))
+ if ( (hostname = strchr(buf, '#')) )
separator = '#';
else {
hostname = strchr(buf, '.');
diff --git a/lib/libkvm/kvm_amd64.c b/lib/libkvm/kvm_amd64.c
index 764a2d1..efb4a53 100644
--- a/lib/libkvm/kvm_amd64.c
+++ b/lib/libkvm/kvm_amd64.c
@@ -48,6 +48,7 @@ static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93";
#include <sys/user.h>
#include <sys/proc.h>
#include <sys/stat.h>
+#include <stdlib.h>
#include <unistd.h>
#include <nlist.h>
#include <kvm.h>
diff --git a/lib/libkvm/kvm_file.c b/lib/libkvm/kvm_file.c
index 4cd3615..c4cede3 100644
--- a/lib/libkvm/kvm_file.c
+++ b/lib/libkvm/kvm_file.c
@@ -71,7 +71,7 @@ static char sccsid[] = "@(#)kvm_file.c 8.1 (Berkeley) 6/4/93";
/*
* Get file structures.
*/
-static
+static int
kvm_deadfiles(kd, op, arg, filehead_o, nfiles)
kvm_t *kd;
int op, arg, nfiles;
diff --git a/lib/libkvm/kvm_getloadavg.c b/lib/libkvm/kvm_getloadavg.c
index e13ee1d..3368e63 100644
--- a/lib/libkvm/kvm_getloadavg.c
+++ b/lib/libkvm/kvm_getloadavg.c
@@ -42,6 +42,7 @@ static char sccsid[] = "@(#)kvm_getloadavg.c 8.1 (Berkeley) 6/4/93";
#include <sys/sysctl.h>
#include <vm/vm_param.h>
+#include <stdlib.h>
#include <db.h>
#include <fcntl.h>
#include <limits.h>
diff --git a/lib/libkvm/kvm_i386.c b/lib/libkvm/kvm_i386.c
index 764a2d1..efb4a53 100644
--- a/lib/libkvm/kvm_i386.c
+++ b/lib/libkvm/kvm_i386.c
@@ -48,6 +48,7 @@ static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93";
#include <sys/user.h>
#include <sys/proc.h>
#include <sys/stat.h>
+#include <stdlib.h>
#include <unistd.h>
#include <nlist.h>
#include <kvm.h>
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c
index bb352d3..6a0df4a 100644
--- a/lib/libkvm/kvm_proc.c
+++ b/lib/libkvm/kvm_proc.c
@@ -54,6 +54,8 @@ static char sccsid[] = "@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93";
#include <sys/ioctl.h>
#include <sys/tty.h>
#include <sys/file.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <unistd.h>
#include <nlist.h>
#include <kvm.h>
@@ -71,6 +73,7 @@ static char sccsid[] = "@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93";
#include "kvm_private.h"
+#if used
static char *
kvm_readswap(kd, p, va, cnt)
kvm_t *kd;
@@ -84,6 +87,7 @@ kvm_readswap(kd, p, va, cnt)
return(0);
#endif /* __FreeBSD__ */
}
+#endif
#define KREAD(kd, addr, obj) \
(kvm_read(kd, addr, (char *)(obj), sizeof(*obj)) != sizeof(*obj))
@@ -113,8 +117,8 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
return (-1);
}
if (KREAD(kd, (u_long)proc.p_cred, &eproc.e_pcred) == 0)
- KREAD(kd, (u_long)eproc.e_pcred.pc_ucred,
- &eproc.e_ucred);
+ (void)(KREAD(kd, (u_long)eproc.e_pcred.pc_ucred,
+ &eproc.e_ucred));
switch(what) {
@@ -659,7 +663,7 @@ kvm_getenvv(kd, kp, nchr)
ssize_t
kvm_uread(kd, p, uva, buf, len)
kvm_t *kd;
- register struct proc *p;
+ register const struct proc *p;
register u_long uva;
register char *buf;
register size_t len;
diff --git a/lib/libpcap/inet.c b/lib/libpcap/inet.c
index 004e275..3092011 100644
--- a/lib/libpcap/inet.c
+++ b/lib/libpcap/inet.c
@@ -33,7 +33,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: inet.c,v 1.4 94/06/07 01:16:50 leres Exp $ (LBL)";
+ "@(#) $Header: /home/ncvs/src/lib/libpcap/inet.c,v 1.1.1.1 1995/01/20 04:13:03 jkh Exp $ (LBL)";
#endif
#include <sys/param.h>
@@ -186,7 +186,7 @@ pcap_lookupnet(device, netp, maskp, errbuf)
else if (IN_CLASSC(*netp))
*maskp = IN_CLASSC_NET;
else {
- (void)sprintf(errbuf, "inet class for 0x%x unknown",
+ (void)sprintf(errbuf, "inet class for 0x%lx unknown",
*netp);
return (-1);
}
diff --git a/lib/libpcap/nametoaddr.c b/lib/libpcap/nametoaddr.c
index 9732f97..59e7439 100644
--- a/lib/libpcap/nametoaddr.c
+++ b/lib/libpcap/nametoaddr.c
@@ -24,7 +24,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: /home/ncvs/src/lib/libpcap/nametoaddr.c,v 1.1.1.1 1995/01/20 04:13:03 jkh Exp $ (LBL)";
+ "@(#) $Header: /home/ncvs/src/lib/libpcap/nametoaddr.c,v 1.2 1995/05/30 05:47:21 rgrimes Exp $ (LBL)";
#endif
#include <sys/param.h>
@@ -40,6 +40,7 @@ static char rcsid[] =
#include <pcap.h>
#include <pcap-namedb.h>
#include <stdio.h>
+#include <stdlib.h>
#include "gencode.h"
diff --git a/lib/libpcap/optimize.c b/lib/libpcap/optimize.c
index 50eb88e..c198e36 100644
--- a/lib/libpcap/optimize.c
+++ b/lib/libpcap/optimize.c
@@ -22,7 +22,7 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#) $Header: optimize.c,v 1.45 94/06/20 19:07:55 leres Exp $ (LBL)";
+ "@(#) $Header: /home/ncvs/src/lib/libpcap/optimize.c,v 1.1.1.1 1995/01/20 04:13:03 jkh Exp $ (LBL)";
#endif
#include <sys/types.h>
@@ -31,6 +31,7 @@ static char rcsid[] =
#include <net/bpf.h>
#include <stdio.h>
+#include <stdlib.h>
#ifdef __osf__
#include <stdlib.h>
#include <malloc.h>
diff --git a/lib/libpcap/pcap-bpf.c b/lib/libpcap/pcap-bpf.c
index 39e6197..b576f04 100644
--- a/lib/libpcap/pcap-bpf.c
+++ b/lib/libpcap/pcap-bpf.c
@@ -20,10 +20,12 @@
*/
#ifndef lint
static char rcsid[] =
- "@(#)$Header: pcap-bpf.c,v 1.14 94/06/03 19:58:49 leres Exp $ (LBL)";
+ "@(#)$Header: /home/ncvs/src/lib/libpcap/pcap-bpf.c,v 1.1.1.1 1995/01/20 04:13:03 jkh Exp $ (LBL)";
#endif
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
#include <netdb.h>
#include <ctype.h>
#include <signal.h>
diff --git a/lib/libpcap/pcap.c b/lib/libpcap/pcap.c
index 44d65ae..398b6f3 100644
--- a/lib/libpcap/pcap.c
+++ b/lib/libpcap/pcap.c
@@ -33,11 +33,12 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Header: /home/ncvs/src/lib/libpcap/pcap.c,v 1.2 1995/02/23 06:55:14 phk Exp $ (LBL)";
+ "@(#) $Header: /home/ncvs/src/lib/libpcap/pcap.c,v 1.3 1995/05/30 05:47:24 rgrimes Exp $ (LBL)";
#endif
#include <sys/types.h>
+#include <stdlib.h>
#include <unistd.h>
#include <string.h>
diff --git a/lib/libskey/skey.h b/lib/libskey/skey.h
index 039da4e..6cf9d95 100644
--- a/lib/libskey/skey.h
+++ b/lib/libskey/skey.h
@@ -25,9 +25,14 @@ void f __P((char *x));
int keycrunch __P((char *result,char *seed,char *passwd));
char *btoe __P((char *engout,char *c));
char *put8 __P((char *out,char *s));
+int atob8 __P((char *out, char *in));
+int btoa8 __P((char *out, char *in));
+int htoi __P((char c));
int etob __P((char *out,char *e));
+void sevenbit __P((char *s));
void rip __P((char *buf));
int skeychallenge __P((struct skey *mp,char *name, char *challenge));
+int skeyinfo __P((struct skey *mp, char* name, char *ss));
int skeylookup __P((struct skey *mp,char *name));
int skeyverify __P((struct skey *mp,char *response));
diff --git a/lib/libskey/skeyaccess.c b/lib/libskey/skeyaccess.c
index 3cb707f..b257646 100644
--- a/lib/libskey/skeyaccess.c
+++ b/lib/libskey/skeyaccess.c
@@ -80,6 +80,8 @@ struct login_info {
char *port; /* login port */
};
+static int _skeyaccess __P(( FILE *, struct login_info * ));
+
/* skeyaccess - find out if UNIX passwords are permitted */
int skeyaccess(user, port, host, addr)
@@ -157,14 +159,14 @@ char *addr;
/* _skeyaccess - find out if UNIX passwords are permitted */
-int _skeyaccess(fp, login_info)
+static int _skeyaccess(fp, login_info)
FILE *fp;
struct login_info *login_info;
{
char buf[BUFSIZ];
char *tok;
int match;
- int permission;
+ int permission=DENY;
#ifdef PERMIT_CONSOLE
if (login_info->port != 0 && strcasecmp(login_info->port, CONSOLE) == 0)
@@ -313,7 +315,7 @@ static char *get_token()
{
char *cp;
- if (cp = prev_token) {
+ if ( (cp = prev_token) ) {
prev_token = 0;
} else {
while ((cp = strsep(&line_pointer, " \t")) != NULL && *cp == '\0')
diff --git a/lib/libskey/skeylogin.c b/lib/libskey/skeylogin.c
index ee9c277..1d48988 100644
--- a/lib/libskey/skeylogin.c
+++ b/lib/libskey/skeylogin.c
@@ -12,6 +12,7 @@
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -174,16 +175,12 @@ skeyverify(mp,response)
struct skey *mp;
char *response;
{
- struct timeval startval;
- struct timeval endval;
char key[8];
char fkey[8];
char filekey[8];
time_t now;
struct tm *tm;
- char tbuf[27],buf[60];
- char me[80];
- int rval;
+ char tbuf[27];
char *cp, *p;
time(&now);
@@ -266,6 +263,7 @@ char *response;
/* Convert 8-byte hex-ascii string to binary array
* Returns 0 on success, -1 on error
*/
+int
atob8(out,in)
register char *out,*in;
{
diff --git a/lib/libskey/skeysubr.c b/lib/libskey/skeysubr.c
index 68564cf..2bd344f 100644
--- a/lib/libskey/skeysubr.c
+++ b/lib/libskey/skeysubr.c
@@ -118,6 +118,7 @@ int n;
return buf;
}
+void
sevenbit(s)
char *s;
{
diff --git a/lib/libss/data.c b/lib/libss/data.c
index dd6341c..45e49d7 100644
--- a/lib/libss/data.c
+++ b/lib/libss/data.c
@@ -9,7 +9,7 @@
#include "ss_internal.h"
#include "copyright.h"
-const static char copyright[] =
+static const char copyright[] =
"Copyright 1987, 1988, 1989 by the Massachusetts Institute of Technology";
ss_data **_ss_table = (ss_data **)NULL;
diff --git a/lib/libss/error.c b/lib/libss/error.c
index 3946359..223d72a 100644
--- a/lib/libss/error.c
+++ b/lib/libss/error.c
@@ -6,6 +6,7 @@
*/
#include <stdio.h>
+#include <stdlib.h>
/*
* Our standalone dpANS environment on the RT doesn't include any
@@ -25,6 +26,8 @@
#undef ss_error
+extern void com_err_va __P(( ));
+
char * ss_name(sci_idx)
int sci_idx;
{
diff --git a/lib/libss/execute_cmd.c b/lib/libss/execute_cmd.c
index d663b69..1bb0129 100644
--- a/lib/libss/execute_cmd.c
+++ b/lib/libss/execute_cmd.c
@@ -7,6 +7,7 @@
#include "ss_internal.h"
#include "copyright.h"
#include <stdio.h>
+#include <stdlib.h>
#ifndef lint
static char const rcsid[] =
@@ -153,6 +154,7 @@ static int really_execute_command (sci_idx, argc, argv)
* Notes:
*/
+int
ss_execute_command(sci_idx, argv)
int sci_idx;
register char *argv[];
diff --git a/lib/libss/help.c b/lib/libss/help.c
index 0a8edd2..c6e99d8 100644
--- a/lib/libss/help.c
+++ b/lib/libss/help.c
@@ -7,6 +7,8 @@
#include <sys/param.h>
#include <sys/file.h>
#include <sys/wait.h>
+#include <stdlib.h>
+#include <unistd.h>
#include "ss_internal.h"
#include "copyright.h"
diff --git a/lib/libss/invocation.c b/lib/libss/invocation.c
index 6f749df..513ec7d 100644
--- a/lib/libss/invocation.c
+++ b/lib/libss/invocation.c
@@ -3,6 +3,8 @@
*
* For copyright information, see copyright.h.
*/
+
+#include <stdlib.h>
#include "ss_internal.h"
#include "copyright.h"
#define size sizeof(ss_data *)
diff --git a/lib/libss/list_rqs.c b/lib/libss/list_rqs.c
index 95fe904..14e7748 100644
--- a/lib/libss/list_rqs.c
+++ b/lib/libss/list_rqs.c
@@ -20,6 +20,7 @@ static char const twentyfive_spaces[26] =
" ";
static char const NL[2] = "\n";
+void
ss_list_requests(argc, argv, sci_idx, info_ptr)
int argc;
char **argv;
diff --git a/lib/libss/listen.c b/lib/libss/listen.c
index 1633827..8420ad7 100644
--- a/lib/libss/listen.c
+++ b/lib/libss/listen.c
@@ -65,7 +65,6 @@ int ss_listen (sci_idx)
register ss_data *info;
sigtype (*sig_int)(), (*old_sig_cont)();
char input[BUFSIZ];
- char expanded_input[BUFSIZ];
char buffer[BUFSIZ];
char *end = buffer;
int mask;
@@ -134,14 +133,14 @@ egress:
}
void ss_abort_subsystem(sci_idx, code)
- int sci_idx;
+ int sci_idx, code;
{
ss_info(sci_idx)->abort = 1;
ss_info(sci_idx)->exit_status = code;
}
-int ss_quit(argc, argv, sci_idx, infop)
+void ss_quit(argc, argv, sci_idx, infop)
int argc;
char **argv;
int sci_idx;
diff --git a/lib/libss/pager.c b/lib/libss/pager.c
index fac80bd..b419725 100644
--- a/lib/libss/pager.c
+++ b/lib/libss/pager.c
@@ -12,6 +12,7 @@
#include <stdio.h>
#include <sys/file.h>
#include <signal.h>
+#include <unistd.h>
static char MORE[] = "more";
extern char *_ss_pager_name;
diff --git a/lib/libss/parse.c b/lib/libss/parse.c
index 4c91638..8a61ea8 100644
--- a/lib/libss/parse.c
+++ b/lib/libss/parse.c
@@ -4,6 +4,7 @@
* For copyright info, see copyright.h.
*/
+#include <stdlib.h>
#include "ss_internal.h"
#include "copyright.h"
diff --git a/lib/libss/prompt.c b/lib/libss/prompt.c
index 60a5985..d6f5ff8 100644
--- a/lib/libss/prompt.c
+++ b/lib/libss/prompt.c
@@ -16,6 +16,7 @@
static const char rcsid[] =
"Header: prompt.c,v 1.2 89/01/18 18:27:02 raeburn Exp ";
+void
ss_set_prompt(sci_idx, new_prompt)
int sci_idx;
char *new_prompt;
diff --git a/lib/libss/request_tbl.c b/lib/libss/request_tbl.c
index 8dcb583..b860064 100644
--- a/lib/libss/request_tbl.c
+++ b/lib/libss/request_tbl.c
@@ -4,11 +4,13 @@
* For copyright information, see copyright.h.
*/
+#include <stdlib.h>
#include "copyright.h"
#include "ss_internal.h"
#define ssrt ss_request_table /* for some readable code... */
+void
ss_add_request_table(sci_idx, rqtbl_ptr, position, code_ptr)
int sci_idx;
ssrt *rqtbl_ptr;
@@ -41,6 +43,7 @@ ss_add_request_table(sci_idx, rqtbl_ptr, position, code_ptr)
*code_ptr = 0;
}
+void
ss_delete_request_table(sci_idx, rqtbl_ptr, code_ptr)
int sci_idx;
ssrt *rqtbl_ptr;
diff --git a/lib/libss/requests.c b/lib/libss/requests.c
index e4143f4..7aaf4f5 100644
--- a/lib/libss/requests.c
+++ b/lib/libss/requests.c
@@ -15,6 +15,7 @@
/*
* ss_self_identify -- assigned by default to the "." request
*/
+void
DECLARE(ss_self_identify)
{
register ss_data *info = ss_info(sci_idx);
@@ -25,6 +26,7 @@ DECLARE(ss_self_identify)
/*
* ss_subsystem_name -- print name of subsystem
*/
+void
DECLARE(ss_subsystem_name)
{
printf("%s\n", ss_info(sci_idx)->subsystem_name);
@@ -33,6 +35,7 @@ DECLARE(ss_subsystem_name)
/*
* ss_subsystem_version -- print version of subsystem
*/
+void
DECLARE(ss_subsystem_version)
{
printf("%s\n", ss_info(sci_idx)->subsystem_version);
@@ -42,6 +45,7 @@ DECLARE(ss_subsystem_version)
* ss_unimplemented -- routine not implemented (should be
* set up as (dont_list,dont_summarize))
*/
+void
DECLARE(ss_unimplemented)
{
ss_perror(sci_idx, SS_ET_UNIMPLEMENTED, "");
diff --git a/lib/libss/ss_internal.h b/lib/libss/ss_internal.h
index 5e43717..e613488 100644
--- a/lib/libss/ss_internal.h
+++ b/lib/libss/ss_internal.h
@@ -105,9 +105,11 @@ void ss_page_stdin();
extern ss_data **_ss_table;
extern char *ss_et_msgs[];
+#ifndef __FreeBSD__
extern pointer malloc PROTOTYPE((unsigned));
extern pointer realloc PROTOTYPE((pointer, unsigned));
extern pointer calloc PROTOTYPE((unsigned, unsigned));
extern int exit PROTOTYPE((int));
+#endif
#endif /* _ss_internal_h */
diff --git a/lib/libtelnet/genget.c b/lib/libtelnet/genget.c
index a43579f..29c7519 100644
--- a/lib/libtelnet/genget.c
+++ b/lib/libtelnet/genget.c
@@ -49,7 +49,6 @@ static char sccsid[] = "@(#)genget.c 8.1 (Berkeley) 6/4/93";
isprefix(s1, s2)
register char *s1, *s2;
{
- register int n = 0;
char *os1;
register char c1, c2;
diff --git a/lib/libtelnet/getent.c b/lib/libtelnet/getent.c
index 05626f1..e87bf66 100644
--- a/lib/libtelnet/getent.c
+++ b/lib/libtelnet/getent.c
@@ -35,9 +35,12 @@
static char sccsid[] = "@(#)getent.c 8.2 (Berkeley) 12/15/93";
#endif /* not lint */
+#include <stdlib.h>
+
static char *area;
/*ARGSUSED*/
+int
getent(cp, name)
char *cp, *name;
{
diff --git a/lib/libtelnet/misc.c b/lib/libtelnet/misc.c
index 241c88a..d4242b6 100644
--- a/lib/libtelnet/misc.c
+++ b/lib/libtelnet/misc.c
@@ -35,6 +35,8 @@
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/4/93";
#endif /* not lint */
+#include <stdio.h>
+#include <stdlib.h>
#include "misc.h"
char *RemoteHostName;
diff --git a/lib/libtermcap/termcap.3 b/lib/libtermcap/termcap.3
index 3867f70..47103af 100644
--- a/lib/libtermcap/termcap.3
+++ b/lib/libtermcap/termcap.3
@@ -60,7 +60,7 @@
.Fn tgetstr "const char *id" "char **area"
.Ft char *
.Fn tgoto "const char *cm" "int destcol" "int destline"
-.Ft int
+.Ft void
.Fn tputs "const char *cp" "int affcnt" "int (*outc)(int)"
.Ft char *
.Fn tparm "const char *cp" "..."
diff --git a/lib/libtermcap/termcap.c b/lib/libtermcap/termcap.c
index 7f8d39d..38cb1a2 100644
--- a/lib/libtermcap/termcap.c
+++ b/lib/libtermcap/termcap.c
@@ -101,10 +101,10 @@ tgetent(char *bp, const char *name)
* becomes "$HOME/.termcap /etc/termcap" if no TERMPATH exists.
*/
if (!cp || *cp != '/') { /* no TERMCAP or it holds an entry */
- if (termpath = getenv("TERMPATH"))
+ if ( (termpath = getenv("TERMPATH")) )
strncpy(pathbuf, termpath, PBUFSIZ);
else {
- if (home = getenv("HOME")) { /* set up default */
+ if ( (home = getenv("HOME")) ) {/* set up default */
p += strlen(home); /* path, looking in */
strcpy(pathbuf, home); /* $HOME first */
*p++ = '/';
diff --git a/lib/libtermcap/termcap.h b/lib/libtermcap/termcap.h
index 6e2ef39..38ded02 100644
--- a/lib/libtermcap/termcap.h
+++ b/lib/libtermcap/termcap.h
@@ -24,7 +24,7 @@
* SUCH DAMAGE.
*/
-/* $Id: termcap.h,v 1.5 1995/08/04 06:39:54 ache Exp $ */
+/* $Id: termcap.h,v 1.6 1995/08/05 21:21:54 ache Exp $ */
#ifndef _TERMCAP_H_
#define _TERMCAP_H_
@@ -41,7 +41,7 @@ extern int tgetflag __P((const char *));
extern int tgetnum __P((const char *));
extern char *tgetstr __P((const char *, char **));
-extern int tputs __P((const char *, int, int (*)(int)));
+extern void tputs __P((const char *, int, int (*)(int)));
extern char *tgoto __P((const char *, int, int));
extern char *tparm __P((const char *, ...));
diff --git a/lib/libtermcap/tgoto.c b/lib/libtermcap/tgoto.c
index e28a85c..85b8d57 100644
--- a/lib/libtermcap/tgoto.c
+++ b/lib/libtermcap/tgoto.c
@@ -35,6 +35,7 @@
static char sccsid[] = "@(#)tgoto.c 8.1 (Berkeley) 6/4/93";
#endif /* not lint */
+#include <string.h>
#include "termcap.h"
#define CTRL(c) ((c) & 037)
@@ -87,7 +88,7 @@ toohard:
return ("OOPS");
}
added[0] = 0;
- while (c = *cp++) {
+ while ( (c = *cp++) ) {
if (c != '%') {
*dp++ = c;
continue;
diff --git a/lib/libtermcap/tputs.c b/lib/libtermcap/tputs.c
index 46b6dc2..6cfdeed 100644
--- a/lib/libtermcap/tputs.c
+++ b/lib/libtermcap/tputs.c
@@ -57,6 +57,7 @@ char PC;
* The number of affected lines is affcnt, and the routine
* used to output one character is outc.
*/
+void
tputs(const char *cp, int affcnt, int (*outc)(int))
{
register int i = 0;
diff --git a/lib/libutil/pty.c b/lib/libutil/pty.c
index 515ff9e..b00d687 100644
--- a/lib/libutil/pty.c
+++ b/lib/libutil/pty.c
@@ -100,6 +100,7 @@ openpty(amaster, aslave, name, termp, winp)
return (-1);
}
+int
forkpty(amaster, name, termp, winp)
int *amaster;
char *name;
diff --git a/lib/libutil/setproctitle.c b/lib/libutil/setproctitle.c
index 08efa99..1f9f4b5 100644
--- a/lib/libutil/setproctitle.c
+++ b/lib/libutil/setproctitle.c
@@ -14,7 +14,7 @@
* 3. Absolutely no warranty of function or purpose is made by the author
* Peter Wemm.
*
- * $Id: setproctitle.c,v 1.1 1995/12/26 22:50:08 peter Exp $
+ * $Id: setproctitle.c,v 1.2 1996/02/24 14:37:29 peter Exp $
*/
#include <sys/types.h>
@@ -67,7 +67,6 @@ setproctitle(fmt, va_alist)
va_dcl
#endif
{
- char *p;
static char buf[SPT_BUFSIZE];
static char *ps_argv[2];
va_list ap;
diff --git a/lib/liby/main.c b/lib/liby/main.c
index cd288e0..4b4e67a 100644
--- a/lib/liby/main.c
+++ b/lib/liby/main.c
@@ -35,7 +35,8 @@
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/4/93";
#endif /* not lint */
-main()
+int
+main(void)
{
exit(yyparse());
}
diff --git a/lib/liby/yyerror.c b/lib/liby/yyerror.c
index 6465e23..b21a7a8 100644
--- a/lib/liby/yyerror.c
+++ b/lib/liby/yyerror.c
@@ -37,6 +37,7 @@ static char sccsid[] = "@(#)yyerror.c 8.1 (Berkeley) 6/4/93";
#include <stdio.h>
+int
yyerror(msg)
char *msg;
{
diff --git a/lib/msun/src/e_asin.c b/lib/msun/src/e_asin.c
index 390ea5f..6863668 100644
--- a/lib/msun/src/e_asin.c
+++ b/lib/msun/src/e_asin.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: e_asin.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $";
+static char rcsid[] = "$Id: e_asin.c,v 1.2 1995/05/30 05:47:55 rgrimes Exp $";
#endif
/* __ieee754_asin(x)
@@ -77,7 +77,7 @@ qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
double x;
#endif
{
- double t,w,p,q,c,r,s;
+ double t=0.0,w,p,q,c,r,s;
int32_t hx,ix;
GET_HIGH_WORD(hx,x);
ix = hx&0x7fffffff;
diff --git a/lib/msun/src/e_asinf.c b/lib/msun/src/e_asinf.c
index 1f07579..6d6ba85 100644
--- a/lib/msun/src/e_asinf.c
+++ b/lib/msun/src/e_asinf.c
@@ -14,7 +14,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: e_asinf.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $";
+static char rcsid[] = "$Id: e_asinf.c,v 1.2 1995/05/30 05:47:56 rgrimes Exp $";
#endif
#include "math.h"
@@ -49,7 +49,7 @@ qS4 = 7.7038154006e-02; /* 0x3d9dc62e */
float x;
#endif
{
- float t,w,p,q,c,r,s;
+ float t=0.0,w,p,q,c,r,s;
int32_t hx,ix;
GET_FLOAT_WORD(hx,x);
ix = hx&0x7fffffff;
diff --git a/lib/msun/src/e_atan2.c b/lib/msun/src/e_atan2.c
index 233d8b6..4da135c 100644
--- a/lib/msun/src/e_atan2.c
+++ b/lib/msun/src/e_atan2.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: e_atan2.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $";
+static char rcsid[] = "$Id: e_atan2.c,v 1.2 1995/05/30 05:47:57 rgrimes Exp $";
#endif
/* __ieee754_atan2(y,x)
@@ -74,7 +74,7 @@ pi_lo = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */
if(((ix|((lx|-lx)>>31))>0x7ff00000)||
((iy|((ly|-ly)>>31))>0x7ff00000)) /* x or y is NaN */
return x+y;
- if((hx-0x3ff00000|lx)==0) return atan(y); /* x=1.0 */
+ if(((hx-0x3ff00000)|lx)==0) return atan(y); /* x=1.0 */
m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */
/* when y = 0 */
diff --git a/lib/msun/src/e_cosh.c b/lib/msun/src/e_cosh.c
index 2153e69..c0bec61 100644
--- a/lib/msun/src/e_cosh.c
+++ b/lib/msun/src/e_cosh.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: e_cosh.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $";
+static char rcsid[] = "$Id: e_cosh.c,v 1.2 1995/05/30 05:48:07 rgrimes Exp $";
#endif
/* __ieee754_cosh(x)
@@ -82,7 +82,7 @@ static double one = 1.0, half=0.5, huge = 1.0e300;
/* |x| in [log(maxdouble), overflowthresold] */
GET_LOW_WORD(lx,x);
if (ix<0x408633CE ||
- (ix==0x408633ce)&&(lx<=(u_int32_t)0x8fb9f87d)) {
+ ((ix==0x408633ce)&&(lx<=(u_int32_t)0x8fb9f87d))) {
w = __ieee754_exp(half*fabs(x));
t = half*w;
return t*w;
diff --git a/lib/msun/src/e_exp.c b/lib/msun/src/e_exp.c
index 9b833be..3777a6f 100644
--- a/lib/msun/src/e_exp.c
+++ b/lib/msun/src/e_exp.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: e_exp.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $";
+static char rcsid[] = "$Id: e_exp.c,v 1.2 1995/05/30 05:48:08 rgrimes Exp $";
#endif
/* __ieee754_exp(x)
@@ -110,8 +110,8 @@ P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */
double x;
#endif
{
- double y,hi,lo,c,t;
- int32_t k,xsb;
+ double y,hi=0.0,lo=0.0,c,t;
+ int32_t k=0,xsb;
u_int32_t hx;
GET_HIGH_WORD(hx,x);
diff --git a/lib/msun/src/e_expf.c b/lib/msun/src/e_expf.c
index 19ff4ac..ed26578 100644
--- a/lib/msun/src/e_expf.c
+++ b/lib/msun/src/e_expf.c
@@ -14,7 +14,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: e_expf.c,v 1.1.1.1 1994/08/19 09:39:54 jkh Exp $";
+static char rcsid[] = "$Id: e_expf.c,v 1.2 1995/05/30 05:48:09 rgrimes Exp $";
#endif
#include "math.h"
@@ -49,8 +49,8 @@ P5 = 4.1381369442e-08; /* 0x3331bb4c */
float x;
#endif
{
- float y,hi,lo,c,t;
- int32_t k,xsb;
+ float y,hi=0.0,lo=0.0,c,t;
+ int32_t k=0,xsb;
u_int32_t hx;
GET_FLOAT_WORD(hx,x);
diff --git a/lib/msun/src/e_sinh.c b/lib/msun/src/e_sinh.c
index 9f68f43..4b81a24 100644
--- a/lib/msun/src/e_sinh.c
+++ b/lib/msun/src/e_sinh.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: e_sinh.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $";
+static char rcsid[] = "$Id: e_sinh.c,v 1.2 1995/05/30 05:48:48 rgrimes Exp $";
#endif
/* __ieee754_sinh(x)
@@ -75,7 +75,7 @@ static double one = 1.0, shuge = 1.0e307;
/* |x| in [log(maxdouble), overflowthresold] */
GET_LOW_WORD(lx,x);
- if (ix<0x408633CE || (ix==0x408633ce)&&(lx<=(u_int32_t)0x8fb9f87d)) {
+ if (ix<0x408633CE || ((ix==0x408633ce)&&(lx<=(u_int32_t)0x8fb9f87d))) {
w = __ieee754_exp(0.5*fabs(x));
t = h*w;
return t*w;
diff --git a/sys/libkern/fnmatch.c b/sys/libkern/fnmatch.c
index 0c2ca13..96cd341 100644
--- a/sys/libkern/fnmatch.c
+++ b/sys/libkern/fnmatch.c
@@ -147,7 +147,7 @@ rangematch(pattern, test, flags)
* consistency with the regular expression syntax.
* J.T. Conklin (conklin@ngai.kaleida.com)
*/
- if (negate = (*pattern == '!' || *pattern == '^'))
+ if ( (negate = (*pattern == '!' || *pattern == '^')) )
++pattern;
for (ok = 0; (c = *pattern++) != ']';) {
OpenPOWER on IntegriCloud