|
|
|
@ -20,10 +20,12 @@ struct proc {
|
|
|
|
|
#define _LIT_MV_UP "up"
|
|
|
|
|
#define _LIT_MV_DOWN "down"
|
|
|
|
|
|
|
|
|
|
_Static_assert(sizeof(_LIT_MV_FORWARD)==8, "bad literal size");
|
|
|
|
|
|
|
|
|
|
static const struct proc MAP[255] = {
|
|
|
|
|
['f'] = { .mv = 8, .field = (offsetof(struct psum, forward) / sizeof(result_t)) },
|
|
|
|
|
['u'] = { .mv = 3, .field = (offsetof(struct psum, up) / sizeof(result_t)) },
|
|
|
|
|
['d'] = { .mv = 5, .field = (offsetof(struct psum, down) / sizeof(result_t)) },
|
|
|
|
|
['f'] = { .mv = sizeof(_LIT_MV_FORWARD), .field = (offsetof(struct psum, forward) / sizeof(result_t)) },
|
|
|
|
|
['u'] = { .mv = sizeof(_LIT_MV_UP), .field = (offsetof(struct psum, up) / sizeof(result_t)) },
|
|
|
|
|
['d'] = { .mv = sizeof(_LIT_MV_DOWN), .field = (offsetof(struct psum, down) / sizeof(result_t)) },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const unsigned char DIGITS[255] = {
|
|
|
|
|