Browse Source

Cleanup

master
cancel 5 years ago
parent
commit
bfec7b24f9
  1. 21
      sim.c

21
sim.c

@ -25,20 +25,13 @@ static U8 const index_table[128] = {
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 0, 0, 0, 0, 0}; // 112-127 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 0, 0, 0, 0, 0}; // 112-127
static ORCA_FORCEINLINE Usz index_of(Glyph c) { return index_table[c & 0x7f]; } static ORCA_FORCEINLINE Usz index_of(Glyph c) { return index_table[c & 0x7f]; }
#if 0 // Reference implementation:
// Reference implementation // static Usz index_of(Glyph c) {
static Usz index_of(Glyph c) { // if (c >= '0' && c <= '9') return (Usz)(c - '0');
if (c == '.' || c == '*') // if (c >= 'A' && c <= 'Z') return (Usz)(c - 'A' + 10);
return 0; // if (c >= 'a' && c <= 'z') return (Usz)(c - 'a' + 10);
if (c >= '0' && c <= '9') // return 0;
return (Usz)(c - '0'); // }
if (c >= 'A' && c <= 'Z')
return (Usz)(c - 'A' + 10);
if (c >= 'a' && c <= 'z')
return (Usz)(c - 'a' + 10);
return 0;
}
#endif
static inline bool glyph_is_lowercase(Glyph g) { return g & (1 << 5); } static inline bool glyph_is_lowercase(Glyph g) { return g & (1 << 5); }
static inline Glyph glyph_lowered_unsafe(Glyph g) { static inline Glyph glyph_lowered_unsafe(Glyph g) {

Loading…
Cancel
Save