Skip to content

Commit 2d5de1b

Browse files
committed
Update comments
1 parent e23691c commit 2d5de1b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

m-array.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#define ARRAY_DEF(name, ...) \
3333
ARRAYI_DEF(M_IF_NARGS_EQ1(__VA_ARGS__) \
3434
((name, __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__)(), M_C(name,_t), M_C(name,_it_t) ), \
35-
(name, __VA_ARGS__, M_C(name,_t), M_C(name,_it_t))))
35+
(name, __VA_ARGS__, M_C(name,_t), M_C(name,_it_t))))
3636

3737
/* Define the oplist of a dynamic array given its name and its oplist.
3838
USAGE: ARRAY_OPLIST(name[, oplist of the type]) */
@@ -49,7 +49,7 @@
4949

5050
/* OPLIST definition of a dynamic array */
5151
/* FIXME: Do we want to export some methods as they are slow and
52-
are not fit to be used for building other methods (like _remove)? */
52+
are not fit to be used for building other methods (like _it_remove)? */
5353
#define ARRAYI_OPLIST2(name, oplist) \
5454
(INIT(M_C(name, _init)) \
5555
,INIT_SET(M_C(name, _init_set)) \
@@ -103,7 +103,7 @@
103103
,M_IF_METHOD(DEL, oplist)(DEL(M_GET_DEL oplist),) \
104104
)
105105

106-
/* Define the contract of an array */
106+
/* Define the internal contract of an array */
107107
#define ARRAYI_CONTRACT(a) do { \
108108
assert (a != NULL); \
109109
assert (a->size <= a->alloc); \
@@ -119,16 +119,16 @@
119119
typedef struct M_C(name, _s) { \
120120
size_t size; /* Number of elements in the array */ \
121121
size_t alloc; /* Allocated size for the array */ \
122-
type *ptr; /* Pointer to the array */ \
122+
type *ptr; /* Pointer to the array base */ \
123123
} array_t[1]; \
124124
typedef struct M_C(name, _s) *M_C(name, _ptr); \
125125
typedef const struct M_C(name, _s) *M_C(name, _srcptr); \
126126
\
127127
typedef type M_C(name, _type_t); \
128128
\
129129
typedef struct M_C(name, _it_s) { \
130-
size_t index; \
131-
const struct M_C(name, _s) *array; \
130+
size_t index; /* Index of the element */ \
131+
const struct M_C(name, _s) *array; /* Reference of the array */ \
132132
} array_it_t[1]; \
133133
\
134134
static inline void \

0 commit comments

Comments
 (0)