Support 'z' for size_t-sized integer printing, as in %zd or %zx.

This commit is contained in:
Daniel Stenberg 2004-03-01 12:44:07 +00:00
parent 7d2e872828
commit 5eeaff8235
1 changed files with 6 additions and 5 deletions

View File

@ -179,7 +179,7 @@ static BOOL dprintf_IsQualifierNoDollar(char c)
case '-': case '+': case ' ': case '#': case '.': case '-': case '+': case ' ': case '#': case '.':
case '0': case '1': case '2': case '3': case '4': case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9': case '5': case '6': case '7': case '8': case '9':
case 'h': case 'l': case 'L': case 'Z': case 'q': case 'h': case 'l': case 'L': case 'z': case 'q':
case '*': case 'O': case '*': case 'O':
return TRUE; return TRUE;
default: default:
@ -383,14 +383,15 @@ static int dprintf_Pass1(char *format, va_stack_t *vto, char **endpos, va_list a
case 'q': case 'q':
flags |= FLAGS_LONGLONG; flags |= FLAGS_LONGLONG;
break; break;
#if 0 case 'z':
case 'Z': /* the code below generates a warning if -Wunreachable-code is
if (sizeof(size_t) > sizeof(unsigned long int)) used */
if (sizeof(size_t) > sizeof(unsigned long))
flags |= FLAGS_LONGLONG; flags |= FLAGS_LONGLONG;
if (sizeof(size_t) > sizeof(unsigned int)) if (sizeof(size_t) > sizeof(unsigned int))
flags |= FLAGS_LONG; flags |= FLAGS_LONG;
break; break;
#endif
case 'O': case 'O':
#if SIZEOF_CURL_OFF_T > 4 #if SIZEOF_CURL_OFF_T > 4
flags |= FLAGS_LONGLONG; flags |= FLAGS_LONGLONG;