mirror of
https://github.com/osm2pgsql-dev/osm2pgsql.git
synced 2025-08-16 15:04:27 +00:00
Merge pull request #1885 from joto/fix-last-fmt-issues
Fix last fmt issues
This commit is contained in:
@ -398,12 +398,11 @@ pg_result_t table_connection_t::get_geom_by_id(osmium::item_type type,
|
||||
{
|
||||
assert(table().has_geom_column());
|
||||
assert(m_db_connection);
|
||||
std::string const id_str = fmt::to_string(id);
|
||||
if (table().has_multicolumn_id_index()) {
|
||||
return m_db_connection->exec_prepared(
|
||||
"get_wkb", type_to_char(type), id_str.c_str());
|
||||
return m_db_connection->exec_prepared("get_wkb", type_to_char(type),
|
||||
id);
|
||||
}
|
||||
return m_db_connection->exec_prepared("get_wkb", id_str);
|
||||
return m_db_connection->exec_prepared("get_wkb", id);
|
||||
}
|
||||
|
||||
void table_connection_t::delete_rows_with(osmium::item_type type, osmid_t id)
|
||||
|
@ -15,9 +15,6 @@
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
// NOLINTNEXTLINE(google-global-names-in-headers,google-build-using-namespace)
|
||||
using namespace fmt::literals;
|
||||
|
||||
template <typename S, typename... TArgs>
|
||||
std::runtime_error fmt_error(S const &format_str, TArgs &&...args)
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
void number(T value)
|
||||
{
|
||||
if (std::isfinite(value)) {
|
||||
fmt::format_to(std::back_inserter(m_buffer), "{}"_format(value));
|
||||
m_buffer += fmt::to_string(value);
|
||||
} else {
|
||||
null();
|
||||
}
|
||||
@ -39,7 +39,7 @@ public:
|
||||
template <typename T, std::enable_if_t<std::is_integral_v<T>, bool> = true>
|
||||
void number(T value)
|
||||
{
|
||||
fmt::format_to(std::back_inserter(m_buffer), "{}"_format(value));
|
||||
m_buffer += fmt::to_string(value);
|
||||
}
|
||||
|
||||
void string(char const *str)
|
||||
@ -70,8 +70,8 @@ public:
|
||||
break;
|
||||
default:
|
||||
if (c <= 0x1f) {
|
||||
m_buffer.append(
|
||||
R"(\u{:04x})"_format(static_cast<unsigned char>(c)));
|
||||
m_buffer.append(fmt::format(R"(\u{:04x})",
|
||||
static_cast<unsigned char>(c)));
|
||||
} else {
|
||||
m_buffer += c;
|
||||
}
|
||||
|
@ -138,7 +138,8 @@ struct exec_arg
|
||||
constexpr static std::size_t const buffers_needed = 1;
|
||||
static char const *to_str(std::vector<std::string> *data, T param)
|
||||
{
|
||||
return data->emplace_back("{}"_format(std::forward<T>(param))).c_str();
|
||||
return data->emplace_back(fmt::to_string(std::forward<T>(param)))
|
||||
.c_str();
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user