X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=test%2Funit%2Fprint_code_type_hash%2Fprint_code_type.c;h=80fea831cc9b8cca0f6401fb7bc36486fc5dc469;hb=80a7b6329c3177a0e4050d88406b0bd12fa66ac4;hp=a74fcca7226c23eb841f7845e69f48bd37d25f2c;hpb=2b0ff8e75f11c5fb58e16e95d8195d6f1252c97c;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 a74fcca..80fea83 100644 --- a/test/unit/print_code_type_hash/print_code_type.c +++ b/test/unit/print_code_type_hash/print_code_type.c @@ -5,21 +5,28 @@ void print_code_type() { int i; - CMDCODETAB *np; + CMDTAB *np; 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->cmd->code, np->cmd->type, np->cmd->name); } } } 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); }