From 3f7c17da3a4728cca94609014f6a29625eb1cb20 Mon Sep 17 00:00:00 2001 From: j8takagi Date: Mon, 13 Dec 2010 00:55:30 +0900 Subject: [PATCH] =?utf8?q?=E3=83=9E=E3=82=AF=E3=83=AD=E5=AE=9A=E7=BE=A9?= =?utf8?q?=E3=81=AE=E9=87=8D=E8=A4=87=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- include/casl2.h | 4 ---- include/cerr.h | 5 +---- include/cmem.h | 8 ++++---- include/hash.h | 4 +--- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/include/casl2.h b/include/casl2.h index aee7f1e..49f4c8c 100644 --- a/include/casl2.h +++ b/include/casl2.h @@ -14,10 +14,6 @@ #include "cmem.h" #include "cerr.h" -#ifndef ARRAYSIZE -#define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0])) -#endif - /* COMET IIの規格 */ enum { CMDSIZE = 4, /* 命令の最大文字数 */ diff --git a/include/cerr.h b/include/cerr.h index 662cff2..08532da 100644 --- a/include/cerr.h +++ b/include/cerr.h @@ -6,11 +6,8 @@ #include #include #include -#include "cmem.h" -#ifndef ARRAYSIZE -#define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0])) -#endif +#include "cmem.h" /* エラーの構造体 */ typedef struct { diff --git a/include/cmem.h b/include/cmem.h index 2e7cd3c..50a29ec 100644 --- a/include/cmem.h +++ b/include/cmem.h @@ -11,12 +11,12 @@ #define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0])) #endif -/* mallocを実行し、メモリを確保できない場合は */ -/* エラーを出力して終了 */ +/* mallocを実行し、0で初期化 */ +/* メモリを確保できない場合はエラーを出力して終了 */ void *malloc_chk(size_t size, char *tag); -/* callocを実行し、メモリを確保できない場合は */ -/* エラーを出力して終了 */ +/* callocを実行 */ +/* メモリを確保できない場合はエラーを出力して終了 */ void *calloc_chk(size_t nmemb, size_t size, char *tag); /* malloc_chkを実行してメモリを確保してから、 */ diff --git a/include/hash.h b/include/hash.h index caac5f1..d438735 100644 --- a/include/hash.h +++ b/include/hash.h @@ -1,9 +1,7 @@ #ifndef YACASL2_HASH_INCLUDED #define YACASL2_HASH_INCLUDED -#ifndef ARRAYSIZE -#define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0])) -#endif +#include "cmem.h" /* ハッシュ共用体の型 */ typedef enum { -- 2.18.0