mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-26 09:28:21 +00:00
Fix warnings (#216)
This commit is contained in:
parent
fa88490453
commit
82acd483ae
@ -444,7 +444,7 @@ class BasicArgFormatter : public ArgVisitor<Impl, void> {
|
|||||||
typedef typename BasicWriter<Char>::CharPtr CharPtr;
|
typedef typename BasicWriter<Char>::CharPtr CharPtr;
|
||||||
Char fill = internal::CharTraits<Char>::cast(spec_.fill());
|
Char fill = internal::CharTraits<Char>::cast(spec_.fill());
|
||||||
CharPtr out = CharPtr();
|
CharPtr out = CharPtr();
|
||||||
const int CHAR_WIDTH = 1;
|
const unsigned CHAR_WIDTH = 1;
|
||||||
if (spec_.width_ > CHAR_WIDTH) {
|
if (spec_.width_ > CHAR_WIDTH) {
|
||||||
out = writer_.grow_buffer(spec_.width_);
|
out = writer_.grow_buffer(spec_.width_);
|
||||||
if (spec_.align_ == ALIGN_RIGHT) {
|
if (spec_.align_ == ALIGN_RIGHT) {
|
||||||
|
4
format.h
4
format.h
@ -292,7 +292,9 @@ class BasicStringRef {
|
|||||||
int compare(BasicStringRef other) const {
|
int compare(BasicStringRef other) const {
|
||||||
std::size_t size = std::min(size_, other.size_);
|
std::size_t size = std::min(size_, other.size_);
|
||||||
int result = std::char_traits<Char>::compare(data_, other.data_, size);
|
int result = std::char_traits<Char>::compare(data_, other.data_, size);
|
||||||
return result != 0 ? result : size_ - other.size_;
|
if (result == 0)
|
||||||
|
result = size_ == other.size_ ? 0 : (size_ < other.size_ ? -1 : 1);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
friend bool operator==(BasicStringRef lhs, BasicStringRef rhs) {
|
friend bool operator==(BasicStringRef lhs, BasicStringRef rhs) {
|
||||||
|
Loading…
Reference in New Issue
Block a user