Skip to content

Commit 9393965

Browse files
committed
odb: replace ZASSERT with assert
Signed-off-by: Matt Liberty <[email protected]>
1 parent 782b315 commit 9393965

29 files changed

+142
-174
lines changed

src/odb/include/odb/ZException.h

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/odb/include/odb/dbMap.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
#pragma once
55

6+
#include <cassert>
67
#include <map>
78
#include <vector>
89

9-
#include "odb/ZException.h"
1010
#include "odb/dbMap.h"
1111
#include "odb/dbSet.h"
1212

@@ -48,12 +48,12 @@ inline const D& dbMap<T, D>::operator[](T* object) const
4848
{
4949
if (_map) {
5050
typename std::map<T*, D>::const_iterator itr = _map->find(object);
51-
ZASSERT(itr != _map->end());
51+
assert(itr != _map->end());
5252
return (*itr).second;
5353
}
5454

5555
uint idx = object->getId();
56-
ZASSERT(idx && (idx < _vector->size()));
56+
assert(idx && (idx < _vector->size()));
5757
return (*_vector)[idx];
5858
}
5959

@@ -65,7 +65,7 @@ inline D& dbMap<T, D>::operator[](T* object)
6565
}
6666

6767
uint idx = object->getId();
68-
ZASSERT(idx && (idx < _vector->size()));
68+
assert(idx && (idx < _vector->size()));
6969
return (*_vector)[idx];
7070
}
7171

src/odb/include/odb/dbShape.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <cmath>
88
#include <vector>
99

10-
#include "odb/ZException.h"
1110
#include "odb/dbObject.h"
1211
#include "odb/dbSet.h"
1312
#include "odb/dbTransform.h"

src/odb/include/odb/dbStream.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <vector>
2121

2222
#include "boost/container/flat_map.hpp"
23-
#include "odb/ZException.h"
2423
#include "odb/dbObject.h"
2524
#include "odb/odb.h"
2625

src/odb/src/db/dbArrayTable.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
#pragma once
55

6+
#include <cassert>
67
#include <vector>
78

89
#include "dbCore.h"
910
#include "dbVector.h"
10-
#include "odb/ZException.h"
1111
#include "odb/dbId.h"
1212
#include "odb/dbObject.h"
1313
#include "odb/odb.h"
@@ -90,9 +90,9 @@ class dbArrayTable : public dbObjectTable
9090
{
9191
uint page = id >> _page_shift;
9292
uint offset = id & _page_mask;
93-
ZASSERT((id != 0) && (page < _page_cnt));
93+
assert((id != 0) && (page < _page_cnt));
9494
T* p = (T*) &(_pages[page]->_objects[offset * sizeof(T)]);
95-
ZASSERT(p->_oid & DB_ALLOC_BIT);
95+
assert(p->_oid & DB_ALLOC_BIT);
9696
return p;
9797
}
9898

@@ -118,9 +118,9 @@ class dbArrayTable : public dbObjectTable
118118
{
119119
uint page = id >> _page_shift;
120120
uint offset = id & _page_mask;
121-
ZASSERT((id != 0) && (page < _page_cnt));
121+
assert((id != 0) && (page < _page_cnt));
122122
T* p = (T*) &(_pages[page]->_objects[offset * sizeof(T)]);
123-
ZASSERT((p->_oid & DB_ALLOC_BIT) == 0);
123+
assert((p->_oid & DB_ALLOC_BIT) == 0);
124124
return p;
125125
}
126126

