Fixed a semantic error. va_arg(ap, u_short) is nonsense except on i386's

with 16-bit ints, since u_short is promoted when it is passed to a
varargs function.  gcc now warns about this.  We always pass small
integers (this is well obuscated), so there are no conversion problems.

Fixed a related style bug (bogus cast).
This commit is contained in:
Bruce Evans 2002-05-13 14:34:47 +00:00
parent 5d81c9882f
commit 74f168bf7a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=96527
2 changed files with 10 additions and 10 deletions

View File

@ -362,8 +362,8 @@ bios16(struct bios_args *args, char *fmt, ...)
stack -= 2;
break;
case 's': /* 16-bit integer */
i = va_arg(ap, u_short);
case 's': /* 16-bit integer passed as an int */
i = va_arg(ap, int);
stack -= 2;
break;
@ -434,8 +434,8 @@ bios16(struct bios_args *args, char *fmt, ...)
stack += 2;
break;
case 's': /* 16-bit integer */
i = va_arg(ap, u_short);
case 's': /* 16-bit integer passed as an int */
i = va_arg(ap, int);
*(u_short *)stack = i;
stack += 2;
break;
@ -559,7 +559,7 @@ pnpbios_identify(driver_t *driver, device_t parent)
bzero(pd, bigdev);
pda->next = currdev;
/* get current configuration */
if ((error = bios16(&args, PNP_GET_DEVNODE, &pda->next, &pda->node, (u_int16_t)1))) {
if ((error = bios16(&args, PNP_GET_DEVNODE, &pda->next, &pda->node, 1))) {
printf("pnpbios: error %d making BIOS16 call\n", error);
break;
}

View File

@ -362,8 +362,8 @@ bios16(struct bios_args *args, char *fmt, ...)
stack -= 2;
break;
case 's': /* 16-bit integer */
i = va_arg(ap, u_short);
case 's': /* 16-bit integer passed as an int */
i = va_arg(ap, int);
stack -= 2;
break;
@ -434,8 +434,8 @@ bios16(struct bios_args *args, char *fmt, ...)
stack += 2;
break;
case 's': /* 16-bit integer */
i = va_arg(ap, u_short);
case 's': /* 16-bit integer passed as an int */
i = va_arg(ap, int);
*(u_short *)stack = i;
stack += 2;
break;
@ -559,7 +559,7 @@ pnpbios_identify(driver_t *driver, device_t parent)
bzero(pd, bigdev);
pda->next = currdev;
/* get current configuration */
if ((error = bios16(&args, PNP_GET_DEVNODE, &pda->next, &pda->node, (u_int16_t)1))) {
if ((error = bios16(&args, PNP_GET_DEVNODE, &pda->next, &pda->node, 1))) {
printf("pnpbios: error %d making BIOS16 call\n", error);
break;
}