From: helly Date: Fri, 22 Apr 2005 21:45:09 +0000 (+0000) Subject: - Fix bug #1187785 Re2c fails to generate valid code X-Git-Tag: 0.13.6~651 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f4e6c1cf2ab37ee8a4699419959a1eaa6f5de18f;p=re2c - Fix bug #1187785 Re2c fails to generate valid code --- diff --git a/dfa.cc b/dfa.cc index 77b14572..7ba54f99 100644 --- a/dfa.cc +++ b/dfa.cc @@ -15,14 +15,9 @@ inline char octCh(uint c) inline char hexCh(uint c) { - if (c < 10) - { - return '0' + c % 16; - } - else - { - return 'A' + c % 16 - 10; - } + const char * sHex = "0123456789ABCDEF"; + + return sHex[c & 0x0F]; } void prtChOrHex(std::ostream& o, uchar c)