svnno****@sourc*****
svnno****@sourc*****
2011年 3月 11日 (金) 14:33:29 JST
Revision: 419 http://sourceforge.jp/projects/swfed/svn/view?view=rev&revision=419 Author: yoya Date: 2011-03-11 14:33:29 +0900 (Fri, 11 Mar 2011) Log Message: ----------- テーブル拡張が機能してなかったので修正 (256 以上の値が set 出来なかった) Modified Paths: -------------- trunk/src/trans_table.c trunk/src/trans_table.h -------------- next part -------------- Modified: trunk/src/trans_table.c =================================================================== --- trunk/src/trans_table.c 2011-03-11 03:59:16 UTC (rev 418) +++ trunk/src/trans_table.c 2011-03-11 05:33:29 UTC (rev 419) @@ -1,3 +1,4 @@ +#include <stdio.h> #include <stdlib.h> #include "trans_table.h" @@ -30,6 +31,7 @@ for (i = trans_table->table_num ; i < new_table_num ; i++) { trans_table->table[i] = 0; } + trans_table->table_num = new_table_num; return 0; } int @@ -59,3 +61,17 @@ trans_table_realloc(trans_table, i); return i; } + +void +trans_table_print(trans_table_t *trans_table) { + int i, new_table_num = trans_table->table_num; + printf("trans_table_print num=%d\n", new_table_num); + for (i = 1 ; i < new_table_num ; i++) { + int v = trans_table->table[i]; + if (v > 0) { + printf("%d: %d\n", i, v); + } else if (v == TRANS_TABLE_RESERVE_ID) { + printf("%d: reserved\n", i); + } + } +} Modified: trunk/src/trans_table.h =================================================================== --- trunk/src/trans_table.h 2011-03-11 03:59:16 UTC (rev 418) +++ trunk/src/trans_table.h 2011-03-11 05:33:29 UTC (rev 419) @@ -14,5 +14,6 @@ extern int trans_table_get(trans_table_t *trans_table, int offset); extern int trans_table_set(trans_table_t *trans_table, int offset, int cid); extern int trans_table_get_freeid(trans_table_t *trans_table); +extern void trans_table_print(trans_table_t *trans_table); #endif /* __TRANS_TABLE_H__ */