summaryrefslogtreecommitdiffstats
path: root/sys/lib/libsa/printf.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2003-08-11 06:23:07 +0000
committerderaadt <deraadt@openbsd.org>2003-08-11 06:23:07 +0000
commit599546b3df9d501c5df00d16afc0d6ef8054a751 (patch)
tree497dafb2e950a5b91385da061a8c32b00de30455 /sys/lib/libsa/printf.c
parentmake sure Debugger() is called only inside _both_ DDB and OSIOP_DEBUG (diff)
downloadwireguard-openbsd-599546b3df9d501c5df00d16afc0d6ef8054a751.tar.xz
wireguard-openbsd-599546b3df9d501c5df00d16afc0d6ef8054a751.zip
ansification and knf and protos
Diffstat (limited to 'sys/lib/libsa/printf.c')
-rw-r--r--sys/lib/libsa/printf.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/sys/lib/libsa/printf.c b/sys/lib/libsa/printf.c
index 61587f2307c..2abd62aa1f2 100644
--- a/sys/lib/libsa/printf.c
+++ b/sys/lib/libsa/printf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printf.c,v 1.20 2003/06/02 23:28:09 millert Exp $ */
+/* $OpenBSD: printf.c,v 1.21 2003/08/11 06:23:09 deraadt Exp $ */
/* $NetBSD: printf.c,v 1.10 1996/11/30 04:19:21 gwr Exp $ */
/*-
@@ -81,14 +81,11 @@ vprintf(const char *fmt, va_list ap)
}
void
-kdoprnt(put, fmt, ap)
- void (*put)(int);
- const char *fmt;
- va_list ap;
+kdoprnt(void (*put)(int), const char *fmt, va_list ap)
{
- char *p;
unsigned long ul;
int ch, lflag;
+ char *p;
for (;;) {
while ((ch = *fmt++) != '%') {
@@ -105,6 +102,7 @@ reswitch: switch (ch = *fmt++) {
case 'b':
{
int set, n;
+
ul = va_arg(ap, int);
p = va_arg(ap, char *);
kprintn(put, ul, *p++);
@@ -119,7 +117,8 @@ reswitch: switch (ch = *fmt++) {
put(n);
set = 1;
} else
- for (; *p > ' '; ++p);
+ for (; *p > ' '; ++p)
+ ;
}
if (set)
put('>');
@@ -128,7 +127,7 @@ reswitch: switch (ch = *fmt++) {
#endif
case 'c':
ch = va_arg(ap, int);
- put(ch & 0x7f);
+ put(ch & 0x7f);
break;
case 's':
p = va_arg(ap, char *);
@@ -174,12 +173,9 @@ reswitch: switch (ch = *fmt++) {
}
void
-kprintn(put, ul, base)
- void (*put)(int);
- unsigned long ul;
- int base;
+kprintn(void (*put)(int), unsigned long ul, int base)
{
- /* hold a long in base 8 */
+ /* hold a long in base 8 */
char *p, buf[(sizeof(long) * NBBY / 3) + 1];
p = buf;
@@ -194,7 +190,7 @@ kprintn(put, ul, base)
int donottwiddle = 0;
void
-twiddle()
+twiddle(void)
{
static int pos;