X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=test%2Funit%2Fprint_code_type_hash%2Fprint_code_type.c;h=a8860c463c3ad462a975319bd5c963c666951d7f;hb=e6f41d41cff07e56b0cbc7d515c46327206c9f40;hp=c081888b81aa35e359948b4210354022f645505f;hpb=00d4ba02d732a0ff14c402bddc14c713c9b392d8;p=YACASL2.git diff --git a/test/unit/print_code_type_hash/print_code_type.c b/test/unit/print_code_type_hash/print_code_type.c index c081888..a8860c4 100644 --- a/test/unit/print_code_type_hash/print_code_type.c +++ b/test/unit/print_code_type_hash/print_code_type.c @@ -6,20 +6,27 @@ void print_code_type() { int i; CMDCODETAB *np; - for(i = 0; i < cmdcodesize; i++){ + for(i = 0; i < cmdtabsize; i++){ for(np = code_type[i]; np != NULL; np = np->next) { - fprintf(stdout, "(%2d) - #%04X\t0%02o\t%s\n", i, np->cca->code, np->cca->type, np->cca->cmd); + fprintf(stdout, "(%2d) - #%04X\t0%02o\t%s\n", + i, np->cmdtypecode->code, np->cmdtypecode->type, np->cmdtypecode->cmd); } } } int main() { + /* エラーの初期化 */ + cerr = malloc_chk(sizeof(CERR), "cerr"); + /* ハッシュ表作成 */ create_code_type(); + /* ハッシュ表表示 */ print_code_type(); + /* ハッシュ表解放 */ free_code_type(); - if(cerrno != 0) { - printf("\terror - %d: %s\n", cerrno, cerrmsg); + /* エラーの表示 */ + if(cerr->num != 0) { + printf("\terror - %d: %s\n", cerr->num, cerr->msg); freecerr(); exit(-1); }