変数名の整理
[YACASL2.git] / test / unit / print_code_type_hash / print_code_type.c
index a74fcca..a8860c4 100644 (file)
@@ -8,18 +8,25 @@ void print_code_type()
     CMDCODETAB *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->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);
     }