]> git.cworth.org Git - apitrace/blobdiff - trace_model.cpp
Split glxapi.
[apitrace] / trace_model.cpp
index 098656fc05c37dee68c3b8591de13f5252abf4ca..760093c780a4d1279ffd36bb88b1f04e891ee029 100644 (file)
@@ -101,7 +101,7 @@ public:
       delete formatter;
    }
 
-   void visit(Null *node) {
+   void visit(Null *) {
       os << "NULL";
    }
 
@@ -185,6 +185,14 @@ static inline const Value *unwrap(const Value *node) {
 }
 
 
+Value::operator bool(void) const {
+   const Bool *b = dynamic_cast<const Bool *>(unwrap(this));
+   if (b)
+      return b->value;
+   assert(0);
+   return false;
+}
+
 Value::operator signed long long(void) const {
    const SInt *sint = dynamic_cast<const SInt *>(unwrap(this));
    if (sint)
@@ -228,7 +236,7 @@ void * Value::blob(void) const {
    if (blob)
        return blob->buf;
    const Null *null = dynamic_cast<const Null *>(unwrap(this));
-   if (null);
+   if (null)
        return NULL;
    assert(0);
    return NULL;
@@ -239,7 +247,7 @@ const char * Value::string(void) const {
    if (string)
        return string->value.c_str();
    const Null *null = dynamic_cast<const Null *>(unwrap(this));
-   if (null);
+   if (null)
        return NULL;
    assert(0);
    return NULL;