src/odb/src/db/dbArrayTable.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "dbArrayTable.h"
1313
#include "dbCommon.h"
1414
#include "dbCore.h"
15-
#include "odb/ZException.h"
1615
#include "odb/dbId.h"
1716
#include "odb/dbObject.h"
1817
#include "odb/dbStream.h"
@@ -271,9 +270,9 @@ void dbArrayTable<T>::destroy(T* t)
271270
{
272271
--_alloc_cnt;
273272

274-
ZASSERT(t->getOID() != 0);
275-
ZASSERT(t->getTable() == this);
276-
ZASSERT(t->oid_ & DB_ALLOC_BIT);
273+
assert(t->getOID() != 0);
274+
assert(t->getTable() == this);
275+
assert(t->oid_ & DB_ALLOC_BIT);
277276

278277
dbArrayTablePage* page = (dbArrayTablePage*) t->getObjectPage();
279278
_dbFreeObject* o = (_dbFreeObject*) t;

src/odb/src/db/dbAttrTable.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#pragma once
55

6-
#include "odb/ZException.h"
76
#include "odb/dbStream.h"
87
#include "odb/odb.h"
98

src/odb/src/db/dbBTerm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "dbBTerm.h"
55

6+
#include <cassert>
67
#include <cstdint>
78
#include <cstdlib>
89
#include <cstring>
@@ -29,7 +30,6 @@
2930
#include "dbNet.h"
3031
#include "dbTable.h"
3132
#include "dbTable.hpp"
32-
#include "odb/ZException.h"
3333
#include "odb/db.h"
3434
#include "odb/dbBlockCallBackObj.h"
3535
#include "odb/dbObject.h"
@@ -644,7 +644,7 @@ dbBTerm* dbBTerm::create(dbNet* net_, const char* name)
644644
dbMaster* master = inst->getMaster();
645645
_dbMaster* master_impl = (_dbMaster*) master;
646646
_dbInstHdr* inst_hdr = parent_block->_inst_hdr_hash.find(master_impl->_id);
647-
ZASSERT(inst_hdr->_inst_cnt == 1);
647+
assert(inst_hdr->_inst_cnt == 1);
648648

649649
master_impl->flags_._frozen = 0; // allow the mterm creation
650650
auto mterm = (_dbMTerm*) dbMTerm::create(master, name, dbIoType::INOUT);

src/odb/src/db/dbBlock.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119
#include "dbTrackGrid.h"
120120
#include "dbVia.h"
121121
#include "dbWire.h"
122-
#include "odb/ZException.h"
123122
#include "odb/db.h"
124123
#include "odb/dbBlockCallBackObj.h"
125124
#include "odb/dbExtControl.h"
@@ -2762,7 +2761,7 @@ void dbBlock::setCornerCount(int cornersStoredCnt,
27622761
int extDbCnt,
27632762
const char* name_list)
27642763
{
2765-
ZASSERT((cornersStoredCnt > 0) && (cornersStoredCnt <= 256));
2764+
assert((cornersStoredCnt > 0) && (cornersStoredCnt <= 256));
27662765
_dbBlock* block = (_dbBlock*) this;
27672766

27682767
// TODO: Should this change be logged in the journal?
@@ -2871,7 +2870,7 @@ void dbBlock::getExtCornerName(int corner, char* cName)
28712870
if (block->_num_ext_corners == 0) {
28722871
return;
28732872
}
2874-
ZASSERT((corner >= 0) && (corner < block->_num_ext_corners));
2873+
assert((corner >= 0) && (corner < block->_num_ext_corners));
28752874

28762875
if (block->_corner_name_list == nullptr) {
28772876
return;

src/odb/src/db/dbBox.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "dbBox.h"
55

6+
#include <cassert>
67
#include <cstring>
78
#include <stdexcept>
89
#include <vector>
@@ -29,7 +30,6 @@
2930
#include "dbTechLayer.h"
3031
#include "dbTechVia.h"
3132
#include "dbVia.h"
32-
#include "odb/ZException.h"
3333
#include "odb/db.h"
3434
#include "odb/dbBlockCallBackObj.h"
3535
#include "odb/dbObject.h"
@@ -289,7 +289,7 @@ _dbTechLayer* _dbBox::getTechLayer() const
289289
}
290290
}
291291

292-
ZASSERT(0);
292+
assert(0);
293293
return nullptr;
294294
}
295295

@@ -652,7 +652,7 @@ dbObject* dbBox::getBoxOwner() const
652652
}
653653
}
654654

655-
ZASSERT(0);
655+
assert(0);
656656
return nullptr;
657657
}
658658

0 commit comments

Comments
 (0)