Commit e4e0bbe1 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot 5

Don't pass the single quote format parameter when formatting things

Summary:
We are formatting an integer value, so it is doing absolutely nothing at all, as confirmed by the version I implemented for MSVC, which does output the value with digit separators, which fails the unit tests because the unit test expects the digit separators to not be present. What's more, whe specifically assert that the user has not requested digit separators in the format string.
This also kills the MSVC special case entirely because it's not needed.

Reviewed By: yfeldblum

Differential Revision: D3768405

fbshipit-source-id: 388cd0ca9699e257c71798b9bf355aa651748e60
parent ff92b6ea
......@@ -492,23 +492,12 @@ class FormatValue<
"' specifier");
valBufBegin = valBuf + 3; // room for sign and base prefix
#ifdef _MSC_VER
char valBuf2[valBufSize];
snprintf(valBuf2, valBufSize, "%ju", static_cast<uintmax_t>(uval));
int len = GetNumberFormat(
LOCALE_USER_DEFAULT,
0,
valBuf2,
nullptr,
valBufBegin,
(int)((valBuf + valBufSize) - valBufBegin)
);
#elif defined(__ANDROID__)
#if defined(__ANDROID__)
int len = snprintf(valBufBegin, (valBuf + valBufSize) - valBufBegin,
"%" PRIuMAX, static_cast<uintmax_t>(uval));
#else
int len = snprintf(valBufBegin, (valBuf + valBufSize) - valBufBegin,
"%'ju", static_cast<uintmax_t>(uval));
"%ju", static_cast<uintmax_t>(uval));
#endif
// valBufSize should always be big enough, so this should never
// happen.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment