aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-03-06 01:57:46 +0000
committerDavid Robillard <d@drobilla.net>2009-03-06 01:57:46 +0000
commit7c1ea0948d9b43bfb7a86aa356eea04c1b9649ae (patch)
treee32eba87878660bc2de8455c800b446abf4ae033
parent43410b02c4a4d8c3476880f4b073e5bf5adc5acb (diff)
downloadresp-7c1ea0948d9b43bfb7a86aa356eea04c1b9649ae.tar.gz
resp-7c1ea0948d9b43bfb7a86aa356eea04c1b9649ae.tar.bz2
resp-7c1ea0948d9b43bfb7a86aa356eea04c1b9649ae.zip
Tidy/Shrink
git-svn-id: http://svn.drobilla.net/resp/tuplr@55 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-rw-r--r--tuplr.hpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/tuplr.hpp b/tuplr.hpp
index 45d5908..d769982 100644
--- a/tuplr.hpp
+++ b/tuplr.hpp
@@ -26,11 +26,11 @@
#include <vector>
#include <boost/format.hpp>
-// Actual types are backend specific
-typedef void* CValue;
-typedef const void* CType;
-typedef void* CFunction;
-struct CEngine;
+typedef void* CValue; ///< Compiled value (opaque)
+typedef const void* CType; ///< Compiled type (opaque)
+typedef void* CFunction; ///< Compiled function (opaque)
+
+struct CEngine; ///< Backend data (opaque)
#define FOREACH(IT, i, c) for (IT i = (c).begin(); i != (c).end(); ++i)
@@ -141,15 +141,11 @@ struct ASTTuple : public AST, public vector<AST*> {
}
bool operator==(const AST& rhs) const {
const ASTTuple* rt = dynamic_cast<const ASTTuple*>(&rhs);
- if (!rt) return false;
- if (rt->size() != size()) return false;
+ if (!rt || rt->size() != size()) return false;
const_iterator l = begin();
- FOREACH(const_iterator, r, *rt) {
- AST* mine = *l++;
- AST* other = *r;
- if (!(*mine == *other))
+ FOREACH(const_iterator, r, *rt)
+ if (!(*(*l++) == *(*r)))
return false;
- }
return true;
}
void lift(CEnv& cenv) {
@@ -192,9 +188,7 @@ struct AType : public ASTTuple {
}
bool operator==(const AST& rhs) const {
const AType* rt = dynamic_cast<const AType*>(&rhs);
- if (!rt)
- return false;
- else if (kind != rt->kind)
+ if (!rt || kind != rt->kind)
return false;
else
switch (kind) {