From 0d0747dea9caac7393a4bb173f1bfd5daf8cdd44 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Mon, 14 Apr 2025 00:13:40 +0200 Subject: [PATCH] Update oplists --- m-bitset.h | 7 ++++--- m-bstring.h | 17 +++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/m-bitset.h b/m-bitset.h index f9a41e3d..af0c7b3f 100644 --- a/m-bitset.h +++ b/m-bitset.h @@ -834,6 +834,7 @@ m_bitset_popcount(const m_bitset_t set) } /* Oplist for a bitset */ +#ifndef M_USE_POOL #define M_BITSET_OPLIST \ (INIT(m_bitset_init) \ ,INIT_SET(m_bitset_init_set) \ @@ -868,9 +869,8 @@ m_bitset_popcount(const m_bitset_t set) ,IN_STR(m_bitset_in_str) \ ,EQUAL(m_bitset_equal_p) \ ) - -/* Oplist for a bitset */ -#define M_BITSET_POOL_OPLIST \ +#else +#define M_BITSET_OPLIST \ (INIT(m_bitset_init) \ ,INIT_SET(API_0P(m_bitset_init_set)) \ ,INIT_WITH(API_1(M_INIT_VAI)) \ @@ -904,6 +904,7 @@ m_bitset_popcount(const m_bitset_t set) ,IN_STR(API_0P(m_bitset_in_str)) \ ,EQUAL(m_bitset_equal_p) \ ) +#endif /* Register the OPLIST as a global one */ #ifdef M_USE_POOL diff --git a/m-bstring.h b/m-bstring.h index 913a30b4..db0f1cf3 100644 --- a/m-bstring.h +++ b/m-bstring.h @@ -534,26 +534,27 @@ M_P(m_serial_return_code_t, m_bstring, _in_serial, m_bstring_t v, m_serial_read_ } /* Define the OPLIST of a BYTE STRING */ +#ifndef M_USE_POOL #define M_BSTRING_OPLIST \ (INIT(m_bstring_init),INIT_SET(m_bstring_init_set), SET(m_bstring_set), \ INIT_MOVE(m_bstring_init_move), MOVE(m_bstring_move), \ - SWAP(m_bstring_swap), RESET(m_bstring_reset), \ - EMPTY_P(m_bstring_empty_p), \ + SWAP(m_bstring_swap), RESET(m_bstring_reset), EMPTY_P(m_bstring_empty_p), \ + SUBTYPE(uint8_t), PUSH(m_bstring_push), \ CLEAR(m_bstring_clear), HASH(m_bstring_hash), EQUAL(m_bstring_equal_p), \ CMP(m_bstring_cmp), TYPE(m_bstring_t), GENTYPE(struct m_bstring_s*), \ OUT_SERIAL(m_bstring_out_serial), IN_SERIAL(m_bstring_in_serial), \ ) - -/* Define the OPLIST of a BYTE STRING using POOL */ -#define M_BSTRING_POOL_OPLIST \ +#else +#define M_BSTRING_OPLIST \ (INIT(m_bstring_init),INIT_SET(API_0P(m_bstring_init_set)), SET(API_0P(m_bstring_set)), \ INIT_MOVE(m_bstring_init_move), MOVE(API_0P(m_bstring_move)), \ - SWAP(m_bstring_swap), RESET(m_bstring_reset), \ - EMPTY_P(m_bstring_empty_p), \ + SWAP(m_bstring_swap), RESET(m_bstring_reset), EMPTY_P(m_bstring_empty_p), \ + SUBTYPE(uint8_t), PUSH(API_0P(m_bstring_push)), \ CLEAR(API_0P(m_bstring_clear)), HASH(m_bstring_hash), EQUAL(m_bstring_equal_p), \ CMP(m_bstring_cmp), TYPE(m_bstring_t), GENTYPE(struct m_bstring_s*), \ - OUT_SERIAL(m_bstring_out_serial), IN_SERIAL(API_0P(m_bstring_in_serial=) \ + OUT_SERIAL(API_0P(m_bstring_out_serial)), IN_SERIAL(API_0P(m_bstring_in_serial=) \ ) +#endif /********************************************************************************/ /* */