Skip to content

Commit

Permalink
Fix clang warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Nov 29, 2018
1 parent 5d50c96 commit be88fdc
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 37 deletions.
8 changes: 4 additions & 4 deletions src/ast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ namespace Sass {
ADD_PROPERTY(bool, group_end)
public:
Bubble(ParserState pstate, Statement_Obj n, Statement_Obj g = {}, size_t t = 0);
bool bubbles();
bool bubbles() override;
ATTACH_AST_OPERATIONS(Bubble)
ATTACH_CRTP_PERFORM_METHODS()
};
Expand Down Expand Up @@ -806,7 +806,7 @@ namespace Sass {
public:
Unary_Expression(ParserState pstate, Type t, Expression_Obj o);
const std::string type_name();
virtual bool operator==(const Expression& rhs) const;
virtual bool operator==(const Expression& rhs) const override;
size_t hash() const override;
ATTACH_AST_OPERATIONS(Unary_Expression)
ATTACH_CRTP_PERFORM_METHODS()
Expand Down Expand Up @@ -898,7 +898,7 @@ namespace Sass {
ADD_PROPERTY(At_Root_Query_Obj, expression)
public:
At_Root_Block(ParserState pstate, Block_Obj b = {}, At_Root_Query_Obj e = {});
bool bubbles();
bool bubbles() override;
bool exclude_node(Statement_Obj s);
ATTACH_AST_OPERATIONS(At_Root_Block)
ATTACH_CRTP_PERFORM_METHODS()
Expand Down Expand Up @@ -926,7 +926,7 @@ namespace Sass {
ADD_PROPERTY(bool, has_optional_parameters)
ADD_PROPERTY(bool, has_rest_parameter)
protected:
void adjust_after_pushing(Parameter_Obj p);
void adjust_after_pushing(Parameter_Obj p) override;
public:
Parameters(ParserState pstate);
ATTACH_AST_OPERATIONS(Parameters)
Expand Down
38 changes: 19 additions & 19 deletions src/ast_selectors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ namespace Sass {
virtual ~Simple_Selector() = 0;
virtual Compound_Selector_Ptr unify_with(Compound_Selector_Ptr);

virtual bool has_parent_ref() const;
virtual bool has_real_parent_ref() const ;
virtual bool has_parent_ref() const override;
virtual bool has_real_parent_ref() const override;
virtual bool is_pseudo_element() const;
virtual bool is_superselector_of(Compound_Selector_Ptr_Const sub) const;

Expand Down Expand Up @@ -169,10 +169,10 @@ namespace Sass {
public:
Parent_Selector(ParserState pstate, bool r = true);

virtual bool has_parent_ref() const;
virtual bool has_real_parent_ref() const;
virtual bool has_parent_ref() const override;
virtual bool has_real_parent_ref() const override;

virtual unsigned long specificity() const;
virtual unsigned long specificity() const override;
int unification_order() const override
{
throw std::runtime_error("unification_order for Parent_Selector is undefined");
Expand Down Expand Up @@ -200,10 +200,10 @@ namespace Sass {
return Constants::UnificationOrder_Placeholder;
}
virtual ~Placeholder_Selector() {};
virtual unsigned long specificity() const;
virtual bool has_placeholder();
bool operator<(const Simple_Selector& rhs) const;
bool operator==(const Simple_Selector& rhs) const;
virtual unsigned long specificity() const override;
virtual bool has_placeholder() override;
bool operator<(const Simple_Selector& rhs) const override;
bool operator==(const Simple_Selector& rhs) const override;
bool operator<(const Placeholder_Selector& rhs) const;
bool operator==(const Placeholder_Selector& rhs) const;
ATTACH_AST_OPERATIONS(Placeholder_Selector)
Expand All @@ -216,7 +216,7 @@ namespace Sass {
class Type_Selector final : public Simple_Selector {
public:
Type_Selector(ParserState pstate, std::string n);
virtual unsigned long specificity() const;
virtual unsigned long specificity() const override;
int unification_order() const override
{
return Constants::UnificationOrder_Element;
Expand All @@ -237,7 +237,7 @@ namespace Sass {
class Class_Selector final : public Simple_Selector {
public:
Class_Selector(ParserState pstate, std::string n);
virtual unsigned long specificity() const;
virtual unsigned long specificity() const override;
int unification_order() const override
{
return Constants::UnificationOrder_Class;
Expand All @@ -257,7 +257,7 @@ namespace Sass {
class Id_Selector final : public Simple_Selector {
public:
Id_Selector(ParserState pstate, std::string n);
virtual unsigned long specificity() const;
virtual unsigned long specificity() const override;
int unification_order() const override
{
return Constants::UnificationOrder_Id;
Expand All @@ -282,7 +282,7 @@ namespace Sass {
public:
Attribute_Selector(ParserState pstate, std::string n, std::string m, String_Obj v, char o = 0);
size_t hash() const override;
virtual unsigned long specificity() const;
virtual unsigned long specificity() const override;
int unification_order() const override
{
return Constants::UnificationOrder_Attribute;
Expand Down Expand Up @@ -315,9 +315,9 @@ namespace Sass {
ADD_PROPERTY(String_Obj, expression)
public:
Pseudo_Selector(ParserState pstate, std::string n, String_Obj expr = {});
virtual bool is_pseudo_element() const;
virtual bool is_pseudo_element() const override;
size_t hash() const override;
virtual unsigned long specificity() const;
virtual unsigned long specificity() const override;
int unification_order() const override
{
if (is_pseudo_element())
Expand Down Expand Up @@ -478,8 +478,8 @@ namespace Sass {
void set_innermost(Complex_Selector_Obj, Combinator);

size_t hash() const override;
virtual unsigned long specificity() const;
virtual void set_media_block(Media_Block_Ptr mb);
virtual unsigned long specificity() const override;
virtual void set_media_block(Media_Block_Ptr mb) override;
virtual bool has_placeholder();
int unification_order() const override
{
Expand Down Expand Up @@ -532,8 +532,8 @@ namespace Sass {
Selector_List_Obj eval(Eval& eval);

size_t hash() const override;
virtual unsigned long specificity() const;
virtual void set_media_block(Media_Block_Ptr mb);
virtual unsigned long specificity() const override;
virtual void set_media_block(Media_Block_Ptr mb) override;
virtual bool has_placeholder();
int unification_order() const override
{
Expand Down
12 changes: 6 additions & 6 deletions src/ast_supports.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace Sass {
ADD_PROPERTY(Supports_Condition_Obj, condition)
public:
Supports_Block(ParserState pstate, Supports_Condition_Obj condition, Block_Obj block = {});
bool bubbles();
bool bubbles() override;
ATTACH_AST_OPERATIONS(Supports_Block)
ATTACH_CRTP_PERFORM_METHODS()
};
Expand Down Expand Up @@ -68,7 +68,7 @@ namespace Sass {
ADD_PROPERTY(Operand, operand);
public:
Supports_Operator(ParserState pstate, Supports_Condition_Obj l, Supports_Condition_Obj r, Operand o);
virtual bool needs_parens(Supports_Condition_Obj cond) const;
virtual bool needs_parens(Supports_Condition_Obj cond) const override;
ATTACH_AST_OPERATIONS(Supports_Operator)
ATTACH_CRTP_PERFORM_METHODS()
};
Expand All @@ -81,7 +81,7 @@ namespace Sass {
ADD_PROPERTY(Supports_Condition_Obj, condition);
public:
Supports_Negation(ParserState pstate, Supports_Condition_Obj c);
virtual bool needs_parens(Supports_Condition_Obj cond) const;
virtual bool needs_parens(Supports_Condition_Obj cond) const override;
ATTACH_AST_OPERATIONS(Supports_Negation)
ATTACH_CRTP_PERFORM_METHODS()
};
Expand All @@ -95,7 +95,7 @@ namespace Sass {
ADD_PROPERTY(Expression_Obj, value);
public:
Supports_Declaration(ParserState pstate, Expression_Obj f, Expression_Obj v);
virtual bool needs_parens(Supports_Condition_Obj cond) const;
virtual bool needs_parens(Supports_Condition_Obj cond) const override;
ATTACH_AST_OPERATIONS(Supports_Declaration)
ATTACH_CRTP_PERFORM_METHODS()
};
Expand All @@ -108,11 +108,11 @@ namespace Sass {
ADD_PROPERTY(Expression_Obj, value);
public:
Supports_Interpolation(ParserState pstate, Expression_Obj v);
virtual bool needs_parens(Supports_Condition_Obj cond) const;
virtual bool needs_parens(Supports_Condition_Obj cond) const override;
ATTACH_AST_OPERATIONS(Supports_Interpolation)
ATTACH_CRTP_PERFORM_METHODS()
};

}

#endif
#endif
4 changes: 2 additions & 2 deletions src/ast_values.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ namespace Sass {
return false;
}

size_t Variable::hash()
size_t Variable::hash() const
{
return std::hash<std::string>()(name());
}
Expand Down Expand Up @@ -809,4 +809,4 @@ namespace Sass {
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////

}
}
12 changes: 6 additions & 6 deletions src/ast_values.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace Sass {

virtual size_t hash() const override;
virtual size_t size() const;
virtual void set_delayed(bool delayed);
virtual void set_delayed(bool delayed) override;
virtual bool operator== (const Expression& rhs) const override;

ATTACH_AST_OPERATIONS(List)
Expand Down Expand Up @@ -131,7 +131,7 @@ namespace Sass {

virtual bool operator==(const Expression& rhs) const override;

virtual size_t hash() const;
virtual size_t hash() const override;
enum Sass_OP optype() const { return op_.operand; }
ATTACH_AST_OPERATIONS(Binary_Expression)
ATTACH_CRTP_PERFORM_METHODS()
Expand Down Expand Up @@ -196,8 +196,8 @@ namespace Sass {
ADD_CONSTREF(std::string, name)
public:
Variable(ParserState pstate, std::string n);
virtual bool operator==(const Expression& rhs) const;
virtual size_t hash();
virtual bool operator==(const Expression& rhs) const override;
virtual size_t hash() const override;
ATTACH_AST_OPERATIONS(Variable)
ATTACH_CRTP_PERFORM_METHODS()
};
Expand Down Expand Up @@ -292,7 +292,7 @@ namespace Sass {
Boolean(ParserState pstate, bool val);
operator bool() override { return value_; }

std::string type() const { return "bool"; }
std::string type() const override { return "bool"; }
static std::string type_name() { return "bool"; }

size_t hash() const override;
Expand Down Expand Up @@ -343,7 +343,7 @@ namespace Sass {
bool has_interpolants();
void rtrim() override;
size_t hash() const override;
virtual void set_delayed(bool delayed);
virtual void set_delayed(bool delayed) override;

bool operator==(const Expression& rhs) const override;
ATTACH_AST_OPERATIONS(String_Schema)
Expand Down

0 comments on commit be88fdc

Please sign in to comment.