- Rename the DDB specific %z printf format to %y.
- Make DDB use %y instead of %z. - Teach GCC about %y. - Implement support for the C99 %z format modifier. Approved by: re@ Reviewed by: peter Tested on: i386, sparc64
This commit is contained in:
parent
13f571a36c
commit
4578a2e652
@ -798,7 +798,7 @@ static const format_char_info print_char_table[] =
|
||||
*/
|
||||
{ "D", 1, STD_EXT, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR" },
|
||||
{ "b", 1, STD_EXT, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "" },
|
||||
{ "rz", 0, STD_EXT, { T89_I, BADLEN, BADLEN, T89_L, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "i" },
|
||||
{ "ry", 0, STD_EXT, { T89_I, BADLEN, BADLEN, T89_L, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "i" },
|
||||
{ NULL, 0, 0, NOLENGTHS, NULL, NULL }
|
||||
};
|
||||
|
||||
|
@ -129,7 +129,7 @@ db_examine(addr, fmt, count)
|
||||
case 'z': /* signed hex */
|
||||
value = db_get_value(addr, size, TRUE);
|
||||
addr += size;
|
||||
db_printf("%-*lz", width, (long)value);
|
||||
db_printf("%-*ly", width, (long)value);
|
||||
break;
|
||||
case 'd': /* signed decimal */
|
||||
value = db_get_value(addr, size, TRUE);
|
||||
@ -213,7 +213,7 @@ db_print_cmd(addr, have_addr, count, modif)
|
||||
db_printf("%8lx", (unsigned long)addr);
|
||||
break;
|
||||
case 'z':
|
||||
db_printf("%8lz", (long)addr);
|
||||
db_printf("%8ly", (long)addr);
|
||||
break;
|
||||
case 'd':
|
||||
db_printf("%11ld", (long)addr);
|
||||
|
@ -478,7 +478,7 @@ kvprintf(char const *fmt, void (*func)(int, void*), void *arg, int radix, va_lis
|
||||
int ch, n;
|
||||
uintmax_t num;
|
||||
int base, lflag, qflag, tmp, width, ladjust, sharpflag, neg, sign, dot;
|
||||
int jflag;
|
||||
int jflag, zflag;
|
||||
int dwidth;
|
||||
char padc;
|
||||
int retval = 0;
|
||||
@ -506,7 +506,7 @@ kvprintf(char const *fmt, void (*func)(int, void*), void *arg, int radix, va_lis
|
||||
percent = fmt - 1;
|
||||
qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; neg = 0;
|
||||
sign = 0; dot = 0; dwidth = 0;
|
||||
jflag = 0;
|
||||
jflag = 0; zflag = 0;
|
||||
reswitch: switch (ch = (u_char)*fmt++) {
|
||||
case '.':
|
||||
dot = 1;
|
||||
@ -614,6 +614,8 @@ reswitch: switch (ch = (u_char)*fmt++) {
|
||||
*(va_arg(ap, quad_t *)) = retval;
|
||||
else if (lflag)
|
||||
*(va_arg(ap, long *)) = retval;
|
||||
else if (zflag)
|
||||
*(va_arg(ap, size_t *)) = retval;
|
||||
else
|
||||
*(va_arg(ap, int *)) = retval;
|
||||
break;
|
||||
@ -662,10 +664,13 @@ reswitch: switch (ch = (u_char)*fmt++) {
|
||||
case 'X':
|
||||
base = 16;
|
||||
goto handle_nosign;
|
||||
case 'z':
|
||||
case 'y':
|
||||
base = 16;
|
||||
sign = 1;
|
||||
goto handle_sign;
|
||||
case 'z':
|
||||
zflag = 1;
|
||||
goto reswitch;
|
||||
handle_nosign:
|
||||
sign = 0;
|
||||
if (jflag)
|
||||
@ -674,6 +679,8 @@ handle_nosign:
|
||||
num = va_arg(ap, u_quad_t);
|
||||
else if (lflag)
|
||||
num = va_arg(ap, u_long);
|
||||
else if (zflag)
|
||||
num = va_arg(ap, size_t);
|
||||
else
|
||||
num = va_arg(ap, u_int);
|
||||
goto number;
|
||||
@ -684,6 +691,8 @@ handle_sign:
|
||||
num = va_arg(ap, quad_t);
|
||||
else if (lflag)
|
||||
num = va_arg(ap, long);
|
||||
else if (zflag)
|
||||
num = va_arg(ap, size_t);
|
||||
else
|
||||
num = va_arg(ap, int);
|
||||
number:
|
||||
|
Loading…
x
Reference in New Issue
Block a user