Commit 0eed438f authored by Travis Hunter's avatar Travis Hunter Committed by Yuri Chornoivan
Browse files

Clean up Clang compiler warnings

parent 5a9539ed
# Ignore build directory
build/
# Ignore IDE project files
.kdev4/
step.kdev4
......@@ -68,12 +68,19 @@ set(STEPCORE_WITH_GSL ${GSL_FOUND} CACHE BOOL "Enable GSL-powered features for S
set(STEPCORE_WITH_QT ON) # CACHE BOOL "Enable QT-powered features for StepCore")
set(STEP_WITH_QALCULATE ${QALCULATE_FOUND} CACHE BOOL "Enable unit conversion support using libqalculate")
# These settings are forced by Eigen2 creating many many warnings without them.
# FIXME: How can we make Eigen behave and not need them?
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
# Compiler specific options
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# Clang specific options
include(${CMAKE_CURRENT_SOURCE_DIR}/Clang.cmake)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# GCC specific options
include(${CMAKE_CURRENT_SOURCE_DIR}/GCC.cmake)
else()
# Some other compiler
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${EIGEN3_INCLUDE_DIR})
# Eigen3 generates a lot of warnings. Suppress them by including as system headers (-isystem /PATH/TO/EIGEN3_INCLUDE_DIR)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} SYSTEM ${EIGEN3_INCLUDE_DIR})
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
......
# This file is for Clang specific options.
# The macro STEPCORE_OBJECT expands to include the definition of a virtual function. This
# function definition does not specify 'override', so where STEPCORE_OBJECT is used in
# derived classes, the compiler complains that the function is not defined with 'override'
# and throws a warning. This will suppress that warning, pending a better way to do it
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-inconsistent-missing-override")
......@@ -739,6 +739,9 @@ void PropertiesBrowser::worldDataChanged(bool dynamicOnly)
void PropertiesBrowser::worldRowsRemoved(const QModelIndex& parent, int start, int end)
{
Q_UNUSED(parent)
Q_UNUSED(start)
Q_UNUSED(end)
if(!_worldModel->objectIndex(_propertiesBrowserModel->object()).isValid())
_propertiesBrowserModel->setObject(NULL);
}
......
......@@ -1031,7 +1031,7 @@ void GraphGraphicsItem::worldDataChanged(bool dynamicOnly)
if(_worldModel->isSimulationActive()) {
if(_worldModel->world()->time() > _lastPointTime
+ 1.0/_worldModel->simulationFps() - 1e-2/_worldModel->simulationFps()) {
StepCore::Vector2d point = graph()->recordPoint();
graph()->recordPoint();
_lastPointTime = _worldModel->world()->time();
}
}
......
......@@ -568,6 +568,7 @@ QString WorldModel::newItemName(const QString& className)
StepCore::Item* WorldModel::createItem(const QString& className, StepCore::ItemGroup* parent)
{
Q_UNUSED(parent)
StepCore::Item* item = _worldFactory->newItem(className);
if(item == NULL) return NULL;
item->setName(getUniqueName(className));
......
......@@ -136,6 +136,8 @@ WorldScene::WorldScene(WorldModel* worldModel, QObject* parent)
#ifdef __GNUC__
#warning TODO: measure what index method is faster
#endif
// Alternative index method is BspTreeIndex
setItemIndexMethod(NoIndex);
//XXX
//setct(-200,-200,400,400);
......
......@@ -341,8 +341,8 @@ struct MetaPropertyHelper {
return (dynamic_cast<C*>(obj)->*_write)(tv);
}
static QVariant readNull(const Object* obj) { return QVariant(); }
static QString readStringNull(const Object* obj) { return QString(); }
static QVariant readNull(const Object* obj) { Q_UNUSED(obj) return QVariant(); }
static QString readStringNull(const Object* obj) { Q_UNUSED(obj) return QString(); }
static bool writeNull(Object* obj, const QVariant& v) { Q_UNUSED(obj) Q_UNUSED(v) return false; }
static bool writeStringNull(Object* obj, const QString& s) { Q_UNUSED(obj) Q_UNUSED(s) 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