mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-08 11:33:46 +00:00
Changing ArgArray template argument from unsigned to size_t
Each instantiation of ArgArray template uses sizeof operator, which returns a std::size_t value. GCC 7.1 warns about invalid conversion (error: conversion to ‘unsigned int’ from ‘long unsigned int’ may alter its value [-Werror=conversion]).
This commit is contained in:
parent
0284a2893a
commit
e14bac62a0
@ -2214,10 +2214,10 @@ inline uint64_t make_type(const T &arg) {
|
|||||||
return MakeValue< BasicFormatter<char> >::type(arg);
|
return MakeValue< BasicFormatter<char> >::type(arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <unsigned N, bool/*IsPacked*/= (N < ArgList::MAX_PACKED_ARGS)>
|
template <std::size_t N, bool/*IsPacked*/= (N < ArgList::MAX_PACKED_ARGS)>
|
||||||
struct ArgArray;
|
struct ArgArray;
|
||||||
|
|
||||||
template <unsigned N>
|
template <std::size_t N>
|
||||||
struct ArgArray<N, true/*IsPacked*/> {
|
struct ArgArray<N, true/*IsPacked*/> {
|
||||||
typedef Value Type[N > 0 ? N : 1];
|
typedef Value Type[N > 0 ? N : 1];
|
||||||
|
|
||||||
@ -2235,7 +2235,7 @@ struct ArgArray<N, true/*IsPacked*/> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <unsigned N>
|
template <std::size_t N>
|
||||||
struct ArgArray<N, false/*IsPacked*/> {
|
struct ArgArray<N, false/*IsPacked*/> {
|
||||||
typedef Arg Type[N + 1]; // +1 for the list end Arg::NONE
|
typedef Arg Type[N + 1]; // +1 for the list end Arg::NONE
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user