Skip to content

Commit

Permalink
Fix some warnings with warnings=extra on VS2019
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylann committed Oct 7, 2024
1 parent 01b342a commit 34af4cb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 0 additions & 4 deletions meshers/transvoxel/transvoxel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
#include "transvoxel_materials_mixel4.h"
#include "transvoxel_tables.cpp"

#if defined(_MSC_VER)
#pragma warning(disable : 4701) // Potentially uninitialized local variable used.
#endif

// #define VOXEL_TRANSVOXEL_REUSE_VERTEX_ON_COINCIDENT_CASES

namespace zylann::voxel::transvoxel {
Expand Down
6 changes: 4 additions & 2 deletions tests/util/test_island_finder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void test_island_finder() {
;

const Vector3i grid_size(5, 5, 5);
ZN_TEST_ASSERT(Vector3iUtil::get_volume(grid_size) == strlen(cdata) / 2);
ZN_TEST_ASSERT(Vector3iUtil::get_volume(grid_size) == static_cast<int64_t>(strlen(cdata) / 2));

StdVector<int> grid;
grid.resize(Vector3iUtil::get_volume(grid_size));
Expand All @@ -66,7 +66,9 @@ void test_island_finder() {
CRASH_COND(i >= grid.size());
return grid[i] == 1;
},
to_span(output), &label_count);
to_span(output),
&label_count
);

// unsigned int i = 0;
// for (int z = 0; z < grid_size.z; ++z) {
Expand Down
8 changes: 5 additions & 3 deletions tests/util/test_spatial_lock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,11 @@ void test_spatial_lock_dependent_map_chunks() {
Vector2i column_pos;
for (column_pos.y = 0; column_pos.y < MAP_SIZE; ++column_pos.y) {
for (column_pos.x = 0; column_pos.x < MAP_SIZE; ++column_pos.x) {
Task1 *task = ZN_NEW(Task1(1000 + rng.rand(2000), map, column_pos, events));
runner.enqueue(task, false);
++in_flight_count;
{
Task1 *task = ZN_NEW(Task1(1000 + rng.rand(2000), map, column_pos, events));
runner.enqueue(task, false);
++in_flight_count;
}

// Add some reading requests
for (int i = 0; i < 2; ++i) {
Expand Down
14 changes: 7 additions & 7 deletions tests/voxel/test_voxel_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2088,15 +2088,15 @@ void test_image_range_grid() {
using namespace math;

struct L {
static Color get_pixel_repeat(const Image &im, int x, int y) {
static Color get_pixel_repeat(const Image &im, const int x, const int y) {
return im.get_pixel(math::wrap(x, im.get_width()), math::wrap(y, im.get_height()));
}

static Interval get_range_repeat(const Image &im, Interval x, Interval y) {
const int min_x = Math::floor(x.min);
const int min_y = Math::floor(y.min);
const int max_x = Math::ceil(x.max);
const int max_y = Math::ceil(y.max);
static Interval get_range_repeat(const Image &im, const Interval x_range, const Interval y_range) {
const int min_x = Math::floor(x_range.min);
const int min_y = Math::floor(y_range.min);
const int max_x = Math::ceil(x_range.max);
const int max_y = Math::ceil(y_range.max);

Interval i = Interval::from_single_value(get_pixel_repeat(im, min_x, min_y).r);
for (int y = min_y; y < max_y; ++y) {
Expand All @@ -2109,7 +2109,7 @@ void test_image_range_grid() {
return i;
}

static void test_range(const Image &im, const ImageRangeGrid &range_grid, Interval x, Interval y) {
static void test_range(const Image &im, const ImageRangeGrid &range_grid, const Interval x, const Interval y) {
const Interval accurate_range = L::get_range_repeat(im, x, y);
const Interval estimated_range = range_grid.get_range_repeat(x, y);
ZN_TEST_ASSERT(estimated_range.contains(accurate_range));
Expand Down

0 comments on commit 34af4cb

Please sign in to comment.