X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fcerr.c;h=dca936535cffe9d05994283907945f9f2f77e68d;hb=0e3065564e83037d5fbbb3e0e1595e7ce95ce8eb;hp=250ad80bf47d18fea493890e966d9fbb84e90f8c;hpb=1e636c95bf237645b6c9117e3eb64aa2d8aa4c90;p=YACASL2.git diff --git a/src/cerr.c b/src/cerr.c index 250ad80..dca9365 100644 --- a/src/cerr.c +++ b/src/cerr.c @@ -1,10 +1,5 @@ -#include "casl2.h" +#include "cerr.h" -/* エラーコードリスト */ -typedef struct { - int num; - char *msg; -} CERRARRAY; CERRARRAY cerr[] = { { 101, "label already defined" }, { 102, "label table is full" }, @@ -33,24 +28,10 @@ CERRARRAY cerr[] = { { 203, "SVC output - out of COMET II memory" }, { 204, "Program Register (PR) - out of COMET II memory" }, { 205, "Stack Pointer (SP) - cannot allocate stack buffer" }, - { 206, "Address - out of COMET II memory" } + { 206, "Address - out of COMET II memory" }, + { 207, "Stack Pointer (SP) - out of COMET II memory" }, }; -/* WORD値を文字列に変換 */ -char *wtoa(WORD word) -{ - char *p = malloc(6), *q = malloc(6); - int i = 0, j; - do{ - *(p + i++) = word % 10 + '0'; - } while((word /= 10) > 0); - for(j = 0; j < i; j++) { - *(q + j) = *(p + (i - 1) - j); - } - *(q + j + 1) = '\0'; - return q; -} - /* エラー番号とエラーメッセージを設定する */ void setcerr(int num, const char *val) {