Make the v*printf() functions in libsa return int instead of void.
This makes them compatible with the C standard signatures, avoiding spurious mismatch errors in the places where the oddball requirements of standalone code end up putting two declarations of the same function in play.
This commit is contained in:
parent
b69dab33aa
commit
98ec7f96c8
@ -80,11 +80,11 @@ printf(const char *fmt, ...)
|
||||
return retval;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
vprintf(const char *fmt, va_list ap)
|
||||
{
|
||||
|
||||
kvprintf(fmt, putchar_wrapper, NULL, 10, ap);
|
||||
return (kvprintf(fmt, putchar_wrapper, NULL, 10, ap));
|
||||
}
|
||||
|
||||
int
|
||||
@ -140,27 +140,32 @@ snprintf(char *buf, size_t size, const char *cfmt, ...)
|
||||
return retval;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
vsnprintf(char *buf, size_t size, const char *cfmt, va_list ap)
|
||||
{
|
||||
struct print_buf arg;
|
||||
int retval;
|
||||
|
||||
arg.buf = buf;
|
||||
arg.size = size;
|
||||
|
||||
kvprintf(cfmt, &snprint_func, &arg, 10, ap);
|
||||
retval = kvprintf(cfmt, &snprint_func, &arg, 10, ap);
|
||||
|
||||
if (arg.size >= 1)
|
||||
*(arg.buf)++ = 0;
|
||||
|
||||
return (retval);
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
vsprintf(char *buf, const char *cfmt, va_list ap)
|
||||
{
|
||||
int retval;
|
||||
|
||||
retval = kvprintf(cfmt, NULL, (void *)buf, 10, ap);
|
||||
buf[retval] = '\0';
|
||||
|
||||
return (retval);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -270,9 +270,9 @@ extern void mallocstats(void);
|
||||
extern int printf(const char *fmt, ...) __printflike(1, 2);
|
||||
extern int sprintf(char *buf, const char *cfmt, ...) __printflike(2, 3);
|
||||
extern int snprintf(char *buf, size_t size, const char *cfmt, ...) __printflike(3, 4);
|
||||
extern void vprintf(const char *fmt, __va_list);
|
||||
extern void vsprintf(char *buf, const char *cfmt, __va_list);
|
||||
extern void vsnprintf(char *buf, size_t size, const char *cfmt, __va_list);
|
||||
extern int vprintf(const char *fmt, __va_list);
|
||||
extern int vsprintf(char *buf, const char *cfmt, __va_list);
|
||||
extern int vsnprintf(char *buf, size_t size, const char *cfmt, __va_list);
|
||||
|
||||
extern void twiddle(u_int callerdiv);
|
||||
extern void twiddle_divisor(u_int globaldiv);
|
||||
|
Loading…
Reference in New Issue
Block a user