fix all msvc W3 warnings

isolation
Dominik Madarász 2022-09-29 16:41:28 +02:00
parent b6cf690c25
commit 11929260e2
4 changed files with 11 additions and 9 deletions

View File

@ -9,7 +9,9 @@ function(link_system_libs target_name)
target_link_libraries(${target_name} pthread m dl atomic)
endif()
if (NOT WIN32)
if (WIN32)
target_compile_options(${target_name} PRIVATE -WX -W3 -wd5105)
else()
target_compile_options(${target_name} PRIVATE -Werror -Wall -Wextra -Wno-unused-function -Wno-unknown-pragmas -Wno-unused-variable -Wno-unused-parameter)
endif ()
endfunction()

View File

@ -34,7 +34,7 @@ int32_t tracker_read_update(librg_world *w, librg_event *e) {
}
#endif
data.last_update = get_cached_time()*1000.0f;
data.last_update = (uint64_t)(get_cached_time()*1000.0f);
data.layer_id = view->active_layer_id;
predict_receive_update(d, &data);
entity_view_update_or_create(&view->entities, entity_id, data);

View File

@ -19,7 +19,7 @@ typedef WORLD_BLOCK_OBSERVER(world_block_observer_proc);
// ensure it is set in worldgen_build
int worldgen_in_circle(int x, int y, int radius) {
return (zpl_pow(x, 2) + zpl_pow(y, 2)) < zpl_pow(radius, 2);
return (zpl_pow((float)x, 2.0f) + zpl_pow((float)y, 2.0f)) < zpl_pow((float)radius, 2.0f);
}
static void world_fill_rect(block_id *data, block_id id, uint32_t x, uint32_t y, uint32_t w, uint32_t h, world_block_observer_proc *proc) {

View File

@ -61,7 +61,7 @@ int32_t worldgen_build(world_data *wld) {
world_fill_circle(world->data, dirt_id, world->dim / 2, world->dim / 2, radius, NULL);
// narrow boy cirlce
world_fill_circle(world->data, grnd_id, world->dim / 2, world->dim / 2, radius * 0.7f, NULL);
world_fill_circle(world->data, grnd_id, world->dim / 2, world->dim / 2, (uint32_t)(radius * 0.7f), NULL);
return WORLD_ERROR_NONE;