Commit d71fc18d authored by Jan Möbius's avatar Jan Möbius

Merge branch 'cppcheck_fixes' into 'master'

Cppcheck fixes via gitlab



See merge request !60
parents 0837d5d1 4e9e5b26
Pipeline #1676 passed with stage
......@@ -27,3 +27,8 @@ macos-c++98:
script: "CI/ci-mac.sh C++98"
tags:
- Apple
cppcheck:
script: "CI/ci-cppcheck.sh"
tags:
- Linux
#!/bin/bash
# Exit script on any error
set -e
#=====================================
# Color Settings:
#=====================================
NC='\033[0m'
OUTPUT='\033[0;32m'
WARNING='\033[0;93m'
echo -e "${OUTPUT}"
echo "=============================================================================="
echo "Running cppcheck"
echo "=============================================================================="
echo -e "${NC}"
echo "Please Wait ..."
# Run cppcheck and output into file
cppcheck --enable=all . -I src -i Doc/ --force --suppress=unusedFunction --suppress=missingIncludeSystem --quiet vi src/OpenMesh/Tools/Utils/Timer.hh -Umin -Umax -UBMPOSTFIX -DOPENMESHDLLEXPORT="" &> cppcheck.log
echo -e "${OUTPUT}"
echo "=============================================================================="
echo "CPPCHECK Messages"
echo "=============================================================================="
echo -e "${NC}"
# Echo output to command line for simple analysis via gitlab
cat cppcheck.log
COUNT=$(wc -l < cppcheck.log )
echo -e "${OUTPUT}"
echo "=============================================================================="
echo "CPPCHECK Summary"
echo "=============================================================================="
echo -e "${NC}"
if [ $COUNT -gt 0 ]; then
echo -e ${WARNING}
echo "Total CPPCHECK error Count is $COUNT, which is too High! CPPCHECK Run failed";
echo -e "${NC}"
exit 1;
else
echo "Total CPPCHECK error Count is $COUNT ... OK"
fi
......@@ -252,11 +252,7 @@ stream_vsplits()
VHierarchyNodeHandle node_handle;
OpenMesh::Vec3f pos;
VHierarchyNodeIndex node_index, fund_lcut_index, fund_rcut_index;
float lchild_radius, rchild_radius;
OpenMesh::Vec3f lchild_normal, rchild_normal;
float lchild_sin_square, rchild_sin_square;
float lchild_mue_square, rchild_mue_square;
float lchild_sigma_square, rchild_sigma_square;
unsigned int n_vsplit_packets = (unsigned int) vsplits_.size();
QDataStream qTcp(socket_);
......@@ -277,11 +273,11 @@ stream_vsplits()
node_index = node.node_index();
fund_lcut_index = node.fund_lcut_index();
fund_rcut_index = node.fund_rcut_index();
lchild_radius = lchild.radius(); rchild_radius = rchild.radius();
const float lchild_radius = lchild.radius(); const float rchild_radius = rchild.radius();
lchild_normal = lchild.normal(); rchild_normal = rchild.normal();
lchild_sin_square = lchild.sin_square(); rchild_sin_square = rchild.sin_square();
lchild_mue_square = lchild.mue_square(); rchild_mue_square = rchild.mue_square();
lchild_sigma_square = lchild.sigma_square(); rchild_sigma_square = rchild.sigma_square();
const float lchild_sin_square = lchild.sin_square(); const float rchild_sin_square = rchild.sin_square();
const float lchild_mue_square = lchild.mue_square(); const float rchild_mue_square = rchild.mue_square();
const float lchild_sigma_square = lchild.sigma_square(); const float rchild_sigma_square = rchild.sigma_square();
qTcp << pos[0] << pos[1] << pos[2]
<< node_index.value()
......
......@@ -245,11 +245,7 @@ stream_vsplits()
VHierarchyNodeHandle node_handle;
OpenMesh::Vec3f pos;
VHierarchyNodeIndex node_index, fund_lcut_index, fund_rcut_index;
float lchild_radius, rchild_radius;
OpenMesh::Vec3f lchild_normal, rchild_normal;
float lchild_sin_square, rchild_sin_square;
float lchild_mue_square, rchild_mue_square;
float lchild_sigma_square, rchild_sigma_square;
unsigned int n_vsplit_packets = (unsigned int) vsplits_.size();
QDataStream qTcp(this);
......@@ -270,11 +266,11 @@ stream_vsplits()
node_index = node.node_index();
fund_lcut_index = node.fund_lcut_index();
fund_rcut_index = node.fund_rcut_index();
lchild_radius = lchild.radius(); rchild_radius = rchild.radius();
lchild_normal = lchild.normal(); rchild_normal = rchild.normal();
lchild_sin_square = lchild.sin_square(); rchild_sin_square = rchild.sin_square();
lchild_mue_square = lchild.mue_square(); rchild_mue_square = rchild.mue_square();
lchild_sigma_square = lchild.sigma_square(); rchild_sigma_square = rchild.sigma_square();
const float lchild_radius = lchild.radius(); const float rchild_radius = rchild.radius();
lchild_normal = lchild.normal(); rchild_normal = rchild.normal();
const float lchild_sin_square = lchild.sin_square(); const float rchild_sin_square = rchild.sin_square();
const float lchild_mue_square = lchild.mue_square(); const float rchild_mue_square = rchild.mue_square();
const float lchild_sigma_square = lchild.sigma_square(); const float rchild_sigma_square = rchild.sigma_square();
qTcp << pos[0] << pos[1] << pos[2]
<< node_index.value()
......
......@@ -67,7 +67,8 @@ namespace VDPM {
VHierarchy::
VHierarchy()
VHierarchy() :
n_roots_(0), tree_id_bits_(0)
{
clear();
}
......
......@@ -96,7 +96,7 @@ class VHierarchyNode
{
public:
VHierarchyNode() { }
VHierarchyNode() :radius_(0.0f), sin_square_(0.0f),mue_square_(0.0f), sigma_square_(0.0f) { }
/// Returns true, if node is root else false.
bool is_root() const
......
......@@ -77,27 +77,17 @@ namespace VDPM {
VHierarchyWindow::
VHierarchyWindow()
VHierarchyWindow() :
vhierarchy_(NULL), buffer_(NULL),buffer_min_ (0), buffer_max_(0), window_min_(0), window_max_(0), current_pos_(0) , n_shift_(0)
{
vhierarchy_ = NULL;
buffer_ = NULL;
buffer_min_ = 0;
buffer_max_ = 0;
window_min_ = 0;
window_max_ = 0;
current_pos_ = 0;
n_shift_ = 0;
}
VHierarchyWindow::
VHierarchyWindow(VHierarchy &_vhierarchy)
VHierarchyWindow(VHierarchy &_vhierarchy) :
vhierarchy_(&_vhierarchy),buffer_(NULL),buffer_min_ (0), buffer_max_(0), window_min_(0), window_max_(0) , current_pos_(0) ,n_shift_(0)
{
vhierarchy_ = &_vhierarchy;
buffer_ = NULL;
}
......
......@@ -70,6 +70,9 @@ namespace VDPM {
ViewingParameters::
ViewingParameters()
{
for ( unsigned int i = 0; i < 16; ++i)
modelview_matrix_[i] = 0.0;
fovy_ = 45.0f;
aspect_ = 1.0f;
tolerance_square_ = 0.001f;
......
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