]> www.ginac.de Git - ginac.git/blobdiff - ginac/basic.cpp
- ASSERT macro renamed to GINAC_ASSERT
[ginac.git] / ginac / basic.cpp
index 0b713b8855049acb71982079349bbfcd997d9cba..eb4a72e034192e9e53cb478cfe0650b91a9f00be 100644 (file)
@@ -1,7 +1,8 @@
 /** @file basic.cpp
  *
- *  Implementation of GiNaC's ABC.
- *
+ *  Implementation of GiNaC's ABC. */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -31,6 +32,9 @@
 #include "lst.h"
 #include "ncmul.h"
 #include "utils.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -49,7 +53,7 @@ basic::~basic()
 {
     debugmsg("basic destructor",LOGLEVEL_DESTRUCT);
     destroy(0);
-    ASSERT((!(flags & status_flags::dynallocated))||(refcount==0));
+    GINAC_ASSERT((!(flags & status_flags::dynallocated))||(refcount==0));
 }
 
 basic::basic(basic const & other) : flags(0), refcount(0), tinfo_key(TINFO_BASIC)
@@ -145,7 +149,7 @@ ex basic::operator[](int const i) const
 
 bool basic::has(ex const & other) const
 {
-    ASSERT(other.bp!=0);
+    GINAC_ASSERT(other.bp!=0);
     if (is_equal(*other.bp)) return true;
     if (nops()>0) {
         for (int i=0; i<nops(); i++) {
@@ -344,7 +348,7 @@ int basic::compare(basic const & other) const
         return 1;
     }
 
-    ASSERT(typeid(*this)==typeid(other));
+    GINAC_ASSERT(typeid(*this)==typeid(other));
 
     int cmpval=compare_same_type(other);
     if ((cmpval!=0)&&(hash_this<0x80000000U)) {
@@ -372,7 +376,7 @@ bool basic::is_equal(basic const & other) const
 
     if (typeid_this!=typeid_other) return false;
 
-    ASSERT(typeid(*this)==typeid(other));
+    GINAC_ASSERT(typeid(*this)==typeid(other));
 
     return is_equal_same_type(other);
 }
@@ -412,3 +416,5 @@ type_info const & typeid_basic=typeid(some_basic);
 //////////
 
 int max_recursion_level=1024;
+
+} // namespace GiNaC