%ok-for-header
%not-for-header
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
+/* Promotes a possibly negative, possibly signed char to an
+ * integer in range [0..255] for use as an array index.
*/
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
%ok-for-header
out_dec ("if ( yy_current_state >= %d )\n", lastdfa + 2);
++indent_level;
- indent_puts ("yy_c = yy_meta[(unsigned int) yy_c];");
+ indent_puts ("yy_c = yy_meta[yy_c];");
--indent_level;
}
--indent_level;
indent_puts
- ("yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];");
+ ("yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];");
}
indent_puts ("YY_CHAR yy_c;\n");
indent_put2s ("for ( yy_c = %s;", char_map);
indent_puts
- (" (yy_trans_info = &yy_current_state[(unsigned int) yy_c])->");
+ (" (yy_trans_info = &yy_current_state[yy_c])->");
indent_puts ("yy_verify == yy_c;");
indent_put2s (" yy_c = %s )", char_map_2);
outn ("\n#define FLEX_DEBUG");
OUT_BEGIN_CODE ();
- if (csize == 256)
- outn ("typedef unsigned char YY_CHAR;");
- else
- outn ("typedef char YY_CHAR;");
+ outn ("typedef flex_uint8_t YY_CHAR;");
OUT_END_CODE ();
if (C_plus_plus) {