First set of fixes to keep egcs happy. These include {} around single
statement if blocks[*] when the else could be ambiguous, not defaulting to int type and removal of some unused variables. [*] This is explicitly allowed by style(9) when the single statement spans more than one line. Reviewed by: obrien, chuckr
This commit is contained in:
parent
51bb7ba664
commit
426e9c1dcc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=46073
@ -656,7 +656,7 @@ do_status(char *cname, int argc, char **argv)
|
||||
printf(" avoltag: <%s:%d>",
|
||||
ces->ces_avoltag.cv_volid,
|
||||
ces->ces_avoltag.cv_serial);
|
||||
if (source)
|
||||
if (source) {
|
||||
if (ces->ces_flags & CES_SOURCE_VALID)
|
||||
printf(" source: <%s %d>",
|
||||
element_type_name(
|
||||
@ -664,6 +664,7 @@ do_status(char *cname, int argc, char **argv)
|
||||
ces->ces_source_addr);
|
||||
else
|
||||
printf(" source: <>");
|
||||
}
|
||||
if (intaddr)
|
||||
printf(" intaddr: <%d>", ces->ces_int_addr);
|
||||
if (scsi) {
|
||||
|
@ -45,7 +45,7 @@ static char const copyright[] =
|
||||
static char sccsid[] = "@(#)cp.c 8.2 (Berkeley) 4/1/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: cp.c,v 1.16 1998/05/13 07:25:14 charnier Exp $";
|
||||
"$Id: cp.c,v 1.17 1998/06/09 13:42:51 dt Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -295,7 +295,7 @@ copy(argv, type, fts_options)
|
||||
* Since the first level MUST be FTS_ROOTLEVEL, base
|
||||
* is always initialized.
|
||||
*/
|
||||
if (curr->fts_level == FTS_ROOTLEVEL)
|
||||
if (curr->fts_level == FTS_ROOTLEVEL) {
|
||||
if (type != DIR_TO_DNE) {
|
||||
p = strrchr(curr->fts_path, '/');
|
||||
base = (p == NULL) ? 0 :
|
||||
@ -306,6 +306,7 @@ copy(argv, type, fts_options)
|
||||
base += 1;
|
||||
} else
|
||||
base = curr->fts_pathlen;
|
||||
}
|
||||
|
||||
p = &curr->fts_path[base];
|
||||
nlen = curr->fts_pathlen - base;
|
||||
|
@ -36,7 +36,7 @@
|
||||
static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: utils.c,v 1.20 1998/06/10 06:29:23 peter Exp $";
|
||||
"$Id: utils.c,v 1.21 1998/11/18 11:47:45 bde Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -183,7 +183,7 @@ copy_file(entp, dne)
|
||||
*/
|
||||
#define RETAINBITS \
|
||||
(S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)
|
||||
else if (fs->st_mode & (S_ISUID | S_ISGID) && fs->st_uid == myuid)
|
||||
else if (fs->st_mode & (S_ISUID | S_ISGID) && fs->st_uid == myuid) {
|
||||
if (fstat(to_fd, &to_stat)) {
|
||||
warn("%s", to.p_path);
|
||||
rval = 1;
|
||||
@ -192,6 +192,7 @@ copy_file(entp, dne)
|
||||
warn("%s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
}
|
||||
(void)close(from_fd);
|
||||
if (close(to_fd)) {
|
||||
warn("%s", to.p_path);
|
||||
|
@ -36,7 +36,7 @@
|
||||
static char sccsid[] = "@(#)dol.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$Id: dol.c,v 1.7 1998/05/06 06:50:39 charnier Exp $";
|
||||
"$Id: dol.c,v 1.8 1998/05/13 07:28:52 charnier Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -605,11 +605,12 @@ Dgetdol()
|
||||
stderror(ERR_SYNTAX);
|
||||
}
|
||||
else {
|
||||
if (subscr > 0)
|
||||
if (subscr > 0) {
|
||||
if (subscr > upb)
|
||||
lwb = 1, upb = 0;
|
||||
else
|
||||
lwb = upb = subscr;
|
||||
}
|
||||
unDredc(c);
|
||||
}
|
||||
if (dimen) {
|
||||
|
@ -36,7 +36,7 @@
|
||||
static char sccsid[] = "@(#)func.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$Id: func.c,v 1.10 1998/02/28 10:49:56 jraynard Exp $";
|
||||
"$Id: func.c,v 1.11 1998/07/27 21:15:52 nectar Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -754,11 +754,12 @@ getword(wp)
|
||||
c = readc(1);
|
||||
if (c == '\\' && (c = readc(1)) == '\n')
|
||||
c = ' ';
|
||||
if (c == '\'' || c == '"')
|
||||
if (c == '\'' || c == '"') {
|
||||
if (d == 0)
|
||||
d = c;
|
||||
else if (d == c)
|
||||
d = 0;
|
||||
}
|
||||
if (c < 0)
|
||||
goto past;
|
||||
if (wp) {
|
||||
|
@ -36,7 +36,7 @@
|
||||
static char sccsid[] = "@(#)lex.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$Id: lex.c,v 1.9 1998/05/06 06:50:52 charnier Exp $";
|
||||
"$Id: lex.c,v 1.10 1998/05/13 07:29:05 charnier Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -1328,7 +1328,7 @@ readc(wanteof)
|
||||
bool wanteof;
|
||||
{
|
||||
int c;
|
||||
static sincereal;
|
||||
static int sincereal;
|
||||
|
||||
aret = F_SEEK;
|
||||
if ((c = peekread) != '\0') {
|
||||
|
@ -36,7 +36,7 @@
|
||||
static char sccsid[] = "@(#)sem.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$Id: sem.c,v 1.7 1998/02/28 10:50:00 jraynard Exp $";
|
||||
"$Id: sem.c,v 1.8 1998/05/06 06:51:00 charnier Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -203,7 +203,7 @@ execute(t, wanttty, pipein, pipeout)
|
||||
* We have to fork for eval too.
|
||||
*/
|
||||
(bifunc && (t->t_dflg & (F_PIPEIN | F_PIPEOUT)) != 0 &&
|
||||
bifunc->bfunct == doeval))
|
||||
bifunc->bfunct == doeval)) {
|
||||
if (t->t_dtyp == NODE_PAREN ||
|
||||
t->t_dflg & (F_REPEAT | F_AMPERSAND) || bifunc) {
|
||||
forked++;
|
||||
@ -339,6 +339,7 @@ execute(t, wanttty, pipein, pipeout)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (pid != 0) {
|
||||
/*
|
||||
* It would be better if we could wait for the whole job when we
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"$Id: vary.c,v 1.4 1998/05/06 06:51:20 charnier Exp $";
|
||||
"$Id: vary.c,v 1.5 1999/03/09 09:38:54 brian Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <time.h>
|
||||
@ -140,11 +140,12 @@ adjmon(struct tm *t, char type, int val, int istext)
|
||||
|
||||
switch (type) {
|
||||
case '+':
|
||||
if (istext)
|
||||
if (istext) {
|
||||
if (val <= t->tm_mon)
|
||||
val += 11 - t->tm_mon; /* early next year */
|
||||
else
|
||||
val -= t->tm_mon + 1; /* later this year */
|
||||
}
|
||||
if (!adjyear(t, '+', (t->tm_mon + val) / 12))
|
||||
return 0;
|
||||
val %= 12;
|
||||
@ -154,11 +155,12 @@ adjmon(struct tm *t, char type, int val, int istext)
|
||||
break;
|
||||
|
||||
case '-':
|
||||
if (istext)
|
||||
if (istext) {
|
||||
if (val-1 > t->tm_mon)
|
||||
val = 13 - val + t->tm_mon; /* later last year */
|
||||
else
|
||||
val = t->tm_mon - val + 1; /* early this year */
|
||||
}
|
||||
if (!adjyear(t, '-', val / 12))
|
||||
return 0;
|
||||
val %= 12;
|
||||
|
11
bin/dd/dd.c
11
bin/dd/dd.c
@ -46,7 +46,7 @@ static char const copyright[] =
|
||||
static char sccsid[] = "@(#)dd.c 8.5 (Berkeley) 4/2/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: dd.c,v 1.14 1998/05/06 06:51:39 charnier Exp $";
|
||||
"$Id: dd.c,v 1.15 1998/05/13 07:33:47 charnier Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -178,8 +178,8 @@ setup()
|
||||
* table that does both at once. If just converting case, use the
|
||||
* built-in tables.
|
||||
*/
|
||||
if (ddflags & (C_LCASE|C_UCASE))
|
||||
if (ddflags & C_ASCII)
|
||||
if (ddflags & (C_LCASE|C_UCASE)) {
|
||||
if (ddflags & C_ASCII) {
|
||||
if (ddflags & C_LCASE) {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
if (isupper(ctab[cnt]))
|
||||
@ -189,7 +189,7 @@ setup()
|
||||
if (islower(ctab[cnt]))
|
||||
ctab[cnt] = toupper(ctab[cnt]);
|
||||
}
|
||||
else if (ddflags & C_EBCDIC)
|
||||
} else if (ddflags & C_EBCDIC) {
|
||||
if (ddflags & C_LCASE) {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
if (isupper(cnt))
|
||||
@ -199,7 +199,7 @@ setup()
|
||||
if (islower(cnt))
|
||||
ctab[cnt] = ctab[toupper(cnt)];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
ctab = ddflags & C_LCASE ? u2l : l2u;
|
||||
if (ddflags & C_LCASE) {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
@ -215,6 +215,7 @@ setup()
|
||||
ctab[cnt] = cnt;
|
||||
}
|
||||
}
|
||||
}
|
||||
(void)gettimeofday(&tv, (struct timezone *)NULL);
|
||||
st.start = tv.tv_sec + tv.tv_usec * 1e-6;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: arith_lex.l,v 1.11 1998/08/24 10:20:36 cracauer Exp $
|
||||
* $Id: arith_lex.l,v 1.12 1998/08/25 09:33:34 cracauer Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@ -42,14 +42,14 @@
|
||||
static char sccsid[] = "@(#)arith_lex.l 8.3 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
"$Id: arith_lex.l,v 1.12 1998/08/25 09:33:34 cracauer Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <unistd.h>
|
||||
#include "y.tab.h"
|
||||
#include "error.h"
|
||||
|
||||
extern yylval;
|
||||
extern int yylval;
|
||||
extern char *arith_buf, *arith_startbuf;
|
||||
#undef YY_INPUT
|
||||
#define YY_INPUT(buf,result,max) \
|
||||
|
@ -39,7 +39,7 @@
|
||||
static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
"$Id: input.c,v 1.11 1998/05/18 06:43:45 charnier Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h> /* defines BUFSIZ */
|
||||
@ -232,7 +232,6 @@ preadbuffer()
|
||||
char *p, *q;
|
||||
int more;
|
||||
int something;
|
||||
extern EditLine *el;
|
||||
char savec;
|
||||
|
||||
if (parsefile->strpush) {
|
||||
|
Loading…
Reference in New Issue
Block a user