Fixes to eliminate some compiler complaints, such as:

suggest explicit braces to avoid ambiguous `else'
suggest parentheses around assignment used as truth value
This commit is contained in:
atatat 2001-12-04 15:27:35 +00:00
parent 830cfb5ec1
commit 239aeafb2e
3 changed files with 13 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: gdrom.c,v 1.5 2001/07/22 15:46:42 wiz Exp $ */
/* $NetBSD: gdrom.c,v 1.6 2001/12/04 15:27:37 atatat Exp $ */
/*-
* Copyright (c) 2001 Marcus Comstedt
@ -525,8 +525,8 @@ gdromstrategy(bp)
sc->is_busy = 1;
splx(s);
if (error = gdrom_read_sectors(sc, bp->b_data, bp->b_rawblkno,
bp->b_bcount>>11)) {
if ((error = gdrom_read_sectors(sc, bp->b_data, bp->b_rawblkno,
bp->b_bcount>>11))) {
bp->b_error = error;
bp->b_flags |= B_ERROR;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: maple.c,v 1.9 2001/07/22 15:46:41 wiz Exp $ */
/* $NetBSD: maple.c,v 1.10 2001/12/04 15:27:35 atatat Exp $ */
/*-
* Copyright (c) 2001 Marcus Comstedt
@ -575,12 +575,13 @@ maple_get_function_data(devinfo, function_code)
int i, p = 0;
for (i = 31; i >= 0; --i)
if (devinfo->di_func & (1U<<i))
if (devinfo->di_func & (1U<<i)) {
if (function_code & (1U<<i))
return devinfo->di_function_data[p];
else
if (++p >= 3)
break;
}
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mkbd.c,v 1.10 2001/09/06 20:04:49 thorpej Exp $ */
/* $NetBSD: mkbd.c,v 1.11 2001/12/04 15:27:36 atatat Exp $ */
/*-
* Copyright (c) 2001 Marcus Comstedt
@ -223,17 +223,19 @@ extern int maple_polling;
#define SHIFT_KEYCODE_BASE 0xe0
#define UP_KEYCODE_FLAG 0x1000
#define KEY_UP(n) \
#define KEY_UP(n) do { \
if (maple_polling) \
polledkey = (n)|UP_KEYCODE_FLAG; \
else \
wskbd_input(sc->sc_wskbddev, WSCONS_EVENT_KEY_UP, (n))
wskbd_input(sc->sc_wskbddev, WSCONS_EVENT_KEY_UP, (n)); \
} while (0)
#define KEY_DOWN(n) \
#define KEY_DOWN(n) do { \
if (maple_polling) \
polledkey = (n); \
else \
wskbd_input(sc->sc_wskbddev, WSCONS_EVENT_KEY_DOWN, (n))
wskbd_input(sc->sc_wskbddev, WSCONS_EVENT_KEY_DOWN, (n)); \
} while (0)
#define SHIFT_UP(n) KEY_UP((n)|SHIFT_KEYCODE_BASE)
#define SHIFT_DOWN(n) KEY_DOWN((n)|SHIFT_KEYCODE_BASE)