Skip to content

Commit 2dc5cd4

Browse files
committed
Enable warning C4100 ("'identifier' : unreferenced formal parameter") and fix warnings.
1 parent fcbe93c commit 2dc5cd4

File tree

14 files changed

+48
-48
lines changed

14 files changed

+48
-48
lines changed

cmake/CMakeLists.txt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ OPTION(UNICODE_SUPPORT "Build IfcOpenShell with Unicode support (requires ICU)."
2525
OPTION(COLLADA_SUPPORT "Build IfcConvert with COLLADA support (requires OpenCOLLADA)." ON)
2626
OPTION(ENABLE_BUILD_OPTIMIZATIONS "Enable certain compiler and linker optimizations on RelWithDebInfo and Release builds." OFF)
2727
#TODO OPTION(IFCCONVERT_DOUBLE_PRECISION "IfcConvert: Use double precision floating-point numbers." OFF)
28-
OPTION(USE_IFC4 "Use IFC 4 instead of IFC 2x3" OFF)
28+
OPTION(USE_IFC4 "Use IFC 4 instead of IFC 2x3 (full rebuild recommended when switching this)" OFF)
2929
OPTION(BUILD_IFCPYTHON "Build IfcPython." ON)
3030
OPTION(BUILD_EXAMPLES "Build example applications." ON)
3131
# TODO QtViewer is deprecated ATM as it uses the 0.4 API
@@ -217,14 +217,15 @@ if(ENABLE_BUILD_OPTIMIZATIONS)
217217
endif()
218218

219219
IF(MSVC)
220+
# Enforce Unicode for CRT and Win32 API calls
221+
ADD_DEFINITIONS(-D_UNICODE -DUNICODE)
220222
# Disable warnings about unsafe C functions; we could use the safe C99 & C11 versions if we have no need for supporting old compilers.
221-
ADD_DEFINITIONS(-D_UNICODE -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
223+
ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
222224
ADD_DEFINITIONS(-bigobj) # required for building the big ifcXXX.objs, https://msdn.microsoft.com/en-us/library/ms173499.aspx
223-
# Bump up the warning level from the default 3 to 4. Disable warning C4100 ("'identifier' : unreferenced formal parameter")
224-
# (too much spam)
225-
ADD_DEFINITIONS(-W4 -wd4100)
226-
# and on VS > 2013 C4458 ("declaration of 'indentifier' hides class member") (overeager and false positives), at least for now.
227-
IF(MSVC_VERSION GREATER 1800)
225+
# Bump up the warning level from the default 3 to 4.
226+
ADD_DEFINITIONS(-W4)
227+
IF(MSVC_VERSION GREATER 1800) # > 2013
228+
# Disable overeager and false positives causing C4458 ("declaration of 'indentifier' hides class member"), at least for now.
228229
ADD_DEFINITIONS(-wd4458)
229230
ENDIF()
230231
# Link against the static VC runtime

src/examples/IfcOpenHouse.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ boost::none_t const null = boost::none;
5050
// The creation of Nurbs-surface for the IfcSite mesh, to be implemented lateron
5151
void createGroundShape(TopoDS_Shape& shape);
5252

53-
int main(int argc, char** argv) {
53+
int main() {
5454

5555
// The IfcHierarchyHelper is a subclass of the regular IfcFile that provides several
5656
// convenience functions for working with geometry in IFC files.

src/ifcconvert/ColladaSerializer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class ColladaSerializer : public GeometrySerializer
165165
bool ready();
166166
void writeHeader();
167167
void write(const IfcGeom::TriangulationElement<double>* o);
168-
void write(const IfcGeom::BRepElement<double>* o) {}
168+
void write(const IfcGeom::BRepElement<double>* /*o*/) {}
169169
void finalize();
170170
bool isTesselated() const { return true; }
171171
void setUnitNameAndMagnitude(const std::string& name, float magnitude) {

src/ifcconvert/IfcConvert.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#include "../ifcconvert/XmlSerializer.h"
4343
#include "../ifcconvert/SvgSerializer.h"
4444

45+
#include <IGESControl_Controller.hxx>
46+
4547
static std::string DEFAULT_EXTENSION = "obj";
4648

4749
void printVersion() {

src/ifcconvert/IgesSerializer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#ifndef IGESSERIALIZER_H
2121
#define IGESSERIALIZER_H
2222

23-
#include <IGESControl_Controller.hxx>
2423
#include <IGESControl_Writer.hxx>
2524
#include <Interface_Static.hxx>
2625

@@ -43,7 +42,7 @@ class IgesSerializer : public OpenCascadeBasedSerializer
4342
void finalize() {
4443
writer.Write(out_filename.c_str());
4544
}
46-
void setUnitNameAndMagnitude(const std::string& name, float magnitude) {
45+
void setUnitNameAndMagnitude(const std::string& /*name*/, float magnitude) {
4746
const char* symbol = getSymbolForUnitMagnitude(magnitude);
4847
if (symbol) {
4948
Interface_Static::SetCVal("write.iges.unit", symbol);

src/ifcconvert/OpenCascadeBasedSerializer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ class OpenCascadeBasedSerializer : public GeometrySerializer {
3737
{}
3838
virtual ~OpenCascadeBasedSerializer() {}
3939
void writeHeader() {}
40-
void writeMaterial(const IfcGeom::SurfaceStyle& style) {}
4140
bool ready();
4241
virtual void writeShape(const TopoDS_Shape& shape) = 0;
43-
void write(const IfcGeom::TriangulationElement<double>* o) {}
42+
void write(const IfcGeom::TriangulationElement<double>* /*o*/) {}
4443
void write(const IfcGeom::BRepElement<double>* o);
4544
bool isTesselated() const { return false; }
4645
void setFile(IfcParse::IfcFile*) {}

src/ifcconvert/StepSerializer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#ifndef STEPSERIALIZER_H
2121
#define STEPSERIALIZER_H
2222

23-
#include <STEPControl_Controller.hxx>
2423
#include <STEPControl_Writer.hxx>
2524
#include <Interface_Static.hxx>
2625

@@ -49,7 +48,7 @@ class StepSerializer : public OpenCascadeBasedSerializer
4948
writer.Write(out_filename.c_str());
5049
std::cout.rdbuf(sb);
5150
}
52-
void setUnitNameAndMagnitude(const std::string& name, float magnitude) {
51+
void setUnitNameAndMagnitude(const std::string& /*name*/, float magnitude) {
5352
const char* symbol = getSymbolForUnitMagnitude(magnitude);
5453
if (symbol) {
5554
Interface_Static::SetCVal("write.step.unit", symbol);

src/ifcconvert/SvgSerializer.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class SvgSerializer : public GeometrySerializer {
3535
public:
3636
typedef std::pair<std::string, std::vector<util::string_buffer> > path_object;
3737
protected:
38-
const char* getSymbolForUnitMagnitude(float mag);
3938
std::ofstream svg_file;
4039
double xmin, ymin, xmax, ymax, width, height;
4140
boost::optional<double> section_height;
@@ -62,15 +61,14 @@ class SvgSerializer : public GeometrySerializer {
6261
virtual void growBoundingBox(double x, double y) { if (x < xmin) xmin = x; if (x > xmax) xmax = x; if (y < ymin) ymin = y; if (y > ymax) ymax = y; }
6362
virtual ~SvgSerializer() {}
6463
virtual void writeHeader();
65-
virtual void writeMaterial(const IfcGeom::SurfaceStyle& style) {}
6664
virtual bool ready();
67-
virtual void write(const IfcGeom::TriangulationElement<double>* o) {}
65+
virtual void write(const IfcGeom::TriangulationElement<double>* /*o*/) {}
6866
virtual void write(const IfcGeom::BRepElement<double>* o);
6967
virtual void write(path_object& p, const TopoDS_Wire& wire);
7068
virtual path_object& start_path(IfcSchema::IfcBuildingStorey* storey, const std::string& id);
7169
virtual bool isTesselated() const { return false; }
7270
virtual void finalize();
73-
virtual void setUnitNameAndMagnitude(const std::string& name, float magnitude) {}
71+
virtual void setUnitNameAndMagnitude(const std::string& /*name*/, float /*magnitude*/) {}
7472
virtual void setFile(IfcParse::IfcFile* f) { file = f; }
7573
virtual void setBoundingRectangle(double width, double height);
7674
virtual void setSectionHeight(double h) { section_height = h; }

src/ifcconvert/WavefrontObjSerializer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ class WaveFrontOBJSerializer : public GeometrySerializer {
4646
void writeHeader();
4747
void writeMaterial(const IfcGeom::Material& style);
4848
void write(const IfcGeom::TriangulationElement<double>* o);
49-
void write(const IfcGeom::BRepElement<double>* o) {}
49+
void write(const IfcGeom::BRepElement<double>* /*o*/) {}
5050
void finalize() {}
5151
bool isTesselated() const { return true; }
52-
void setUnitNameAndMagnitude(const std::string& name, float magnitude) {}
52+
void setUnitNameAndMagnitude(const std::string& /*name*/, float /*magnitude*/) {}
5353
void setFile(IfcParse::IfcFile*) {}
5454
};
5555

src/ifcgeomserver/IfcGeomServer.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,16 @@ class IfcModel : public Command {
156156

157157
class Get : public Command {
158158
protected:
159-
void read_content(std::istream& s) {}
160-
void write_content(std::ostream& s) {}
159+
void read_content(std::istream& /*s*/) {}
160+
void write_content(std::ostream& /*s*/) {}
161161
public:
162162
Get() : Command(GET) {};
163163
};
164164

165165
class GetLog : public Command {
166166
protected:
167-
void read_content(std::istream& s) {}
168-
void write_content(std::ostream& s) {}
167+
void read_content(std::istream& /*s*/) {}
168+
void write_content(std::ostream& /*s*/) {}
169169
public:
170170
GetLog() : Command(GET_LOG) {};
171171
};
@@ -189,7 +189,7 @@ class Entity : public Command {
189189
const IfcGeom::TriangulationElement<float>* geom;
190190
bool append_line_data;
191191
protected:
192-
void read_content(std::istream& s) {}
192+
void read_content(std::istream& /*s*/) {}
193193
void write_content(std::ostream& s) {
194194
swrite<int32_t>(s, geom->id());
195195
swrite(s, geom->guid());
@@ -268,21 +268,21 @@ class Entity : public Command {
268268

269269
class Next : public Command {
270270
protected:
271-
void read_content(std::istream& s) {}
272-
void write_content(std::ostream& s) {}
271+
void read_content(std::istream& /*s*/) {}
272+
void write_content(std::ostream& /*s*/) {}
273273
public:
274274
Next() : Command(NEXT) {};
275275
};
276276

277277
class Bye : public Command {
278278
protected:
279-
void read_content(std::istream& s) {}
280-
void write_content(std::ostream& s) {}
279+
void read_content(std::istream& /*s*/) {}
280+
void write_content(std::ostream& /*s*/) {}
281281
public:
282282
Bye() : Command(BYE) {};
283283
};
284284

285-
int main (int argc, char** argv) {
285+
int main () {
286286
// Redirect stdout to this stream, so that involuntary
287287
// writes to stdout do not interfere with our protocol.
288288
std::ostringstream oss;

0 commit comments

Comments
 (0)