Short is always promoted to int when passed as a function argument.
This is especially true when it's part of a '...'.
This commit is contained in:
parent
4ba48ec4d0
commit
1b7aee1d4e
@ -292,7 +292,7 @@ dopr(
|
|||||||
case 'i':
|
case 'i':
|
||||||
switch (cflags) {
|
switch (cflags) {
|
||||||
case DP_C_SHORT:
|
case DP_C_SHORT:
|
||||||
value = va_arg(args, short int);
|
value = (short int)va_arg(args, int);
|
||||||
break;
|
break;
|
||||||
case DP_C_LONG:
|
case DP_C_LONG:
|
||||||
value = va_arg(args, long int);
|
value = va_arg(args, long int);
|
||||||
@ -315,8 +315,7 @@ dopr(
|
|||||||
flags |= DP_F_UNSIGNED;
|
flags |= DP_F_UNSIGNED;
|
||||||
switch (cflags) {
|
switch (cflags) {
|
||||||
case DP_C_SHORT:
|
case DP_C_SHORT:
|
||||||
value = va_arg(args,
|
value = (unsigned short int)va_arg(args, int);
|
||||||
unsigned short int);
|
|
||||||
break;
|
break;
|
||||||
case DP_C_LONG:
|
case DP_C_LONG:
|
||||||
value = (LLONG) va_arg(args,
|
value = (LLONG) va_arg(args,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user