Skip to content
Snippets Groups Projects
Commit 7afc9b1d authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

for mscv

parent b4de0b37
No related branches found
No related tags found
No related merge requests found
......@@ -160,7 +160,7 @@ include(CheckCXXCompilerFlag)
if(MSVC)
# remove annoying warning about bool/int cast performance
set(GMSH_CONFIG_PRAGMAS "#pragma warning(disable:4800)")
set(GMSH_CONFIG_PRAGMAS "#pragma warning(disable:4800 4244 4267)")
if(ENABLE_MSVC_STATIC_RUNTIME)
foreach(VAR
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
......@@ -975,12 +975,12 @@ endif(NOOPT)
# force full warnings to encourage everybody to write clean(er) code
check_cxx_compiler_flag("-Wall" WALL)
if(WALL)
if(WALL AND NOT MSVC)
file(GLOB_RECURSE WALL_SRC Common/*.cpp Fltk/*.cpp FunctionSpace/*.cpp
Geo/*.cpp Graphics/*.cpp Mesh/*.cpp Numeric/*.cpp Parser/*.cpp
Plugin/*.cpp Post/*.cpp Qt/*.cpp Solver/*.cpp contrib/onelab/*.cpp)
set_source_files_properties(${WALL_SRC} COMPILE_FLAGS "-Wall")
endif(WALL)
endif(WALL AND NOT MSVC)
list(SORT CONFIG_OPTIONS)
set(GMSH_CONFIG_OPTIONS "")
......
......@@ -91,8 +91,8 @@ std::string FixRelativePath(const std::string &reference, const std::string &in)
std::vector<std::string> SplitFileName(const std::string &fileName)
{
// returns [path, baseName, extension]
int idot = fileName.find_last_of('.');
int islash = fileName.find_last_of("/\\");
int idot = (int)fileName.find_last_of('.');
int islash = (int)fileName.find_last_of("/\\");
if(idot == (int)std::string::npos) idot = -1;
if(islash == (int)std::string::npos) islash = -1;
std::vector<std::string> s(3);
......@@ -125,7 +125,7 @@ void ReplaceSubStringInPlace(const std::string &olds, const std::string &news,
std::string &str)
{
while(1){
int pos = str.find(olds.c_str());
int pos = (int)str.find(olds.c_str());
if(pos == (int)std::string::npos) break;
str.replace(pos, olds.size(), news.c_str());
}
......
......@@ -118,7 +118,7 @@ class BarycenterHash {
public:
std::size_t operator()(const Barycenter &b) const
{
return b.x()+b.y()+b.z();
return (std::size_t)(b.x() + b.y() + b.z());
}
};
......@@ -155,11 +155,11 @@ class VertexArray{
VertexArray(int numVerticesPerElement, int numElements);
~VertexArray(){}
// return the number of vertices in the array
int getNumVertices() { return _vertices.size() / 3; }
int getNumVertices() { return (int)_vertices.size() / 3; }
// return the number of vertices per element
int getNumVerticesPerElement() { return _numVerticesPerElement; }
// return the number of element pointers
int getNumElementPointers() { return _elements.size(); }
int getNumElementPointers() { return (int)_elements.size(); }
// return a pointer to the raw vertex array (warning: 1) we don't
// range check 2) calling this if _vertices.size() == 0 will cause
// some compilers to throw an exception)
......
......@@ -18,7 +18,7 @@ std::vector<MVertex*>* MVertexBoundaryLayerData::getChildren(int i)
int MVertexBoundaryLayerData::getNumChildren(int i)
{
if (i < (int)this->children.size() && i >= 0) {
return this->children[i].size();
return (int)this->children[i].size();
}
else {
return -1;
......@@ -27,7 +27,7 @@ int MVertexBoundaryLayerData::getNumChildren(int i)
int MVertexBoundaryLayerData::getNumChildrenFamilies()
{
return this->children.size();
return (int)this->children.size();
}
void MVertexBoundaryLayerData::addChildrenFamily(std::vector<MVertex*> family)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment