変数名の整理
[YACASL2.git] / test / unit / print_cmdtype_code_hash / print_cmdtype_code.c
index b10db02..d075ae4 100644 (file)
@@ -5,22 +5,28 @@ void print_cmdtype_code()
 {
     int i;
     CMDCODETAB *np;
-    for(i = 0; i < cmdcodesize; i++){
+    for(i = 0; i < cmdtabsize; i++){
         np = cmdtype_code[i];
         while(np != NULL) {
             fprintf(stdout, "(%2d) - %s\t0%02o\t#%04X\n",
-                    i, np->cca->cmd, np->cca->type, np->cca->code);
+                    i, np->cmdtypecode->cmd, np->cmdtypecode->type, np->cmdtypecode->code);
             np = np->next;
         }
     }
 }
 
 int main(){
+    /* エラーの初期化 */
+    cerr = malloc_chk(sizeof(CERR), "cerr");
+    /* ハッシュ表作成 */
     create_cmdtype_code();
+    /* ハッシュ表表示 */
     print_cmdtype_code();
+    /* ハッシュ表解放 */
     free_cmdtype_code();
-    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);
     }