From: helly Date: Thu, 8 Feb 2007 09:24:47 +0000 (+0000) Subject: - Avoid const_cast<> X-Git-Tag: 0.13.6~243 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=498ebd025029871fd8df947a734ec69aafd8b6b3;p=re2c - Avoid const_cast<> --- diff --git a/re2c/code.cc b/re2c/code.cc index e3e51899..dcd21ffa 100644 --- a/re2c/code.cc +++ b/re2c/code.cc @@ -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(b->next)) != NULL) { + while((cb = cb->next) != NULL) { ++c; } - b = first; + BitMap *b = first; uint *bm = new uint[n];