Commit 54926f2a authored by Jan Möbius's avatar Jan Möbius

Fixed all stl cppcheck warnings regarding empty checks.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13308 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 2fbd2532
......@@ -269,7 +269,7 @@ bool getSourceIdentifiers( std::vector<int>& _identifiers ) {
if ( o_it->source() )
_identifiers.push_back ( o_it->id() );
}
return (_identifiers.size() >0 );
return ( ! _identifiers.empty() );
}
bool getTargetIdentifiers( std::vector<int>& _identifiers ) {
......@@ -279,7 +279,7 @@ bool getTargetIdentifiers( std::vector<int>& _identifiers ) {
if ( o_it->target() )
_identifiers.push_back ( o_it->id() );
}
return (_identifiers.size() >0 );
return ( !_identifiers.empty() );
}
// ===============================================================================
......@@ -351,7 +351,7 @@ bool getAllMeshes( std::vector<int>& _identifiers ) {
_identifiers.push_back( o_it->id() );
}
return (_identifiers.size() > 0);
return (!_identifiers.empty());
}
bool get_all_object_identifiers( std::vector<int>& _identifiers ) {
......@@ -364,7 +364,7 @@ bool get_all_object_identifiers( std::vector<int>& _identifiers ) {
_identifiers.push_back( o_it->id() );
}
return (_identifiers.size() > 0);
return ( !_identifiers.empty() );
}
void setBackColor( OpenMesh::Vec4f _color) {
......
......@@ -584,7 +584,7 @@ void FileOBJPlugin::readOBJFile(QString _filename, OBJImporter& _importer)
trimString(line);
// comment
if ( line.size() == 0 || line[0] == '#' || isspace(line[0]) ) {
if ( line.empty() || line[0] == '#' || isspace(line[0]) ) {
continue;
}
......@@ -1146,7 +1146,7 @@ void FileOBJPlugin::checkTypes(QString _filename, OBJImporter& _importer, QStrin
trimString(line);
// comment
if ( line.size() == 0 || line[0] == '#' || isspace(line[0]) ) {
if ( line.empty() || line[0] == '#' || isspace(line[0]) ) {
continue;
}
......@@ -1493,7 +1493,7 @@ int FileOBJPlugin::loadObject(QString _filename) {
}
//add a group if we have includes
if (includes.size() > 0)
if ( ! includes.empty() )
importer.addGroup( QFileInfo(_filename).fileName() );
//check if something was found
......
......@@ -152,7 +152,7 @@ void BSplineSurfaceSelectionPlugin::invertControlPointSelection(int _objectId) {
void BSplineSurfaceSelectionPlugin::selectControlPoints(int _objectId, const IdList _ids, bool _deselect) {
if(_ids.size() == 0) return;
if(_ids.empty() ) return;
BaseObjectData* object = 0;
......@@ -366,7 +366,7 @@ void BSplineSurfaceSelectionPlugin::deleteSelectedKnotsV(int _objectId) {
void BSplineSurfaceSelectionPlugin::selectKnots(int _objectId, const IdList _ids_u, const IdList _ids_v, bool _deselect) {
if(_ids_u.size() == 0) return;
if(_ids_u.empty()) return;
BaseObjectData* object = 0;
......@@ -452,4 +452,4 @@ IdList BSplineSurfaceSelectionPlugin::getKnotSelectionV(int _objectId) {
return list;
}
\ No newline at end of file
}
......@@ -1242,7 +1242,7 @@ void SelectionBasePlugin::slotLassoSelection(QMouseEvent* _event) {
line_node_->add_point(hit_point);
// Close lasso
if(linePoints_.size() > 0)
if( !linePoints_.empty() )
line_node_->add_point(linePoints_[0]);
} else if(_event->type() == QEvent::MouseButtonDblClick) {
......@@ -1307,7 +1307,7 @@ void SelectionBasePlugin::slotVolumeLassoSelection(QMouseEvent* _event) {
line_node_->add_point(hit_point);
// Close lasso
if(linePoints_.size() > 0)
if( !linePoints_.empty() )
line_node_->add_point(linePoints_[0]);
} else if(_event->type() == QEvent::MouseButtonDblClick) {
......
......@@ -2,9 +2,16 @@
#include <iostream>
using namespace std;
class test {
public:
test() {
std::cout << "Constructor" << std::endl;
};
};
int main()
{
cout << "Hello World!";
test a;
std::cout << "Hello World!";
}
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