vsprintf.c (87d8a69709d971913e6cc7210450fcb8be963667) vsprintf.c (4e310fda91cb095915395f811d10b2c900c9589e)
1/*
2 * linux/lib/vsprintf.c
3 *
4 * Copyright (C) 1991, 1992 Linus Torvalds
5 */
6
7/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */
8/*

--- 394 unchanged lines hidden (view full) ---

403 FORMAT_TYPE_UINT,
404 FORMAT_TYPE_INT,
405 FORMAT_TYPE_NRCHARS,
406 FORMAT_TYPE_SIZE_T,
407 FORMAT_TYPE_PTRDIFF
408};
409
410struct printf_spec {
1/*
2 * linux/lib/vsprintf.c
3 *
4 * Copyright (C) 1991, 1992 Linus Torvalds
5 */
6
7/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */
8/*

--- 394 unchanged lines hidden (view full) ---

403 FORMAT_TYPE_UINT,
404 FORMAT_TYPE_INT,
405 FORMAT_TYPE_NRCHARS,
406 FORMAT_TYPE_SIZE_T,
407 FORMAT_TYPE_PTRDIFF
408};
409
410struct printf_spec {
411 u16 type;
412 s16 field_width; /* width of output field */
411 u8 type; /* format_type enum */
413 u8 flags; /* flags to number() */
412 u8 flags; /* flags to number() */
414 u8 base;
415 s8 precision; /* # of digits/chars */
416 u8 qualifier;
413 u8 base; /* number base, 8, 10 or 16 only */
414 u8 qualifier; /* number qualifier, one of 'hHlLtzZ' */
415 s16 field_width; /* width of output field */
416 s16 precision; /* # of digits/chars */
417};
418
419static char *number(char *buf, char *end, unsigned long long num,
420 struct printf_spec spec)
421{
422 /* we are called with base 8, 10 or 16, only, thus don't need "G..." */
423 static const char digits[16] = "0123456789ABCDEF"; /* "GHIJKLMNOPQRSTUVWXYZ"; */
424

--- 1707 unchanged lines hidden ---
417};
418
419static char *number(char *buf, char *end, unsigned long long num,
420 struct printf_spec spec)
421{
422 /* we are called with base 8, 10 or 16, only, thus don't need "G..." */
423 static const char digits[16] = "0123456789ABCDEF"; /* "GHIJKLMNOPQRSTUVWXYZ"; */
424

--- 1707 unchanged lines hidden ---