From 371fcf48dacbc902331a046fe1d9f65e0879c19e Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 27 Sep 2001 05:54:40 +0000 Subject: [PATCH] Added AUTO_COLLECTION_INITIALIZER git-svn-id: svn://svn.cc65.org/cc65/trunk@977 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/common/coll.c | 11 +++++++++++ src/common/coll.h | 6 ++++++ 2 files changed, 17 insertions(+) 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; + /*****************************************************************************/ -- 2.39.5