Skip to content

Commit

Permalink
fix windows compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan E. Sanchez committed Oct 4, 2014
1 parent 34d91ed commit 0a1b16e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 129 deletions.
1 change: 0 additions & 1 deletion src/Geometry/CMakeLists.txt
Expand Up @@ -3,7 +3,6 @@ SET (CXX_SRCS
Region.cc
Edge.cc
Node.cc
Vector.cc
Coordinate.cc
Triangle.cc
Contact.cc
Expand Down
119 changes: 0 additions & 119 deletions src/Geometry/Vector.cc

This file was deleted.

2 changes: 1 addition & 1 deletion src/commands/ModelCommands.cc
Expand Up @@ -1018,7 +1018,7 @@ setNodeValueCmd(CommandHandler &data)
os << "Model " << name << " does not exist\n";
errorString += os.str();
}
else if ((index < -1) || ((index != -1) && (index >= nm_name->GetRegion().GetNumberNodes())))
else if ((index < -1) || ((index != -1) && (static_cast<size_t>(index) >= nm_name->GetRegion().GetNumberNodes())))
{
std::ostringstream os;
os << "-index " << index << " does not exist\n";
Expand Down
6 changes: 3 additions & 3 deletions src/meshing/GeniusLoader.cc
Expand Up @@ -453,7 +453,7 @@ bool GeniusLoader::Instantiate_(const std::string &deviceName, std::string &erro
dsAssert ((plen > 0), "UNEXPECTED mesh problem");
for (size_t i = 0; i < plen; ++i)
{
int pindex = points[i];
size_t pindex = static_cast<size_t>(points[i]);
dsAssert ((pindex > 1) || (pindex < nlen), "UNEXPECTED mesh problem");
ConstNodePtr np = nodeList[pindex];
cnodes.push_back(np);
Expand Down Expand Up @@ -568,8 +568,8 @@ bool GeniusLoader::Instantiate_(const std::string &deviceName, std::string &erro
inodes1.clear();
for (size_t i = 0; i < plen; ++i)
{
const int pindex0 = points0[i];
const int pindex1 = points1[i];
const size_t pindex0 = static_cast<size_t>(points0[i]);
const size_t pindex1 = static_cast<size_t>(points1[i]);
dsAssert ((pindex0 > 1) || (pindex0 < nlen0), "UNEXPECTED mesh problem");
dsAssert ((pindex1 > 1) || (pindex1 < nlen1), "UNEXPECTED mesh problem");

Expand Down
3 changes: 1 addition & 2 deletions src/meshing/GeniusReader.cc
Expand Up @@ -179,7 +179,6 @@ bool ReadGeniusFile(const std::string &fname, const std::string &meshName, std::
ZoneType_t ztype;
int zinfo[3];
int nd;
int ier;
for (int zi = 1; zi <= nzones; ++zi)
{
dsMesh::GeniusRegionPtr rinfop(new dsMesh::GeniusRegion);
Expand Down Expand Up @@ -417,7 +416,7 @@ int processRegionElements(dsMesh::GeniusRegionPtr grp, std::string &errorString)
int ret = 0;
dsMesh::GeniusRegion &region = *grp;
const std::vector<int> &edata = region.edata;
const int edatalen = edata.size();
const size_t edatalen = edata.size();
const int nelem = region.nelem;
size_t elem_count = 0;
size_t eindex = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/tclapi/TclCommands.cc
Expand Up @@ -89,7 +89,7 @@ CmdDispatch(ClientData clientData, Tcl_Interp *interp,
myerror = TCL_ERROR;
Tcl_SetResult(interp, const_cast<char *>("OUT OF MEMORY"), TCL_VOLATILE);
}
catch (std::exception &e)
catch (std::exception &)
{
myerror = TCL_ERROR;
Tcl_SetResult(interp, const_cast<char *>("UNEXPECTED ERROR"), TCL_VOLATILE);
Expand Down
13 changes: 11 additions & 2 deletions win32.cmake
Expand Up @@ -10,8 +10,17 @@ SET (BISON "C:/cygwin/bin/bison.exe")

ADD_DEFINITIONS(-DSTATIC_BUILD -D_USE_MATH_DEFINES -DTCL_THREADS)
#Math stuff
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:strict")
SET (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /fp:strict")
# warning C4005: concerning macro redefines in stdint.h
# warning C4244: conversion from 'size_t' to 'const double'
# warning C4267: possible loss of data
# warning C4503: Decorated name length truncated
# warning C4800: casting from point to bool performance warning
# warning C4996: 'isatty': The POSIX name for this item is deprecated
# dll linkage warning from python, define HAVE_ROUND
SET (WARNINGS_IGNORE " /wd4005 /wd4244 /wd4267 /wd4503 /wd4800 /wd4996 /DHAVE_ROUND")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:strict ${WARNINGS_IGNORE}")
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:strict ${WARNINGS_IGNORE}")

SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
Expand Down

0 comments on commit 0a1b16e

Please sign in to comment.