projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove inclusion guard hacks for sys/kd.h
[musl]
/
src
/
stdio
/
vfprintf.c
diff --git
a/src/stdio/vfprintf.c
b/src/stdio/vfprintf.c
index
8c81efc
..
50fb55c
100644
(file)
--- a/
src/stdio/vfprintf.c
+++ b/
src/stdio/vfprintf.c
@@
-107,8
+107,6
@@
union arg
static void pop_arg(union arg *arg, int type, va_list *ap)
{
static void pop_arg(union arg *arg, int type, va_list *ap)
{
- /* Give the compiler a hint for optimizing the switch. */
- if ((unsigned)type > MAXSTATE) return;
switch (type) {
case PTR: arg->p = va_arg(*ap, void *);
break; case INT: arg->i = va_arg(*ap, int);
switch (type) {
case PTR: arg->p = va_arg(*ap, void *);
break; case INT: arg->i = va_arg(*ap, int);
@@
-561,7
+559,7
@@
static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg,
if (0) {
case 'o':
a = fmt_o(arg.i, z);
if (0) {
case 'o':
a = fmt_o(arg.i, z);
- if ((fl&ALT_FORM) && p<z-a+1) p
refix+=5, pl=
1;
+ if ((fl&ALT_FORM) && p<z-a+1) p
=z-a+
1;
} if (0) {
case 'd': case 'i':
pl=1;
} if (0) {
case 'd': case 'i':
pl=1;
@@
-576,7
+574,7
@@
static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg,
a = fmt_u(arg.i, z);
}
if (xp && p<0) goto overflow;
a = fmt_u(arg.i, z);
}
if (xp && p<0) goto overflow;
- if (
p>=0
) fl &= ~ZERO_PAD;
+ if (
xp
) fl &= ~ZERO_PAD;
if (!arg.i && !p) {
a=z;
break;
if (!arg.i && !p) {
a=z;
break;