- Added the C99 printf size specifiers 't' (ptrdiff_t) and 'z' (size_t) to
FString::Format() so that I can fix all the problem printf strings that a 64-bit GCC compile finds. SVN r968 (trunk)
This commit is contained in:
parent
99f55e8b8f
commit
a0d5463b49
22 changed files with 85 additions and 42 deletions
|
|
@ -218,6 +218,16 @@ namespace StringFormat
|
|||
flags |= F_BIGI;
|
||||
}
|
||||
}
|
||||
else if (*c == 't')
|
||||
{
|
||||
flags |= F_PTRDIFF;
|
||||
++c;
|
||||
}
|
||||
else if (*c == 'z')
|
||||
{
|
||||
flags |= F_SIZE;
|
||||
++c;
|
||||
}
|
||||
|
||||
base = c+1;
|
||||
|
||||
|
|
@ -278,7 +288,11 @@ namespace StringFormat
|
|||
}
|
||||
else
|
||||
{
|
||||
if (size == F_HALFHALF)
|
||||
if (size == 0)
|
||||
{
|
||||
intarg = va_arg (arglist, int);
|
||||
}
|
||||
else if (size == F_HALFHALF)
|
||||
{
|
||||
intarg = va_arg (arglist, int);
|
||||
intarg = (signed char)intarg;
|
||||
|
|
@ -302,6 +316,16 @@ namespace StringFormat
|
|||
{
|
||||
int64arg = va_arg (arglist, int64_t);
|
||||
}
|
||||
else if (size == F_PTRDIFF)
|
||||
{
|
||||
if (sizeof(ptrdiff_t) == sizeof(int)) intarg = va_arg (arglist, int);
|
||||
else { int64arg = va_arg (arglist, int64_t); size = F_LONGLONG; }
|
||||
}
|
||||
else if (size == F_SIZE)
|
||||
{
|
||||
if (sizeof(size_t) == sizeof(int)) intarg = va_arg (arglist, int);
|
||||
else { int64arg = va_arg (arglist, int64_t); size = F_LONGLONG; }
|
||||
}
|
||||
else
|
||||
{
|
||||
intarg = va_arg (arglist, int);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue