Skip to content

Commit cdf3a40

Browse files
committed
address build issues on Windows
Signed-off-by: Ken Museth <ken.museth@gmail.com>
1 parent e80571a commit cdf3a40

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

openvdb/openvdb/tools/PolySoupToLevelSet.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ void PolySoupToLevelSet<GridType>::process(const ShrinkWrapT &D, ProgressT *prog
288288
}
289289

290290
// Coarse to fine shrink wrap algorithm
291-
double vol[2];// levelSetVolume returns Real (double); keep full precision
291+
double vol[2] = {0.0, 0.0};// levelSetVolume returns Real (double); keep full precision.
292+
// Zero-init silences a GCC -Wmaybe-uninitialized false positive:
293+
// vol[0] is only read when d>0, after the loop's increment has set it.
292294
auto grid = mGrids.back();// initiate grid with the coarsest offset
293295
mGrids.pop_back();
294296
mIsGridSDF = true;

openvdb_cmd/vdb_tool/include/Util.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737
#include <string_view>// for Spinner's operator() argument
3838
#include <vector>
3939
#include <sys/stat.h>// for stat (used by fileExists)
40+
#if defined(_WIN32)
41+
#include <io.h>// for isatty/fileno (used by Spinner's TTY detection); unistd.h is POSIX-only
42+
#else
4043
#include <unistd.h>// for isatty (used by Spinner's TTY detection)
44+
#endif
4145
#include <chrono>
4246
#include <ctime>
4347

0 commit comments

Comments
 (0)