aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/vsprintf.c
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2005-02-05 11:12:14 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2005-02-05 11:12:14 +0000
commit73445e880f2f9c8c06517a5594db70c1c6a68875 (patch)
tree0fc505a92cb3a656182324fd1c22e62133ce87bb /xen/common/vsprintf.c
parent228e9fba605f0df29a0b3ee1432129ac607cff74 (diff)
downloadxen-73445e880f2f9c8c06517a5594db70c1c6a68875.tar.gz
xen-73445e880f2f9c8c06517a5594db70c1c6a68875.tar.bz2
xen-73445e880f2f9c8c06517a5594db70c1c6a68875.zip
bitkeeper revision 1.1159.212.95 (4204aa0ee0re5Xx1zWrJ9ejxzgRs3w)
Various cleanups. Remove PDB pending simpler GDB stub and/or NetBSD debugger. Force emacs mode to appropriate tabbing in various files. Signed-off-by: keir.fraser@cl.cam.ac.uk
Diffstat (limited to 'xen/common/vsprintf.c')
-rw-r--r--xen/common/vsprintf.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/xen/common/vsprintf.c b/xen/common/vsprintf.c
index 906e7734db..d710d0bd72 100644
--- a/xen/common/vsprintf.c
+++ b/xen/common/vsprintf.c
@@ -1,3 +1,4 @@
+/* -*- Mode:C; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */
/*
* linux/lib/vsprintf.c
*
@@ -115,13 +116,13 @@ static int skip_atoi(const char **s)
return i;
}
-#define ZEROPAD 1 /* pad with zero */
-#define SIGN 2 /* unsigned/signed long */
-#define PLUS 4 /* show plus */
-#define SPACE 8 /* space if plus */
-#define LEFT 16 /* left justified */
-#define SPECIAL 32 /* 0x */
-#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */
+#define ZEROPAD 1 /* pad with zero */
+#define SIGN 2 /* unsigned/signed long */
+#define PLUS 4 /* show plus */
+#define SPACE 8 /* space if plus */
+#define LEFT 16 /* left justified */
+#define SPECIAL 32 /* 0x */
+#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */
static char * number(char * buf, char * end, long long num, int base, int size, int precision, int type)
{
@@ -239,14 +240,14 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
char *str, *end, c;
const char *s;
- int flags; /* flags to number() */
+ int flags; /* flags to number() */
- int field_width; /* width of output field */
- int precision; /* min. # of digits for integers; max
- number of chars for from string */
- int qualifier; /* 'h', 'l', or 'L' for integer fields */
- /* 'z' support added 23/7/1999 S.H. */
- /* 'z' changed to 'Z' --davidm 1/25/99 */
+ int field_width; /* width of output field */
+ int precision; /* min. # of digits for integers; max
+ number of chars for from string */
+ int qualifier; /* 'h', 'l', or 'L' for integer fields */
+ /* 'z' support added 23/7/1999 S.H. */
+ /* 'z' changed to 'Z' --davidm 1/25/99 */
str = buf;
end = buf + size - 1;
@@ -267,7 +268,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
/* process flags */
flags = 0;
repeat:
- ++fmt; /* this also skips first '%' */
+ ++fmt; /* this also skips first '%' */
switch (*fmt) {
case '-': flags |= LEFT; goto repeat;
case '+': flags |= PLUS; goto repeat;
@@ -293,12 +294,12 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
/* get the precision */
precision = -1;
if (*fmt == '.') {
- ++fmt;
+ ++fmt;
if (isdigit(*fmt))
precision = skip_atoi(&fmt);
else if (*fmt == '*') {
++fmt;
- /* it's the next argument */
+ /* it's the next argument */
precision = va_arg(args, int);
}
if (precision < 0)
@@ -381,8 +382,8 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
case 'n':
- /* FIXME:
- * What does C99 say about the overflow case here? */
+ /* FIXME:
+ * What does C99 say about the overflow case here? */
if (qualifier == 'l') {
long * ip = va_arg(args, long *);
*ip = (str - buf);
@@ -401,7 +402,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
++str;
continue;
- /* integer number formats - set up the flags and "break" */
+ /* integer number formats - set up the flags and "break" */
case 'o':
base = 8;
break;