aboutsummaryrefslogtreecommitdiffstats
path: root/lib/vsprintf.c
diff options
context:
space:
mode:
authorVegard Nossum <vegard.nossum@gmail.com>2009-03-14 07:08:50 -0400
committerIngo Molnar <mingo@elte.hu>2009-03-14 07:37:09 -0400
commited681a91ab805341675d166a9592551093c0a2d9 (patch)
tree71945018c495b26659fe38cc2cf45347bbdad856 /lib/vsprintf.c
parentadf26f84a62b492e002d3b75af671f23ddd3be0a (diff)
vsprintf: unify the format decoding layer for its 3 users, cleanup
Impact: cleanup Rename FORMAT_TYPE_WITDH to => FORMAT_TYPE_WIDTH Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r--lib/vsprintf.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 708e505ce81f..be3001f912e4 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -398,7 +398,7 @@ static noinline char* put_dec(char *buf, unsigned long long num)
398 398
399enum format_type { 399enum format_type {
400 FORMAT_TYPE_NONE, /* Just a string part */ 400 FORMAT_TYPE_NONE, /* Just a string part */
401 FORMAT_TYPE_WITDH, 401 FORMAT_TYPE_WIDTH,
402 FORMAT_TYPE_PRECISION, 402 FORMAT_TYPE_PRECISION,
403 FORMAT_TYPE_CHAR, 403 FORMAT_TYPE_CHAR,
404 FORMAT_TYPE_STR, 404 FORMAT_TYPE_STR,
@@ -770,7 +770,7 @@ static int format_decode(const char *fmt, struct printf_spec *spec)
770 const char *start = fmt; 770 const char *start = fmt;
771 771
772 /* we finished early by reading the field width */ 772 /* we finished early by reading the field width */
773 if (spec->type == FORMAT_TYPE_WITDH) { 773 if (spec->type == FORMAT_TYPE_WIDTH) {
774 if (spec->field_width < 0) { 774 if (spec->field_width < 0) {
775 spec->field_width = -spec->field_width; 775 spec->field_width = -spec->field_width;
776 spec->flags |= LEFT; 776 spec->flags |= LEFT;
@@ -828,7 +828,7 @@ static int format_decode(const char *fmt, struct printf_spec *spec)
828 spec->field_width = skip_atoi(&fmt); 828 spec->field_width = skip_atoi(&fmt);
829 else if (*fmt == '*') { 829 else if (*fmt == '*') {
830 /* it's the next argument */ 830 /* it's the next argument */
831 spec->type = FORMAT_TYPE_WITDH; 831 spec->type = FORMAT_TYPE_WIDTH;
832 return ++fmt - start; 832 return ++fmt - start;
833 } 833 }
834 834
@@ -1002,7 +1002,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
1002 break; 1002 break;
1003 } 1003 }
1004 1004
1005 case FORMAT_TYPE_WITDH: 1005 case FORMAT_TYPE_WIDTH:
1006 spec.field_width = va_arg(args, int); 1006 spec.field_width = va_arg(args, int);
1007 break; 1007 break;
1008 1008
@@ -1306,7 +1306,7 @@ do { \
1306 case FORMAT_TYPE_NONE: 1306 case FORMAT_TYPE_NONE:
1307 break; 1307 break;
1308 1308
1309 case FORMAT_TYPE_WITDH: 1309 case FORMAT_TYPE_WIDTH:
1310 case FORMAT_TYPE_PRECISION: 1310 case FORMAT_TYPE_PRECISION:
1311 save_arg(int); 1311 save_arg(int);
1312 break; 1312 break;
@@ -1472,7 +1472,7 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf)
1472 break; 1472 break;
1473 } 1473 }
1474 1474
1475 case FORMAT_TYPE_WITDH: 1475 case FORMAT_TYPE_WIDTH:
1476 spec.field_width = get_arg(int); 1476 spec.field_width = get_arg(int);
1477 break; 1477 break;
1478 1478