From 36136dab6a162693c3c5dab666f154a23fcd3812 Mon Sep 17 00:00:00 2001 From: Arthur O'Dwyer Date: Sun, 3 May 2020 21:21:14 -0400 Subject: [PATCH] Fix some unguarded bits of CAP_BT and CAP_CRYSTAL. Found by trying to build with `-DISMINI=0`, not that that comes even close to working. --- binary-tiling.cpp | 10 ++++++++-- geometry.cpp | 8 ++++---- reg3.cpp | 2 ++ sysconfig.h | 2 -- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/binary-tiling.cpp b/binary-tiling.cpp index 9973519c..8870a5d5 100644 --- a/binary-tiling.cpp +++ b/binary-tiling.cpp @@ -9,11 +9,17 @@ namespace hr { EX namespace bt { -#if CAP_BT /** note: nihsolv and kd3 tilings return bt::in(). They are defined elsewhere, although some of bt:: functions are used for them */ - EX bool in() { return cgflags & qBINARY; } + EX bool in() { +#if CAP_BT + return cgflags & qBINARY; +#else + return false; +#endif + } +#if CAP_BT #if HDR enum bindir { bd_right = 0, diff --git a/geometry.cpp b/geometry.cpp index 81262f12..be4a6b83 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -433,16 +433,16 @@ hpcshape ld alpha; int area; }; - shared_ptr gpdata; + shared_ptr gpdata = nullptr; #endif - int state; - int usershape_state; + int state = 0; + int usershape_state = 0; /** contains the texture point coordinates for 3D models */ basic_textureinfo models_texture; - geometry_information() { last = NULL; state = usershape_state = 0; gpdata = NULL; } + geometry_information() { last = NULL; } void require_basics() { if(state & 1) return; state |= 1; prepare_basics(); } void require_shapes() { if(state & 2) return; state |= 2; prepare_shapes(); } diff --git a/reg3.cpp b/reg3.cpp index 6ef52455..00a0a783 100644 --- a/reg3.cpp +++ b/reg3.cpp @@ -282,6 +282,7 @@ EX namespace reg3 { return Id; } +#if CAP_CRYSTAL int encode_coord(const crystal::coord& co) { int c = 0; for(int i=0; i<4; i++) c |= ((co[i]>>1) & 3) << (2*i); @@ -314,6 +315,7 @@ EX namespace reg3 { } } }; +#endif struct hrmap_field3 : reg3::hrmap_quotient3 { diff --git a/sysconfig.h b/sysconfig.h index 418aeea9..ffbec3ab 100644 --- a/sysconfig.h +++ b/sysconfig.h @@ -407,7 +407,6 @@ extern "C" { #define CAP_GLEW (CAP_GL && !ISMOBILE && !ISMAC && !ISLINUX && !ISWEB) #endif -#if CAP_GL #if CAP_GLEW #include #else @@ -429,7 +428,6 @@ extern "C" { #include #include #include - #endif #endif #endif