From: cuz Date: Thu, 27 Sep 2001 05:54:40 +0000 (+0000) Subject: Added AUTO_COLLECTION_INITIALIZER X-Git-Tag: V2.12.0~2609 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=371fcf48dacbc902331a046fe1d9f65e0879c19e;p=cc65 Added AUTO_COLLECTION_INITIALIZER git-svn-id: svn://svn.cc65.org/cc65/trunk@977 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/common/coll.c b/src/common/coll.c index fa7fe6e9a..ffae7f608 100644 --- a/src/common/coll.c +++ b/src/common/coll.c @@ -45,6 +45,17 @@ +/*****************************************************************************/ +/* Data */ +/*****************************************************************************/ + + + +/* An empty collection */ +const Collection EmptyCollection = STATIC_COLLECTION_INITIALIZER; + + + /*****************************************************************************/ /* Code */ /*****************************************************************************/ diff --git a/src/common/coll.h b/src/common/coll.h index 7f29a1a5e..9f5539afc 100644 --- a/src/common/coll.h +++ b/src/common/coll.h @@ -59,9 +59,15 @@ struct Collection { void** Items; /* Array with dynamic size */ }; +/* An empty collection */ +extern const Collection EmptyCollection; + /* Initializer for static collections */ #define STATIC_COLLECTION_INITIALIZER { 0, 0, 0 } +/* Initializer for auto collections */ +#define AUTO_COLLECTION_INITIALIZER EmptyCollection; + /*****************************************************************************/