mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 10:47:35 +02:00
Fix warnings
This commit is contained in:
@ -207,8 +207,8 @@ class BasicPrintfArgFormatter : public internal::ArgFormatterBase<Impl, Char> {
|
|||||||
specifier information for standard argument types.
|
specifier information for standard argument types.
|
||||||
\endrst
|
\endrst
|
||||||
*/
|
*/
|
||||||
BasicPrintfArgFormatter(BasicWriter<Char> &writer, FormatSpec &spec)
|
BasicPrintfArgFormatter(BasicWriter<Char> &w, FormatSpec &s)
|
||||||
: internal::ArgFormatterBase<Impl, Char>(writer, spec) {}
|
: internal::ArgFormatterBase<Impl, Char>(w, s) {}
|
||||||
|
|
||||||
/** Formats an argument of type ``bool``. */
|
/** Formats an argument of type ``bool``. */
|
||||||
void visit_bool(bool value) {
|
void visit_bool(bool value) {
|
||||||
@ -304,8 +304,8 @@ class PrintfFormatter : private internal::FormatterBase {
|
|||||||
appropriate lifetimes.
|
appropriate lifetimes.
|
||||||
\endrst
|
\endrst
|
||||||
*/
|
*/
|
||||||
explicit PrintfFormatter(const ArgList &args, BasicWriter<Char> &w)
|
explicit PrintfFormatter(const ArgList &al, BasicWriter<Char> &w)
|
||||||
: FormatterBase(args), writer_(w) {}
|
: FormatterBase(al), writer_(w) {}
|
||||||
|
|
||||||
/** Formats stored arguments and writes the output to the writer. */
|
/** Formats stored arguments and writes the output to the writer. */
|
||||||
FMT_API void format(BasicCStringRef<Char> format_str);
|
FMT_API void format(BasicCStringRef<Char> format_str);
|
||||||
|
@ -1225,7 +1225,7 @@ TEST(FormatterTest, FormatOct) {
|
|||||||
|
|
||||||
TEST(FormatterTest, FormatIntLocale) {
|
TEST(FormatterTest, FormatIntLocale) {
|
||||||
ScopedMock<LocaleMock> mock;
|
ScopedMock<LocaleMock> mock;
|
||||||
lconv lc = {};
|
lconv lc = lconv();
|
||||||
char sep[] = "--";
|
char sep[] = "--";
|
||||||
lc.thousands_sep = sep;
|
lc.thousands_sep = sep;
|
||||||
EXPECT_CALL(mock, localeconv()).Times(3).WillRepeatedly(testing::Return(&lc));
|
EXPECT_CALL(mock, localeconv()).Times(3).WillRepeatedly(testing::Return(&lc));
|
||||||
|
@ -14,8 +14,8 @@ using fmt::internal::StringBuffer;
|
|||||||
|
|
||||||
TEST(StringBufferTest, Empty) {
|
TEST(StringBufferTest, Empty) {
|
||||||
StringBuffer<char> buffer;
|
StringBuffer<char> buffer;
|
||||||
EXPECT_EQ(0, buffer.size());
|
EXPECT_EQ(0u, buffer.size());
|
||||||
EXPECT_EQ(0, buffer.capacity());
|
EXPECT_EQ(0u, buffer.capacity());
|
||||||
std::string data;
|
std::string data;
|
||||||
// std::string may have initial capacity.
|
// std::string may have initial capacity.
|
||||||
std::size_t capacity = data.capacity();
|
std::size_t capacity = data.capacity();
|
||||||
@ -28,7 +28,7 @@ TEST(StringBufferTest, Reserve) {
|
|||||||
StringBuffer<char> buffer;
|
StringBuffer<char> buffer;
|
||||||
std::size_t capacity = std::string().capacity() + 10;
|
std::size_t capacity = std::string().capacity() + 10;
|
||||||
buffer.reserve(capacity);
|
buffer.reserve(capacity);
|
||||||
EXPECT_EQ(0, buffer.size());
|
EXPECT_EQ(0u, buffer.size());
|
||||||
EXPECT_EQ(capacity, buffer.capacity());
|
EXPECT_EQ(capacity, buffer.capacity());
|
||||||
std::string data;
|
std::string data;
|
||||||
buffer.move_to(data);
|
buffer.move_to(data);
|
||||||
@ -54,8 +54,8 @@ TEST(StringBufferTest, MoveTo) {
|
|||||||
std::string data;
|
std::string data;
|
||||||
buffer.move_to(data);
|
buffer.move_to(data);
|
||||||
EXPECT_EQ(p, &data[0]);
|
EXPECT_EQ(p, &data[0]);
|
||||||
EXPECT_EQ(0, buffer.size());
|
EXPECT_EQ(0u, buffer.size());
|
||||||
EXPECT_EQ(0, buffer.capacity());
|
EXPECT_EQ(0u, buffer.capacity());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(StringWriterTest, MoveTo) {
|
TEST(StringWriterTest, MoveTo) {
|
||||||
@ -64,7 +64,7 @@ TEST(StringWriterTest, MoveTo) {
|
|||||||
std::string s;
|
std::string s;
|
||||||
out.move_to(s);
|
out.move_to(s);
|
||||||
EXPECT_EQ("The answer is 42\n", s);
|
EXPECT_EQ("The answer is 42\n", s);
|
||||||
EXPECT_EQ(0, out.size());
|
EXPECT_EQ(0u, out.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(StringWriterTest, WString) {
|
TEST(StringWriterTest, WString) {
|
||||||
|
Reference in New Issue
Block a user