From 7f7d76ec1719db97d94adeae8b31b0c9e6c11d92 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 9 Dec 2010 18:52:40 +0000 Subject: Fix cpplint warnings. git-svn-id: http://svn.drobilla.net/resp/resp@329 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/resp.hpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/resp.hpp') diff --git a/src/resp.hpp b/src/resp.hpp index d5ea459..24e79ff 100644 --- a/src/resp.hpp +++ b/src/resp.hpp @@ -22,6 +22,10 @@ #ifndef RESP_HPP #define RESP_HPP +#include +#include +#include + #include #include #include @@ -31,10 +35,6 @@ #include #include -#include -#include -#include - #include #define FOREACH(IT, i, c) for (IT i = (c).begin(); i != (c).end(); ++i) @@ -44,7 +44,6 @@ using namespace std; using boost::format; - /*************************************************************************** * Basic Utility Classes * ***************************************************************************/ @@ -98,7 +97,7 @@ enum Tag { struct GC { typedef std::list Roots; typedef std::list Heap; - GC(size_t pool_size); + explicit GC(size_t pool_size); ~GC(); void* alloc(size_t size); void collect(const Roots& roots); @@ -226,7 +225,7 @@ private: /// Tuple (heterogeneous sequence of fixed length), e.g. "(a b c)" struct ATuple : public AST { - ATuple(Cursor c) : AST(T_TUPLE, c), _len(0), _vec(0) {} + explicit ATuple(Cursor c) : AST(T_TUPLE, c), _len(0), _vec(0) {} ATuple(const ATuple& exp) : AST(T_TUPLE, exp.loc), _len(exp._len) { _vec = (const AST**)malloc(sizeof(AST*) * _len); memcpy(_vec, exp._vec, sizeof(AST*) * _len); @@ -280,7 +279,7 @@ struct ATuple : public AST { void last(AST* ast) { _vec[_len - 1] = ast; } struct const_iterator { - const_iterator(const ATuple* n) : node(n) { + explicit const_iterator(const ATuple* n) : node(n) { assert(!n || n->tup_len() == 0 || n->tup_len() == 2); if (!n || n->tup_len() == 0) node = NULL; @@ -386,7 +385,7 @@ struct AType : public ATuple { // Utility class for easily building lists from left to right template // ConsType, ElementType struct List { - List(CT* h=0) : head(h), tail(0) {} + explicit List(CT* h=0) : head(h), tail(0) {} List(Cursor c, ET* ast, ...) : head(0), tail(0) { push_back(ast); assert(*head->begin() == ast); @@ -465,7 +464,7 @@ AST::operator==(const AST& rhs) const if (!rt || me->kind != rt->kind) { assert(str() != rt->str()); return false; - } else + } else { switch (me->kind) { case AType::VAR: return me->id == rt->id; case AType::NAME: return me->head()->str() == rt->head()->str(); @@ -473,6 +472,7 @@ AST::operator==(const AST& rhs) const case AType::EXPR: return list_equals(me, rt); case AType::DOTS: return true; } + } return false; // never reached } case T_STRING: @@ -628,7 +628,7 @@ inline ostream& operator<<(ostream& out, const Subst& s) { /// Type constraint set struct Constraints : public list { Constraints() : list() {} - Constraints(const Subst& subst) : list() { + explicit Constraints(const Subst& subst) : list() { FOREACH(Subst::const_iterator, i, subst) push_back(Constraint(new AType(*i->first), new AType(*i->second))); } @@ -645,7 +645,7 @@ inline ostream& operator<<(ostream& out, const Constraints& c) { /// Type-Time Environment struct TEnv : public Env { - TEnv(PEnv& p) + explicit TEnv(PEnv& p) : penv(p) , varID(1) , Closure(new AType(penv.sym("Closure"), AType::NAME)) -- cgit v1.2.1