diff options
author | David Robillard <d@drobilla.net> | 2010-12-09 18:52:40 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-12-09 18:52:40 +0000 |
commit | 7f7d76ec1719db97d94adeae8b31b0c9e6c11d92 (patch) | |
tree | 7e0501bb29d91e05aa0e6dc2bd1c2687724c2435 /src/resp.hpp | |
parent | acf13b1df559c6187d270ef7e31890201c191b12 (diff) | |
download | resp-7f7d76ec1719db97d94adeae8b31b0c9e6c11d92.tar.gz resp-7f7d76ec1719db97d94adeae8b31b0c9e6c11d92.tar.bz2 resp-7f7d76ec1719db97d94adeae8b31b0c9e6c11d92.zip |
Fix cpplint warnings.
git-svn-id: http://svn.drobilla.net/resp/resp@329 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/resp.hpp')
-rw-r--r-- | src/resp.hpp | 24 |
1 files changed, 12 insertions, 12 deletions
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 <stdarg.h> +#include <stdint.h> +#include <string.h> + #include <iostream> #include <list> #include <map> @@ -31,10 +35,6 @@ #include <string> #include <vector> -#include <stdarg.h> -#include <stdint.h> -#include <string.h> - #include <boost/format.hpp> #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<const Object*> Roots; typedef std::list<Object*> 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<typename CT, typename ET> // 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<Constraint> { Constraints() : list<Constraint>() {} - Constraints(const Subst& subst) : list<Constraint>() { + explicit Constraints(const Subst& subst) : list<Constraint>() { 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<const AType*> { - TEnv(PEnv& p) + explicit TEnv(PEnv& p) : penv(p) , varID(1) , Closure(new AType(penv.sym("Closure"), AType::NAME)) |