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

Fixed Datatype return values and some cppcheck warnings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13298 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 63881b87
......@@ -121,7 +121,9 @@ bool BaseObjectIterator::operator!=( const BaseObjectIterator& _rhs) {
}
BaseObjectIterator& BaseObjectIterator::operator=( const BaseObjectIterator& _rhs) {
pos_ = _rhs.pos_;
pos_ = _rhs.pos_;
dataType_ = _rhs.dataType_;
restriction_ = _rhs.restriction_;
return *this;
}
......
......@@ -117,7 +117,9 @@ bool ObjectIterator::operator!=( const ObjectIterator& _rhs) const {
}
ObjectIterator& ObjectIterator::operator=( const ObjectIterator& _rhs) {
pos_ = _rhs.pos_;
pos_ = _rhs.pos_;
dataType_ = _rhs.dataType_;
restriction_ = _rhs.restriction_;
return *this;
}
......
......@@ -690,8 +690,8 @@ void Core::slotAddEmptyObjectMenu() {
}
}
// Advance to next type ( Indices are bits so multiply by to to get next bit)
currentType++;
// Advance to next type ( Indices are bits so multiply by two to get next bit)
++currentType;
}
static addEmptyWidget* widget = 0;
......
......@@ -96,8 +96,8 @@ class DLLEXPORT DataType {
bool operator==( const unsigned int& _i );
bool operator==( const DataType& _i );
bool operator=( const unsigned int& _i );
bool operator=( const DataType& _i );
DataType& operator=( const unsigned int& _i );
DataType& operator=( const DataType& _i );
bool operator<( const unsigned int& _i );
bool operator<( const DataType& _i ) const;
......@@ -114,8 +114,10 @@ class DLLEXPORT DataType {
DataType operator|( const DataType& _i ) const;
bool operator++(int _unused);
DataType operator++(int _unused);
DataType& operator++();
/** return the internal representation of the type which is an unsigned int at the moment.
*
* You should avoid using this directly as the internal representation might change in the future
......
......@@ -332,12 +332,14 @@ bool DataType::operator==( const DataType& _i ) {
//===========================================
bool DataType::operator=( const unsigned int& _i ) {
return (field = _i);
DataType& DataType::operator=( const unsigned int& _i ) {
field = _i;
return (*this);
}
bool DataType::operator=( const DataType& _i ) {
return (field = _i.field);
DataType& DataType::operator=( const DataType& _i ) {
field = _i.field;
return (*this);
}
//===========================================
......@@ -395,8 +397,15 @@ DataType DataType::operator|( const DataType& _i ) const {
//===========================================
bool DataType::operator++(int /*_unused*/) {
return (field *= 2);
DataType DataType::operator++(int /*_unused*/) {
return (field *= 2);
}
//===========================================
DataType& DataType::operator++() {
field *= 2;
return (*this);
}
//===========================================
......
......@@ -109,7 +109,7 @@ namespace Viewer {
return mode;
}
void ViewerProperties::pickMode(const std::string _name){
void ViewerProperties::pickMode(const std::string& _name){
emit setPickMode(_name);
}
......
......@@ -523,7 +523,7 @@ namespace Viewer {
std::string pickMode();
/// set the pickMode
void pickMode(const std::string _name);
void pickMode(const std::string& _name);
/// get the action mode
Viewer::ActionMode actionMode();
......
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