Commit 43ed4020 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Trying to fix linking-related issue when building both OpenIGTLink module and scripting feature.

Fixed various GCC and Cppcheck warnings.
parent 84a914e7
......@@ -280,11 +280,10 @@ namespace campvis {
tgt::mat4 MatrixProcessor::processModifierString(tgt::mat4 matrix, std::string modifiers)
{
int pos = 0;
size_t pos = 0;
tgt::mat4 result = matrix, tmp;
while (pos < modifiers.size())
{
while (pos < modifiers.size()) {
switch (modifiers[pos]) {
case 'I':
if (!result.invert(tmp)) {
......
......@@ -341,9 +341,7 @@ namespace campvis {
float spacing[3]; // spacing (mm/pixel)
int svsize[3]; // sub-volume size
int svoffset[3]; // sub-volume offset
int scalarType; // scalar type
scalarType = imgMsg->GetScalarType();
imgMsg->GetDimensions(size);
imgMsg->GetSpacing(spacing);
imgMsg->GetSubVolume(svsize, svoffset);
......
......@@ -69,6 +69,7 @@ MACRO(DECLARE_LUA_MODULE InterfaceFile)
SET_SOURCE_FILES_PROPERTIES(${InterfaceFile} PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(${InterfaceFile} PROPERTIES SWIG_FLAGS "-I${CampvisHome}")
LINK_DIRECTORIES(${CampvisGlobalLinkDirectories} ${CampvisModulesLinkDirectories})
SWIG_ADD_MODULE(${LuaModName} lua ${InterfaceFile})
SWIG_LINK_LIBRARIES(${LuaModName} tgt campvis-core campvis-modules ${CampvisGlobalExternalLibs})
......@@ -119,6 +120,7 @@ LIST(APPEND CampvisScriptingHeaders "swigluarun.h")
ADD_DEFINITIONS(${CampvisGlobalDefinitions} ${CampvisScriptingDefinitions})
INCLUDE_DIRECTORIES(${CampvisGlobalIncludeDirs} ${CMAKE_CURRENT_BINARY_DIR})
LINK_DIRECTORIES(${CampvisGlobalLinkDirectories} ${CampvisModulesLinkDirectories})
ADD_LIBRARY(campvis-scripting STATIC
${CampvisScriptingSources} ${CampvisScriptingHeaders}
......
......@@ -88,9 +88,9 @@ TEST_F(DataContainerTest, miscellaneousTest) {
* Tests the function getDataHandlesCopy.
*/
TEST_F(DataContainerTest, getDataHandlesCopyTest) {
EXPECT_EQ(0, this->_dc0->getDataHandlesCopy().size());
EXPECT_EQ(0U, this->_dc0->getDataHandlesCopy().size());
this->_dc0->addData("data1", this->_data);
EXPECT_EQ(1, this->_dc0->getDataHandlesCopy().size());
EXPECT_EQ(1U, this->_dc0->getDataHandlesCopy().size());
std::pair<std::string, DataHandle> pair = this->_dc0->getDataHandlesCopy()[0];
EXPECT_EQ("data1", pair.first);
EXPECT_EQ(this->_data, pair.second.getData());
......
......@@ -80,8 +80,8 @@ protected:
TEST_F(ImageDataTest, miscellaneousTest) {
ASSERT_TRUE(nullptr != _imgData1);
EXPECT_EQ(2, _imgData0->getDimensionality());
EXPECT_EQ(4, _imgData0->getNumChannels());
EXPECT_EQ(2U, _imgData0->getDimensionality());
EXPECT_EQ(4U, _imgData0->getNumChannels());
EXPECT_EQ(tgt::hmul(_size), _imgData0->getNumElements());
tgt::Bounds bound0 = _imgData0->getWorldBounds();
......
......@@ -71,12 +71,12 @@ protected:
* getImage()
*/
TEST_F(ImageSeriesTest, miscellaneousTest) {
EXPECT_EQ(0, _imgSeries1.getNumImages());
EXPECT_EQ(1, _imgSeries2.getNumImages());
EXPECT_EQ(1, _imgSeries3.getNumImages());
EXPECT_EQ(0U, _imgSeries1.getNumImages());
EXPECT_EQ(1U, _imgSeries2.getNumImages());
EXPECT_EQ(1U, _imgSeries3.getNumImages());
_imgSeries3.addImage(_image);
EXPECT_EQ(2, _imgSeries3.getNumImages());
EXPECT_EQ(2U, _imgSeries3.getNumImages());
EXPECT_EQ(_dh.getData(), _imgSeries3.getImage(_imgSeries3.getNumImages()-1).getData());
}
......
......@@ -107,10 +107,10 @@ TEST_F(StringPropertyTest, sharedPropertyTest) {
// getSharedProperties()
std::set<AbstractProperty*> sharedProps = this->_strProp1.getSharedProperties();
EXPECT_EQ(0, sharedProps.size());
EXPECT_EQ(0U, sharedProps.size());
this->_strProp1.addSharedProperty(&this->_strProp2);
sharedProps = this->_strProp1.getSharedProperties();
EXPECT_EQ(1, sharedProps.size());
EXPECT_EQ(1U, sharedProps.size());
AbstractProperty *prop = *sharedProps.begin();
EXPECT_EQ(this->_strProp2.getName(), prop->getName());
}
......
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