]> granicus.if.org Git - re2c/commitdiff
- Avoid const_cast<>
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Thu, 8 Feb 2007 09:24:47 +0000 (09:24 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Thu, 8 Feb 2007 09:24:47 +0000 (09:24 +0000)
re2c/code.cc

index e3e51899085e70efed5c296cdd168fdbbbdb4cd3..dcd21ffa574acd1ed0d27d1ed7c6af3a5f2d075a 100644 (file)
@@ -211,18 +211,17 @@ const BitMap *BitMap::find(const State *x)
 
 void BitMap::gen(std::ostream &o, uint ind, uint lb, uint ub)
 {
-       BitMap *b = first;
-
-       if (b && bLastPass)
+       if (first && bLastPass)
        {
                o << indent(ind) << "static const unsigned char yybm[] = {";
 
                uint c = 1, n = ub - lb;
+               const BitMap *cb = first;
 
-               while((b = const_cast<BitMap*>(b->next)) != NULL) {
+               while((cb = cb->next) != NULL) {
                        ++c;
                }
-               b = first;
+               BitMap *b = first;
 
                uint *bm = new uint[n];