Skip to content

Commit a171b2b

Browse files
Stinkfist0aothms
authored andcommitted
Couple warning fixes (IfcOpenShell#139)
* Use -Wno-tautological-constant-out-of-range-compare for Clang (these warnings come from the sanity checks in generated IfcXXX files). * Remove unused variable and typedefs + suppress uint->bool conversion warnings (MSVC) + add note about Clang in README * MSVC uint->bool convesion warning fixes when IFC4 is defined
1 parent 8a92e1a commit a171b2b

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ Start the MSYS2 Shell and then:
7070

7171
#### Using Bash on Ubuntu on Windows
7272

73-
Start Bash on Ubuntu on Windows and follow the instructions below. Ubuntu 14.04.4 LTS with GCC 4.8.4 has been
74-
confirmed to work.
73+
Start Bash on Ubuntu on Windows and follow the instructions below. Compiling on Ubuntu 14.04.4 LTS using GCC 4.8.4
74+
or Clang 3.5 has been confirmed to work.
7575

7676
### Compiling on *nix
7777

cmake/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ IF(MSVC)
369369
ENDFOREACH()
370370
ElSE()
371371
add_definitions(-Wall -Wextra)
372+
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
373+
add_definitions(-Wno-tautological-constant-out-of-range-compare)
374+
endif()
372375
# -fPIC is not relevant on Windows and creates pointless warnings
373376
if (UNIX)
374377
add_definitions(-fPIC)

src/examples/IfcAdvancedHouse.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@
5252
#include <vld.h>
5353
#endif
5454

55-
// Some convenience typedefs and definitions.
56-
typedef std::string S;
57-
typedef IfcParse::IfcGlobalId guid;
58-
typedef std::pair<double, double> XY;
59-
boost::none_t const null = boost::none;
60-
6155
// The creation of Nurbs-surface for the IfcSite mesh, to be implemented lateron
6256
void createGroundShape(TopoDS_Shape& shape);
6357

src/ifcgeom/IfcGeomFunctions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2116,7 +2116,7 @@ bool IfcGeom::Kernel::split_solid_by_shell(const TopoDS_Shape& input, const Topo
21162116

21172117
for (int i = 0; i < 2; ++i) {
21182118
TopoDS_Shape& shape = i == 0 ? front : back;
2119-
const bool result_is_null = is_null[i] = shape.IsNull();
2119+
const bool result_is_null = is_null[i] = shape.IsNull() != 0;
21202120
if (result_is_null) {
21212121
continue;
21222122
}

src/ifcgeom/IfcGeomSerialisation.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ int convert_to_ifc(const Handle_Geom_Curve& c, IfcSchema::IfcCurve*& curve, bool
168168
bspline->Degree(),
169169
points,
170170
IfcSchema::IfcBSplineCurveForm::IfcBSplineCurveForm_UNSPECIFIED,
171-
bspline->IsClosed(),
171+
bspline->IsClosed() != 0,
172172
false,
173173
mults,
174174
knots,
@@ -180,7 +180,7 @@ int convert_to_ifc(const Handle_Geom_Curve& c, IfcSchema::IfcCurve*& curve, bool
180180
bspline->Degree(),
181181
points,
182182
IfcSchema::IfcBSplineCurveForm::IfcBSplineCurveForm_UNSPECIFIED,
183-
bspline->IsClosed(),
183+
bspline->IsClosed() != 0,
184184
false,
185185
mults,
186186
knots,
@@ -284,8 +284,8 @@ int convert_to_ifc(const Handle_Geom_Surface& s, IfcSchema::IfcSurface*& surface
284284
bspline->VDegree(),
285285
points,
286286
IfcSchema::IfcBSplineSurfaceForm::IfcBSplineSurfaceForm_UNSPECIFIED,
287-
bspline->IsUClosed(),
288-
bspline->IsVClosed(),
287+
bspline->IsUClosed() != 0,
288+
bspline->IsVClosed() != 0,
289289
false,
290290
umults,
291291
vmults,
@@ -300,8 +300,8 @@ int convert_to_ifc(const Handle_Geom_Surface& s, IfcSchema::IfcSurface*& surface
300300
bspline->VDegree(),
301301
points,
302302
IfcSchema::IfcBSplineSurfaceForm::IfcBSplineSurfaceForm_UNSPECIFIED,
303-
bspline->IsUClosed(),
304-
bspline->IsVClosed(),
303+
bspline->IsUClosed() != 0,
304+
bspline->IsVClosed() != 0,
305305
false,
306306
umults,
307307
vmults,

0 commit comments

Comments
 (0)