From 36d11bc2bdd483fc050e888c45b3575d13d01dbd Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sat, 1 Mar 2025 11:10:29 +0100 Subject: [PATCH] Fix small name usage --- m-algo.h | 10 +++++----- m-deque.h | 4 ++-- m-prioqueue.h | 4 ++-- m-serial-bin.h | 2 +- m-shared-ptr.h | 10 +++++----- m-snapshot.h | 2 +- m-tree.h | 2 +- m-worker.h | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/m-algo.h b/m-algo.h index 4500c485..a4b865e0 100644 --- a/m-algo.h +++ b/m-algo.h @@ -178,11 +178,11 @@ * Created Function objects are part of the public interface */ #define M_ALG0_DEF_FUNCOBJ(name, container_t, cont_oplist, type_t, type_oplist, it_t) \ \ - FUNC_OBJ_ITF_DEF(M_F(name, _test_obj), bool, type_t const) \ - FUNC_OBJ_ITF_DEF(M_F(name, _eq_obj), bool, type_t const, type_t const ) \ - FUNC_OBJ_ITF_DEF(M_F(name, _cmp_obj), int, type_t const, type_t const ) \ - FUNC_OBJ_ITF_DEF(M_F(name, _transform_obj), void, type_t *, type_t const ) \ - FUNC_OBJ_ITF_DEF(M_F(name, _apply_obj), void, type_t * ) \ + M_FUNC_OBJ_ITF_DEF(M_F(name, _test_obj), bool, type_t const) \ + M_FUNC_OBJ_ITF_DEF(M_F(name, _eq_obj), bool, type_t const, type_t const ) \ + M_FUNC_OBJ_ITF_DEF(M_F(name, _cmp_obj), int, type_t const, type_t const ) \ + M_FUNC_OBJ_ITF_DEF(M_F(name, _transform_obj), void, type_t *, type_t const )\ + M_FUNC_OBJ_ITF_DEF(M_F(name, _apply_obj), void, type_t * ) \ /* Define the sort functions with the CMP operator using the order selected */ diff --git a/m-deque.h b/m-deque.h index 602352d0..d21bcb19 100644 --- a/m-deque.h +++ b/m-deque.h @@ -115,7 +115,7 @@ #define M_D3QU3_DEF_TYPE(name, type, oplist, deque_t, it_t, node_t) \ \ typedef struct M_F(name, _node_s) { \ - ILIST_INTERFACE(M_F(name, _node_list), struct M_F(name, _node_s)); \ + M_ILIST_INTERFACE(M_F(name, _node_list), struct M_F(name, _node_s)); \ size_t size; \ type data[M_MIN_FLEX_ARRAY_SIZE]; \ } node_t; \ @@ -127,7 +127,7 @@ The interfaces are compatible. \ */ \ /* FIXME: How can I separate public types and private implementation? */ \ - ILIST_DEF(M_F(name, _node_list), node_t, (DEL(M_GET_FREE oplist)) ) \ + M_ILIST_DEF(M_F(name, _node_list), node_t, (DEL(M_GET_FREE oplist)) ) \ \ /* Define an internal iterator */ \ typedef struct M_F(name, _it2_s) { \ diff --git a/m-prioqueue.h b/m-prioqueue.h index e42afbc1..8c8fa829 100644 --- a/m-prioqueue.h +++ b/m-prioqueue.h @@ -131,7 +131,7 @@ */ #define M_PR1OQUEUE_DEF_P3(name, type, oplist, prioqueue_t, it_t) \ /* Definition of the internal array used to construct the priority queue */ \ - ARRAY_DEF(M_F(name, _array), type, oplist) \ + M_ARRAY_DEF(M_F(name, _array), type, oplist) \ M_PR1OQUEUE_DEF_TYPE(name, type, oplist, prioqueue_t, it_t) \ M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \ M_PR1OQUEUE_DEF_CORE(name, type, oplist, prioqueue_t, it_t) \ @@ -476,7 +476,7 @@ \ M_IF_METHOD(GET_STR, oplist)( \ M_INLINE void \ - M_F(name, _get_str)(string_t str, const prioqueue_t p, bool append) \ + M_F(name, _get_str)(m_string_t str, const prioqueue_t p, bool append) \ { \ M_F(name, _array_get_str)(str, p->array, append); \ } \ diff --git a/m-serial-bin.h b/m-serial-bin.h index ea7740f5..a61c3a18 100644 --- a/m-serial-bin.h +++ b/m-serial-bin.h @@ -400,7 +400,7 @@ m_ser1al_bin_read_float(m_serial_read_t serial, long double *r, const size_t siz Set 's' with the string if succeeds Return M_SERIAL_OK_DONE if it succeeds, M_SERIAL_FAIL otherwise */ M_INLINE m_serial_return_code_t -m_ser1al_bin_read_string(m_serial_read_t serial, struct string_s *s){ +m_ser1al_bin_read_string(m_serial_read_t serial, struct m_string_s *s){ FILE *f = (FILE*) serial->data[0].p; M_ASSERT(f != NULL && s != NULL); // First read the number of non null characters diff --git a/m-shared-ptr.h b/m-shared-ptr.h index 8cf59099..401d823f 100644 --- a/m-shared-ptr.h +++ b/m-shared-ptr.h @@ -1284,7 +1284,7 @@ M_IF_METHOD2(IT_LAST, IT_CREF, oplist)( \ #define M_SHAR3D_PTR_DECL_IO(name, shared_t, oplist) \ M_IF_METHOD(OUT_STR, oplist)( extern void M_F(name, _out_str)(FILE *, const shared_t *); , ) \ M_IF_METHOD(IN_STR, oplist)( extern bool M_F(name, _in_str)(shared_t *, FILE *); , ) \ -M_IF_METHOD(GET_STR, oplist)( extern void M_F(name, _get_str)(string_t, const shared_t *, bool); , ) \ +M_IF_METHOD(GET_STR, oplist)( extern void M_F(name, _get_str)(m_string_t, const shared_t *, bool); , ) \ M_IF_METHOD(PARSE_STR, oplist)( extern bool M_F(name, _parse_str)(shared_t *, const char *, const char **); , ) \ M_IF_METHOD(OUT_SERIAL, oplist)( extern m_serial_return_code_t M_F(name, _out_serial)(m_serial_write_t, const shared_t *); , ) \ M_IF_METHOD(IN_SERIAL, oplist)( extern m_serial_return_code_t M_F(name, _in_serial)(shared_t *, m_serial_read_t); , ) \ @@ -1305,7 +1305,7 @@ M_IF_METHOD(IN_STR, oplist)( \ { \ M_ASSERT (out != NULL && file != NULL); \ M_F(name, _write_lock)(out); \ - bool r m_volatile = false; \ + m_volatile bool r = false; \ M_ON_EXCEPTION( M_F(name, _write_unlock)(out) ) \ r = M_CALL_IN_STR(oplist, out->data, file); \ /* even if r is false, we signal the data (no functional impact)*/ \ @@ -1315,7 +1315,7 @@ M_IF_METHOD(IN_STR, oplist)( \ } \ , ) \ M_IF_METHOD(GET_STR, oplist)( \ - fattr void M_F(name, _get_str)(string_t str, const shared_t *out, bool append) \ + fattr void M_F(name, _get_str)(m_string_t str, const shared_t *out, bool append) \ { \ M_ASSERT (out != NULL); \ M_F(name, _read_lock)(out); \ @@ -1329,7 +1329,7 @@ M_IF_METHOD(PARSE_STR, oplist)( \ { \ M_ASSERT (out != NULL); \ M_F(name, _write_lock)(out); \ - bool m_volatile r = false; \ + m_volatile bool r = false; \ M_ON_EXCEPTION( M_F(name, _write_unlock)(out) ) \ r = M_CALL_PARSE_STR(oplist, out->data, str, endp); \ /* even if r is false, we signal the data (no functional impact)*/ \ @@ -1354,7 +1354,7 @@ M_IF_METHOD(IN_SERIAL, oplist)( \ { \ M_ASSERT (out != NULL); \ M_F(name, _write_lock)(out); \ - m_serial_return_code_t m_volatile r = M_SERIAL_FAIL; \ + m_volatile m_serial_return_code_t r = M_SERIAL_FAIL; \ M_ON_EXCEPTION( M_F(name, _write_unlock)(out) ) \ r = M_CALL_IN_SERIAL(oplist, out->data, serial); \ /* even if r is false, we signal the data (no functional impact)*/ \ diff --git a/m-snapshot.h b/m-snapshot.h index 1560ba6f..afb69262 100644 --- a/m-snapshot.h +++ b/m-snapshot.h @@ -774,7 +774,7 @@ m_snapsh0t_mrsw_read_end(m_snapsh0t_mrsw_ct s, unsigned int idx) { \ M_SNAPSH0T_SPMC_CONTRACT(snap->core); \ const M_F(name, _mrsw_aligned_type_ct) *oldx; \ - oldx = M_CTYPE_FROM_FIELD(M_F(name, _mrsw_aligned_type_ct), old, type, x); \ + oldx = (const M_F(name, _mrsw_aligned_type_ct) *) old; \ M_ASSERT (oldx >= snap->core->data); \ M_ASSERT (oldx < snap->core->data + snap->core->core->n_reader + M_SNAPSH0T_SPMC_EXTRA_BUFFER); \ M_ASSERT(snap->core->core->n_reader + M_SNAPSH0T_SPMC_EXTRA_BUFFER < UINT_MAX); \ diff --git a/m-tree.h b/m-tree.h index 3efc3074..d9ff20ec 100644 --- a/m-tree.h +++ b/m-tree.h @@ -1300,7 +1300,7 @@ typedef int32_t m_tr33_index_t; #define M_TR33_DEF_P4_IO(name, type, oplist, tree_t, it_t) \ M_IF_METHOD(GET_STR, oplist)( \ M_INLINE void \ -M_F(name, _get_str)(string_t str, /*const*/ tree_t tree, bool append) { \ +M_F(name, _get_str)(m_string_t str, /*const*/ tree_t tree, bool append) { \ (append ? m_string_cat_cstr : m_string_set_cstr) (str, "["); \ it_t it = M_F(name, _it)(tree); \ while (!M_F(name, _end_p)(it)) { \ diff --git a/m-worker.h b/m-worker.h index 2b0c6cc2..26ff02de 100644 --- a/m-worker.h +++ b/m-worker.h @@ -143,7 +143,7 @@ typedef struct m_work3r_thread_s { /* Definition of the queue that will record the work orders */ M_BUFFER_DEF(m_work3r_queue, m_work3r_order_ct, 0, - BUFFER_QUEUE|BUFFER_UNBLOCKING_PUSH|BUFFER_BLOCKING_POP|BUFFER_THREAD_SAFE|BUFFER_DEFERRED_POP, M_WORK3R_OPLIST) + M_BUFFER_QUEUE|M_BUFFER_UNBLOCKING_PUSH|M_BUFFER_BLOCKING_POP|M_BUFFER_THREAD_SAFE|M_BUFFER_DEFERRED_POP, M_WORK3R_OPLIST) /* Definition the global pool of workers */ typedef struct m_worker_s {