]> granicus.if.org Git - re2c/commitdiff
Yet one more explicit cast of pointer difference to uint32_t.
authorUlya Trofimovich <skvadrik@gmail.com>
Mon, 10 Aug 2015 10:48:46 +0000 (11:48 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Mon, 10 Aug 2015 10:48:46 +0000 (11:48 +0100)
Much the same as previous commit: array of length bounded with 32 bits,
first pointer points to some random element. second pointer points to
the beginning of array (unless there were some errors in calculatins
that would have likely crashed re2c anyway).

Fixes [-Wconversion] warning.

re2c/src/ir/bytecode/bytecode.cc

index afbb7668d6b77f4fd9dccfa1bad8f96428399834..a14b2d5868dcb7ba3652e1d7c5d93557f2268c84 100644 (file)
@@ -20,7 +20,7 @@ smart_ptr<DFA> genCode (RegExp *re, Output & output, uint32_t ind, const std::st
                if (!cs.rep[j]->nxt)
                        cs.rep[j]->nxt = &cs.ptn[j];
 
-               rep[j] = cs.rep[j]->nxt - &cs.ptn[0];
+               rep[j] = static_cast<Char> (cs.rep[j]->nxt - &cs.ptn[0]);
        }
 
        re->calcSize(rep);