diff options
Diffstat (limited to 'usr.bin/lex/tables.c')
-rw-r--r-- | usr.bin/lex/tables.c | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/usr.bin/lex/tables.c b/usr.bin/lex/tables.c index d58ecb584ce..3d57f67889b 100644 --- a/usr.bin/lex/tables.c +++ b/usr.bin/lex/tables.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tables.c,v 1.3 2015/12/11 00:08:43 mmcc Exp $ */ +/* $OpenBSD: tables.c,v 1.4 2017/08/17 19:27:09 tedu Exp $ */ /* tables.c - tables serialization code * @@ -59,11 +59,6 @@ int yytbl_write16 (struct yytbl_writer *wr, flex_uint16_t v); int yytbl_write8 (struct yytbl_writer *wr, flex_uint8_t v); int yytbl_writen (struct yytbl_writer *wr, void *v, flex_int32_t len); static flex_int32_t yytbl_data_geti (const struct yytbl_data *tbl, int i); -/* XXX Not used -static flex_int32_t yytbl_data_getijk (const struct yytbl_data *tbl, int i, - int j, int k); - */ - /** Initialize the table writer. * @param wr an uninitialized writer @@ -332,45 +327,6 @@ int yytbl_write8 (struct yytbl_writer *wr, flex_uint8_t v) return bytes; } - -/* XXX Not Used */ -#if 0 -/** Extract data element [i][j] from array data tables. - * @param tbl data table - * @param i index into higher dimension array. i should be zero for one-dimensional arrays. - * @param j index into lower dimension array. - * @param k index into struct, must be 0 or 1. Only valid for YYTD_ID_TRANSITION table - * @return data[i][j + k] - */ -static flex_int32_t yytbl_data_getijk (const struct yytbl_data *tbl, int i, - int j, int k) -{ - flex_int32_t lo; - - k %= 2; - lo = tbl->td_lolen; - - switch (YYTDFLAGS2BYTES (tbl->td_flags)) { - case sizeof (flex_int8_t): - return ((flex_int8_t *) (tbl->td_data))[(i * lo + j) * (k + 1) + - k]; - case sizeof (flex_int16_t): - return ((flex_int16_t *) (tbl->td_data))[(i * lo + j) * (k + - 1) + - k]; - case sizeof (flex_int32_t): - return ((flex_int32_t *) (tbl->td_data))[(i * lo + j) * (k + - 1) + - k]; - default: - flex_die (_("invalid td_flags detected")); - break; - } - - return 0; -} -#endif /* Not used */ - /** Extract data element [i] from array data tables treated as a single flat array of integers. * Be careful for 2-dimensional arrays or for YYTD_ID_TRANSITION, which is an array * of structs. |