MSYS build scripts and instructions (#99) and warning fixes

* Preliminary MSYS2 + MinGW build scripts and instructions.

* CMakeLists.txt: MinGW tweaks, enforce C++03, suppress warnings for now.

* Fix some GCC warnings.

* Fix unused parameter warnings coming from Ifc*.h.

* Fix warning regarding unreachable code (++jt) on MSVC.

* Add IfcParse_EXPORT for IfcInvalidTokenException

* Fix potentially uninitialized pointer variables.

* Note about OpenCASCADE cyclic dependencies fix.

* GCC warning fix: don't generate 'current_enum' variable that is only set and not used for anything ever

* Work around -Wmaybe-uninitialized warnings about boost::optional constructs. Also prevent passing of negative values for --bounds.

* Remove unused variable.

* CMakeLists.txt: ENABLE_BUILD_OPTIMIZATIONS for GCC (simply enforce -03)
This commit is contained in:
Ali Kämäräinen
2016-07-15 06:49:32 +03:00
committed by Thomas Krijnen
parent 435eb7ae10
commit 4a85e5e7a5
26 changed files with 1125 additions and 938 deletions
+3 -4
View File
@@ -40,7 +40,6 @@
#include <boost/program_options.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/optional/optional_io.hpp>
#include <fstream>
#include <sstream>
@@ -279,10 +278,10 @@ int main(int argc, char** argv) {
const bool generate_uvs = vmap.count("generate-uvs") != 0 ;
const bool deflection_tolerance_specified = vmap.count("deflection-tolerance") != 0 ;
boost::optional<int> bounding_width, bounding_height;
int bounding_width = -1, bounding_height = -1;
if (vmap.count("bounds") == 1) {
int w, h;
if (sscanf(bounds.c_str(), "%ux%u", &w, &h) == 2) {
if (sscanf(bounds.c_str(), "%ux%u", &w, &h) == 2 && w > 0 && h > 0) {
bounding_width = w;
bounding_height = h;
} else {
@@ -404,7 +403,7 @@ int main(int argc, char** argv) {
settings.set(IfcGeom::IteratorSettings::DISABLE_TRIANGULATION, true);
serializer = new SvgSerializer(output_temp_filename, settings);
if (bounding_width && bounding_height) {
static_cast<SvgSerializer*>(serializer)->setBoundingRectangle(*bounding_width, *bounding_height);
static_cast<SvgSerializer*>(serializer)->setBoundingRectangle(bounding_width, bounding_height);
}
} else {
Logger::Message(Logger::LOG_ERROR, "Unknown output filename extension '" + output_extension + "'");