]> granicus.if.org Git - re2c/commitdiff
Explicit cast of pointer difference to uint32_t: it's obviously safe from the code.
authorUlya Trofimovich <skvadrik@gmail.com>
Mon, 10 Aug 2015 09:12:20 +0000 (10:12 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Mon, 10 Aug 2015 09:12:20 +0000 (10:12 +0100)
Fixes some [-Wconversion] warnings.

re2c/src/ir/bytecode/compile.cc

index f7f6aa93f9b82725cf05714bb2b7cf059083d563..d67ebf9c51be7fc8eb6c3b09308e5b3390525e29 100644 (file)
@@ -95,7 +95,7 @@ uint32_t CloseOp::compile (Char * rep, Ins * i)
                i->i.link = ins_cache;
                ++i;
 
-               const uint32_t sz = i - ins_cache;
+               const uint32_t sz = static_cast<uint32_t> (i - ins_cache);
                if (ins_access == PRIVATE)
                {
                        decompile ();
@@ -142,7 +142,7 @@ uint32_t CloseVOp::compile (Char * rep, Ins * i)
                                i++;
                        }
                }
-               const uint32_t sz = i - ins_cache;
+               const uint32_t sz = static_cast<uint32_t> (i - ins_cache);
 
                if (ins_access == PRIVATE)
                {
@@ -231,7 +231,7 @@ uint32_t RuleOp::compile (Char * rep, Ins * i)
                i->i.tag = TERM;
                i->i.link = this;
                ++i;
-               const uint32_t sz = i - ins_cache;
+               const uint32_t sz = static_cast<uint32_t> (i - ins_cache);
 
                if (ins_access == PRIVATE)
                {