Skip to content

Commit b91cf03

Browse files
authored
Merge pull request #2197 from joto/int-conv-warnings
Avoid warnings for integer conversions from MSVC
2 parents b942ea2 + 490ad6a commit b91cf03

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/osm2pgsql.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ static void check_db_format(properties_t const &properties, options_t *options)
240240
throw fmt_error("Unknown db_format '{}' in properties.", format);
241241
}
242242

243-
options->middle_database_format = format;
243+
options->middle_database_format = static_cast<uint8_t>(format);
244244
}
245245

246246
static void check_output(properties_t const &properties, options_t *options)

src/pgsql.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,10 @@ class pg_conn_t
262262
if constexpr (std::is_same_v<T, char const *>) {
263263
return param;
264264
} else if constexpr (std::is_same_v<T, std::string>) {
265-
*length = param.size();
265+
*length = static_cast<int>(param.size());
266266
return param.c_str();
267267
} else if constexpr (std::is_same_v<T, binary_param>) {
268-
*length = param.size();
268+
*length = static_cast<int>(param.size());
269269
*bin = 1;
270270
return param.data();
271271
}

tests/test-lua-utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ TEST_CASE("luaX_for_each should call function n times", "[NoDB]")
8989
luaL_newstate(), [](lua_State *state) { lua_close(state); }};
9090

9191
test_lua(lua_state.get(), "return { 3, 4, 5 }", [&](){
92-
int sum = 0;
92+
lua_Number sum = 0;
9393
luaX_for_each(lua_state.get(), [&]() {
9494
sum += lua_tonumber(lua_state.get(), -1);
9595
});

0 commit comments

Comments
 (0)