Skip to content
Snippets Groups Projects
Commit 6fcec2e7 authored by Jan Travnicek's avatar Jan Travnicek Committed by Jan Trávníček
Browse files

clang-tidy fixes

parent 9b6793dd
No related branches found
No related tags found
1 merge request!102Merge jt
......@@ -10,7 +10,7 @@
 
namespace abstraction {
 
Value::Value ( std::shared_ptr < abstraction::OperationAbstraction > ref ) : m_lifeReference ( std::move ( ref ) ) {
Value::Value ( const std::shared_ptr < abstraction::OperationAbstraction > & ref ) : m_lifeReference ( ref ) {
}
 
std::shared_ptr < abstraction::Value > Value::getProxyAbstraction ( ) {
......@@ -21,7 +21,7 @@ std::string Value::getType ( ) const {
return ext::to_string ( getTypeIndex ( ) );
}
 
const std::shared_ptr < abstraction::OperationAbstraction > Value::getLifeReference ( ) const {
const std::shared_ptr < abstraction::OperationAbstraction > & Value::getLifeReference ( ) const {
return m_lifeReference;
}
 
......@@ -43,7 +43,7 @@ ext::set < abstraction::ParamQualifiers::ParamQualifier > Void::getTypeQualifier
}
 
 
LazyValue::LazyValue ( std::shared_ptr < abstraction::OperationAbstraction > ref ) : Value ( ref ) {
LazyValue::LazyValue ( const std::shared_ptr < abstraction::OperationAbstraction > & ref ) : Value ( std::move ( ref ) ) {
}
 
std::shared_ptr < abstraction::Value > LazyValue::cloneAsVariable ( bool, bool, bool, bool ) {
......
......@@ -22,7 +22,7 @@ class Value : public std::enable_shared_from_this < Value > {
std::shared_ptr < abstraction::OperationAbstraction > m_lifeReference;
 
public:
Value ( std::shared_ptr < abstraction::OperationAbstraction > ref );
Value ( const std::shared_ptr < abstraction::OperationAbstraction > & ref );
 
virtual ~Value ( ) noexcept = default;
 
......@@ -37,7 +37,7 @@ public:
 
virtual ext::set < abstraction::ParamQualifiers::ParamQualifier > getTypeQualifiers ( ) const = 0;
 
const std::shared_ptr < abstraction::OperationAbstraction > getLifeReference ( ) const;
const std::shared_ptr < abstraction::OperationAbstraction > & getLifeReference ( ) const;
};
 
class Void : public Value {
......@@ -58,7 +58,7 @@ class LazyValue : public Value {
std::shared_ptr < Value > cache;
 
public:
LazyValue ( std::shared_ptr < abstraction::OperationAbstraction > ref );
LazyValue ( const std::shared_ptr < abstraction::OperationAbstraction > & ref );
 
std::shared_ptr < abstraction::Value > cloneAsVariable ( bool, bool, bool, bool ) override;
 
......
......@@ -116,7 +116,7 @@ class ValueHolder : public ValueHolderImpl < Type > {
using ValueHolderImpl < Type >::ValueHolderImpl;
 
public:
ValueHolder ( std::shared_ptr < abstraction::OperationAbstraction > ref, Type && value ) : ValueHolderImpl < Type > ( std::move ( ref ), std::is_const_v < std::remove_reference_t < Type > >, std::is_rvalue_reference_v < Type >, std::is_lvalue_reference_v < Type >, true ) {
ValueHolder ( const std::shared_ptr < abstraction::OperationAbstraction > & ref, Type && value ) : ValueHolderImpl < Type > ( ref, std::is_const_v < std::remove_reference_t < Type > >, std::is_rvalue_reference_v < Type >, std::is_lvalue_reference_v < Type >, true ) {
this->setData ( std::forward < Type > ( value ) );
}
 
......
......@@ -20,7 +20,7 @@ class ValueHolderInterface : public Value {
bool m_isAutoMove;
 
public:
ValueHolderInterface ( std::shared_ptr < abstraction::OperationAbstraction > ref, bool isConst, bool isRvalueRef, bool isLvalueRef, bool isAutoMove ) : Value ( std::move ( ref ) ), m_isConst ( isConst ), m_isRvalueRef ( isRvalueRef ), m_isLvalueRef ( isLvalueRef ), m_isAutoMove ( isAutoMove ) {
ValueHolderInterface ( const std::shared_ptr < abstraction::OperationAbstraction > & ref, bool isConst, bool isRvalueRef, bool isLvalueRef, bool isAutoMove ) : Value ( ref ), m_isConst ( isConst ), m_isRvalueRef ( isRvalueRef ), m_isLvalueRef ( isLvalueRef ), m_isAutoMove ( isAutoMove ) {
}
 
virtual Type && getValue ( ) const = 0;
......
......@@ -88,7 +88,7 @@ public:
};
 
template < class SymbolType >
ranked_symbol < SymbolType >::ranked_symbol(SymbolType symbol, size_t rank) : m_symbol(std::move(symbol)), m_rank(std::move(rank)) {
ranked_symbol < SymbolType >::ranked_symbol(SymbolType symbol, size_t rank) : m_symbol(std::move(symbol)), m_rank(rank) {
 
}
 
......
......@@ -13,7 +13,7 @@ class GraphicsBox : public QGraphicsObject {
Q_OBJECT
public:
GraphicsBox(std::unique_ptr<ModelBox> p_modelBox, QPointF pos);
virtual ~GraphicsBox();
~GraphicsBox() override;
 
QRectF boundingRect() const override;
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override;
......
......@@ -144,7 +144,7 @@ void MainWindow::on_actionOpen_triggered() {
 
stream.close ( );
 
if (parsed.isMember("boxes") != 1 || !parsed["boxes"].isArray() || parsed["boxes"].empty())
if (parsed.isMember("boxes") || !parsed["boxes"].isArray() || parsed["boxes"].empty())
throw std::runtime_error { "No boxes were defined." };
 
// clear existing boxes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment