Fixed a few warnings in headers (meaning they were reported once for each include)

Fixed an identification of CXX compiler in cmake so that 'AppleClang' is recognized
This commit is contained in:
Lukas Matena 2019-07-23 11:22:54 +02:00
parent 506be9035b
commit 91a5d70a62
6 changed files with 12 additions and 12 deletions

View File

@ -162,7 +162,7 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX)
endif () endif ()
endif() endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_compile_options(-Wall) add_compile_options(-Wall)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reorder" ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reorder" )
@ -170,7 +170,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STRE
add_compile_options(-Werror=return-type) add_compile_options(-Werror=return-type)
#removes LOTS of extraneous Eigen warnings (GCC only supports it since 6.1) #removes LOTS of extraneous Eigen warnings (GCC only supports it since 6.1)
#if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6.1) #if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6.1)
# add_compile_options(-Wno-ignored-attributes) # Tamas: Eigen include dirs are marked as SYSTEM # add_compile_options(-Wno-ignored-attributes) # Tamas: Eigen include dirs are marked as SYSTEM
#endif() #endif()

View File

@ -172,7 +172,7 @@ extern std::string xml_escape(std::string text);
#if defined __GNUC__ && __GNUC__ < 5 && !defined __clang__ #if defined __GNUC__ && __GNUC__ < 5 && !defined __clang__
// Older GCCs don't have std::is_trivially_copyable // Older GCCs don't have std::is_trivially_copyable
// cf. https://gcc.gnu.org/onlinedocs/gcc-4.9.4/libstdc++/manual/manual/status.html#status.iso.2011 // cf. https://gcc.gnu.org/onlinedocs/gcc-4.9.4/libstdc++/manual/manual/status.html#status.iso.2011
#warning "GCC version < 5, faking std::is_trivially_copyable" // #warning "GCC version < 5, faking std::is_trivially_copyable"
template<typename T> struct IsTriviallyCopyable { static constexpr bool value = true; }; template<typename T> struct IsTriviallyCopyable { static constexpr bool value = true; };
#else #else
template<typename T> struct IsTriviallyCopyable : public std::is_trivially_copyable<T> {}; template<typename T> struct IsTriviallyCopyable : public std::is_trivially_copyable<T> {};

View File

@ -166,7 +166,7 @@ void GLGizmoBase::set_highlight_color(const float* color)
void GLGizmoBase::enable_grabber(unsigned int id) void GLGizmoBase::enable_grabber(unsigned int id)
{ {
if ((0 <= id) && (id < (unsigned int)m_grabbers.size())) if (id < m_grabbers.size())
m_grabbers[id].enabled = true; m_grabbers[id].enabled = true;
on_enable_grabber(id); on_enable_grabber(id);
@ -174,7 +174,7 @@ void GLGizmoBase::enable_grabber(unsigned int id)
void GLGizmoBase::disable_grabber(unsigned int id) void GLGizmoBase::disable_grabber(unsigned int id)
{ {
if ((0 <= id) && (id < (unsigned int)m_grabbers.size())) if (id < m_grabbers.size())
m_grabbers[id].enabled = false; m_grabbers[id].enabled = false;
on_disable_grabber(id); on_disable_grabber(id);

View File

@ -93,19 +93,19 @@ protected:
} }
virtual void on_set_hover_id() virtual void on_set_hover_id()
{ {
for (unsigned int i = 0; i < 3; ++i) for (int i = 0; i < 3; ++i)
{ {
m_gizmos[i].set_hover_id((m_hover_id == i) ? 0 : -1); m_gizmos[i].set_hover_id((m_hover_id == i) ? 0 : -1);
} }
} }
virtual void on_enable_grabber(unsigned int id) virtual void on_enable_grabber(unsigned int id)
{ {
if ((0 <= id) && (id < 3)) if (id < 3)
m_gizmos[id].enable_grabber(0); m_gizmos[id].enable_grabber(0);
} }
virtual void on_disable_grabber(unsigned int id) virtual void on_disable_grabber(unsigned int id)
{ {
if ((0 <= id) && (id < 3)) if (id < 3)
m_gizmos[id].disable_grabber(0); m_gizmos[id].disable_grabber(0);
} }
virtual void on_start_dragging(); virtual void on_start_dragging();

View File

@ -223,7 +223,7 @@ void GLGizmosManager::update_data()
enable_grabber(Rotate, 1, !is_wipe_tower); enable_grabber(Rotate, 1, !is_wipe_tower);
bool enable_scale_xyz = selection.is_single_full_instance() || selection.is_single_volume() || selection.is_single_modifier(); bool enable_scale_xyz = selection.is_single_full_instance() || selection.is_single_volume() || selection.is_single_modifier();
for (int i = 0; i < 6; ++i) for (unsigned int i = 0; i < 6; ++i)
{ {
enable_grabber(Scale, i, enable_scale_xyz); enable_grabber(Scale, i, enable_scale_xyz);
} }

View File

@ -323,9 +323,9 @@ public:
} }
bool SwapChildrens(int frst_id, int scnd_id) { bool SwapChildrens(int frst_id, int scnd_id) {
if (GetChildCount() < 2 || if (GetChildCount() < 2 ||
frst_id < 0 || frst_id >= GetChildCount() || frst_id < 0 || (size_t)frst_id >= GetChildCount() ||
scnd_id < 0 || scnd_id >= GetChildCount()) scnd_id < 0 || (size_t)scnd_id >= GetChildCount())
return false; return false;
ObjectDataViewModelNode new_scnd = *GetNthChild(frst_id); ObjectDataViewModelNode new_scnd = *GetNthChild(frst_id);