The problem starts with lexer: it should operate on unsigned chars
(as re2c wants). Then these casts won't be needed at all. Mixing
signed and unsigned chars is bad and lexer should be rewritten to
use unsigned chars.
-/* Generated by re2c 0.14.3 on Thu Aug 20 13:02:58 2015 */
+/* Generated by re2c 0.14.3 on Thu Aug 20 13:23:54 2015 */
#line 1 "../src/parse/scanner_lex.re"
#include <stdlib.h>
#include <string.h>
} else {
for (char * p = tok; p < cur; ++p)
{
- cpoints.push_back (static_cast<uint32_t> (*p));
+ cpoints.push_back (static_cast<uint8_t> (*p));
}
yylval.regexp = cpoint_string (cpoints, bCaseInsensitive || bCaseInverted);
return STRING;
} else {
for (char * p = tok; p < cur; ++p)
{
- cpoints.push_back (static_cast<uint32_t> (*p));
+ cpoints.push_back (static_cast<uint8_t> (*p));
}
yylval.regexp = cpoint_string (cpoints, bCaseInsensitive || bCaseInverted);
return STRING;
for (++s; s != s_end; ++s)
{
n <<= 3;
- n += static_cast<uint32_t> (*s - '0');
+ n += static_cast<uint8_t> (*s - '0');
}
return n;
}