Commit d07793ab authored by Jan Möbius's avatar Jan Möbius
Browse files

Merge branch 'clang_warnings' into 'master'

Clang warnings

See merge request !222
parents f1b31421 df6c3cbb
......@@ -30,7 +30,7 @@ echo "CPPCHECK Summary"
echo "=============================================================================="
echo -e "${NC}"
MAX_COUNT=27
MAX_COUNT=26
if [ $COUNT -gt $MAX_COUNT ]; then
echo -e ${WARNING}
......
......@@ -62,7 +62,7 @@ if (UNIX)
# add our standard flags for Template inclusion
list(APPEND ADDITIONAL_CXX_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_C_FLAGS "-DINCLUDE_TEMPLATES" )
################################################################################
# OS Defines
################################################################################
......@@ -108,9 +108,10 @@ if (UNIX)
list(APPEND ADDITIONAL_C_FLAGS ${COMPILER_WARNINGS} )
if ("${CMAKE_CXX_COMPILER}" MATCHES ".*clang.*")
if ("${CMAKE_CXX_COMPILER}" MATCHES "Clang")
list(APPEND ADDITIONAL_CXX_FLAGS "-Weverything")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-c++98-compat")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-c++98-compat-pedantic")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-padded")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-old-style-cast")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-documentation-unknown-command")
......@@ -120,7 +121,7 @@ if (UNIX)
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-deprecated")
list(APPEND ADDITIONAL_CXX_FLAGS "-Wno-weak-vtables")
endif()
################################################################################
# STL Vector checks
################################################################################
......
......@@ -74,7 +74,7 @@ public:
operator T () const { return val_; }
// operator const T& () const { return val_; }
operator T* () const { return is_valid() ? &val_ : NULL; }
operator T* () const { return is_valid() ? &val_ : nullptr; }
private:
......
......@@ -68,7 +68,7 @@ int main(int argc, char **argv)
if ( !QGLFormat::hasOpenGL() ) {
QString msg = "System has no OpenGL support!";
QMessageBox::critical( NULL, "OpenGL", msg + argv[1] );
QMessageBox::critical( nullptr, "OpenGL", msg + argv[1] );
return -1;
}
......@@ -103,7 +103,7 @@ int main(int argc, char **argv)
QString msg = "Cannot read mesh from file:\n '";
msg += argv[optind];
msg += "'";
QMessageBox::critical( NULL, w.windowTitle(), msg );
QMessageBox::critical( nullptr, w.windowTitle(), msg );
return 1;
}
}
......@@ -118,7 +118,7 @@ int main(int argc, char **argv)
msg += "- Mesh file didn't provide texture coordinates\n";
msg += "- Texture file does not exist\n";
msg += "- Texture file is not accessible.\n";
QMessageBox::warning( NULL, w.windowTitle(), msg );
QMessageBox::warning( nullptr, w.windowTitle(), msg );
}
}
......
......@@ -63,7 +63,7 @@ MeshViewerWidget::MeshViewerWidget(QWidget* parent) : MeshViewerWidgetT<MyMesh>
QString msg = "Cannot read mesh from file:\n '";
msg += fname;
msg += "'";
QMessageBox::critical( NULL, windowTitle(), msg);
QMessageBox::critical( nullptr, windowTitle(), msg);
}
t.stop();
std::cout << "Loaded mesh in ~" << t.as_string() << std::endl;
......@@ -80,7 +80,7 @@ void MeshViewerWidget::open_texture_gui(QString fname)
msg += "- Mesh file didn't provide texture coordinates\n";
msg += "- Texture file does not exist\n";
msg += "- Texture file is not accessible.\n";
QMessageBox::warning( NULL, windowTitle(), msg );
QMessageBox::warning( nullptr, windowTitle(), msg );
}
}
......
......@@ -131,7 +131,6 @@ MeshViewerWidgetT<M>::open_mesh(const char* _filename, IO::Options _opt)
typename Mesh::ConstVertexIter vIt(mesh_.vertices_begin());
typename Mesh::ConstVertexIter vEnd(mesh_.vertices_end());
typedef typename Mesh::Point Point;
using OpenMesh::Vec3f;
Vec3f bbMin, bbMax;
......
......@@ -87,7 +87,7 @@ using namespace OpenMesh::Subdivider;
SubdivideWidget::
SubdivideWidget(QWidget* _parent, const char* _name)
: QWidget(_parent),
timer_(NULL), animate_step_(0), max_animate_steps_(4), msecs_(0)
timer_(nullptr), animate_step_(0), max_animate_steps_(4), msecs_(0)
{
setWindowTitle( QString(_name) );
......
......@@ -60,7 +60,7 @@ int main(int argc, char **argv)
if ( !QGLFormat::hasOpenGL() ) {
QString msg = "System has no OpenGL support!";
QMessageBox::critical( NULL, "OpenGL", msg + argv[1], QMessageBox::Ok );
QMessageBox::critical( nullptr, "OpenGL", msg + argv[1], QMessageBox::Ok );
return -1;
}
......@@ -77,7 +77,7 @@ int main(int argc, char **argv)
if ( ! w->open_mesh(argv[1]) )
{
QString msg = "Cannot read mesh from file ";
QMessageBox::critical( NULL, argv[1], msg + argv[1], QMessageBox::Ok );
QMessageBox::critical( nullptr, argv[1], msg + argv[1], QMessageBox::Ok );
return -1;
}
}
......
......@@ -78,9 +78,9 @@ PRIVATE_NODE_TYPESYSTEM_SOURCE(_class_); \
SO_NODE_SOURCE_TEMPLATE \
unsigned int _class_::classinstances = 0; \
SO_NODE_SOURCE_TEMPLATE \
const SoFieldData ** _class_::parentFieldData = NULL; \
const SoFieldData ** _class_::parentFieldData = nullptr; \
SO_NODE_SOURCE_TEMPLATE \
SoFieldData * _class_::fieldData = NULL; \
SoFieldData * _class_::fieldData = nullptr; \
\
SO_NODE_SOURCE_TEMPLATE \
const SoFieldData ** \
......
......@@ -78,7 +78,7 @@ int main(int argc, char **argv)
if ( !QGLFormat::hasOpenGL() ) {
QString msg = "System has no OpenGL support!";
QMessageBox::critical( NULL, "OpenGL", msg + argv[1], 0 );
QMessageBox::critical( nullptr, "OpenGL", msg + argv[1], 0 );
return -1;
}
......@@ -115,7 +115,7 @@ int main(int argc, char **argv)
QString msg = "Cannot read mesh from file:\n '";
msg += argv[optind];
msg += "'";
QMessageBox::critical( NULL, w->caption(), msg, 0 );
QMessageBox::critical( nullptr, w->caption(), msg, 0 );
return 1;
}
}
......@@ -130,7 +130,7 @@ int main(int argc, char **argv)
msg += "- Mesh file didn't provide texture coordinates\n";
msg += "- Texture file does not exist\n";
msg += "- Texture file is not accessible.\n";
QMessageBox::warning( NULL, w->caption(), msg, 0 );
QMessageBox::warning( nullptr, w->caption(), msg, 0 );
}
}
......
......@@ -325,7 +325,7 @@ void mouse(int button, int state, int x, int y)
{
g.mgr->mouseButtonRelease(button, x, y);
// if ( g.mode & FLYMODE )
// glutIdleFunc(NULL);
// glutIdleFunc(nullptr);
}
else
{
......
......@@ -64,7 +64,7 @@ set_vdpm(const char _vdpm_name[256])
}
#endif
vdpm_ = ((VDPMServerViewerWidget *) ((VDPMServerSocket *) parent())->parent())->get_vdpm(_vdpm_name);
if (vdpm_ == NULL)
if (vdpm_ == nullptr)
return false;
vhierarchy_ = &vdpm_->vhierarchy();
......
......@@ -72,7 +72,7 @@ get_vdpm(const char _vdpm_name[256])
}
}
return NULL;
return nullptr;
}
void
......
......@@ -64,7 +64,7 @@ set_vdpm(const char _vdpm_name[256])
}
#endif
vdpm_ = ((VDPMServerViewerWidget *) ((VDPMServerSocket *) parent())->parent())->get_vdpm(_vdpm_name);
if (vdpm_ == NULL)
if (vdpm_ == nullptr)
return false;
vhierarchy_ = &vdpm_->vhierarchy();
......
......@@ -71,7 +71,7 @@ get_vdpm(const char _vdpm_name[256])
}
}
return NULL;
return nullptr;
}
void
......
......@@ -114,7 +114,7 @@ public: // inherited
n_roots_ = calc_bits_for_roots(n_vertices_);
}
virtual float collapse_priority(const CollapseInfo& _ci)
virtual float collapse_priority(const CollapseInfo& _ci) override
{
level_t newlevel = std::max( BaseModQ::mesh().property( level_, _ci.v0 ),
BaseModQ::mesh().property( level_, _ci.v1 ) )+1;
......@@ -135,7 +135,7 @@ public: // inherited
}
/// post-process halfedge collapse (accumulate quadrics)
void postprocess_collapse(const CollapseInfo& _ci)
void postprocess_collapse(const CollapseInfo& _ci) override
{
BaseModQ::postprocess_collapse( _ci );
......
......@@ -258,7 +258,7 @@ find_writer(const std::string& _format)
if ((*it)->can_u_write(filename))
return *it;
return NULL;
return nullptr;
}
......
......@@ -135,7 +135,7 @@ namespace OMFormat {
default:
std::clog << "as_string(Chunk::Entity): Invalid value!";
}
return NULL;
return nullptr;
}
......@@ -153,7 +153,7 @@ namespace OMFormat {
case Chunk::Type_Custom: return "Custom";
case Chunk::Type_Topology: return "Topology";
}
return NULL;
return nullptr;
}
......@@ -172,7 +172,7 @@ namespace OMFormat {
case Chunk::Dim_7D: return "7D";
case Chunk::Dim_8D: return "8D";
}
return NULL;
return nullptr;
}
......@@ -187,7 +187,7 @@ namespace OMFormat {
case Chunk::Integer_32 : return "32";
case Chunk::Integer_64 : return "64";
}
return NULL;
return nullptr;
}
const char *as_string(Chunk::Float_Size d)
......@@ -198,7 +198,7 @@ namespace OMFormat {
case Chunk::Float_64 : return "64";
case Chunk::Float_128: return "128";
}
return NULL;
return nullptr;
}
......
......@@ -144,7 +144,7 @@ public:
virtual OpenMesh::Attributes::StatusInfo status(HalfedgeHandle _heh) const = 0;
// get reference to base kernel
virtual const BaseKernel* kernel() { return 0; }
virtual const BaseKernel* kernel() { return nullptr; }
// query number of faces, vertices, normals, texcoords
......
......@@ -196,7 +196,7 @@ public:
virtual void add_texture_information( int _id , std::string _name ) = 0;
// get reference to base kernel
virtual BaseKernel* kernel() { return 0; }
virtual BaseKernel* kernel() { return nullptr; }
virtual bool is_triangle_mesh() const { return false; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment