From b331621a7a732110979928bbda776dea9ee52f47 Mon Sep 17 00:00:00 2001 From: Daniele Basile Date: Fri, 13 Jan 2012 17:10:35 +0100 Subject: [PATCH] Rename macro to more appropiate name. --- bertos/kern/rtask.c | 2 +- bertos/struct/pool.h | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/bertos/kern/rtask.c b/bertos/kern/rtask.c index 0aaaf47f..67838af5 100644 --- a/bertos/kern/rtask.c +++ b/bertos/kern/rtask.c @@ -75,7 +75,7 @@ struct RTask void *user_data; }; -DECLARE_POOL_STATIC(rtask_pool, RTask, CONFIG_RTASK_POOL_SIZE); +DEFINE_POOL_STATIC(rtask_pool, RTask, CONFIG_RTASK_POOL_SIZE); static Process *process = NULL; static List rt_list; static Semaphore rtask_sem; diff --git a/bertos/struct/pool.h b/bertos/struct/pool.h index 9bf4535b..f59fe2e4 100644 --- a/bertos/struct/pool.h +++ b/bertos/struct/pool.h @@ -54,7 +54,7 @@ * // other members here... * } MyType; * - * DECLARE_POOL(mypool, MyType, POOL_SIZE); + * DEFINE_POOL(mypool, MyType, POOL_SIZE); * * static void elem_init(MyType *e) * { @@ -88,7 +88,7 @@ #define EXTERN_POOL(name) \ extern List name -#define DECLARE_POOL_WITH_STORAGE(name, type, num, storage) \ +#define DEFINE_POOL_WITH_STORAGE(name, type, num, storage) \ static type name##_items[num]; \ storage name; \ INLINE void name##_init(void (*init_func)(type*)) \ @@ -104,6 +104,9 @@ INLINE void name##_init(void (*init_func)(type*)) \ /**/ +/* For backwards compatibily */ +#define DECLARE_POOL_WITH_STORAGE DEFINE_POOL_WITH_STORAGE + /** * \brief Helper macro to declare a Pool data type. * @@ -114,16 +117,22 @@ * \param type Data type held by the pool. * \param num Number of elements in pool. */ -#define DECLARE_POOL(name, type, num) \ - DECLARE_POOL_WITH_STORAGE(name, type, num, List) +#define DEFINE_POOL(name, type, num) \ + DEFINE_POOL_WITH_STORAGE(name, type, num, List) + +/* For backwards compatibily */ +#define DECLARE_POOL DEFINE_POOL /** * \brief Static Pool declaration * - * \sa DECLARE_POOL + * \sa DEFINE_POOL */ -#define DECLARE_POOL_STATIC(name, type, num) \ - DECLARE_POOL_WITH_STORAGE(name, type, num, static List) +#define DEFINE_POOL_STATIC(name, type, num) \ + DEFINE_POOL_WITH_STORAGE(name, type, num, static List) + +/* For backwards compatibily */ +#define DECLARE_POOL_STATIC DEFINE_POOL_STATIC /** * Initialize the pool \a name, calling \a init_func on each element. -- 2.25.1