Skip to content

Commit 7531f42

Browse files
committed
lib: darr: replace use of reserved __ prefix in darr
Signed-off-by: Christian Hopps <chopps@labn.net>
1 parent a7626ba commit 7531f42

2 files changed

Lines changed: 147 additions & 161 deletions

File tree

lib/darr.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static size_t darr_size(uint count, size_t esize)
5454
return count * esize + sizeof(struct darr_metadata);
5555
}
5656

57-
char *__darr_in_vsprintf(char **sp, bool concat, const char *fmt, va_list ap)
57+
char *_darr__in_vsprintf(char **sp, bool concat, const char *fmt, va_list ap)
5858
{
5959
size_t inlen = concat ? darr_strlen(*sp) : 0;
6060
size_t capcount = strlen(fmt) + MIN(inlen + 64, 128);
@@ -84,18 +84,18 @@ char *__darr_in_vsprintf(char **sp, bool concat, const char *fmt, va_list ap)
8484
return *sp;
8585
}
8686

87-
char *__darr_in_sprintf(char **sp, bool concat, const char *fmt, ...)
87+
char *_darr__in_sprintf(char **sp, bool concat, const char *fmt, ...)
8888
{
8989
va_list ap;
9090

9191
va_start(ap, fmt);
92-
(void)__darr_in_vsprintf(sp, concat, fmt, ap);
92+
(void)_darr__in_vsprintf(sp, concat, fmt, ap);
9393
va_end(ap);
9494
return *sp;
9595
}
9696

9797

98-
void *__darr_resize(void *a, uint count, size_t esize, struct memtype *mtype)
98+
void *_darr__resize(void *a, uint count, size_t esize, struct memtype *mtype)
9999
{
100100
uint ncount = darr_next_count(count, esize);
101101
size_t osz = (a == NULL) ? 0 : darr_size(darr_cap(a), esize);
@@ -115,14 +115,13 @@ void *__darr_resize(void *a, uint count, size_t esize, struct memtype *mtype)
115115
}
116116

117117

118-
void *__darr_insert_n(void *a, uint at, uint count, size_t esize, bool zero,
119-
struct memtype *mtype)
118+
void *_darr__insert_n(void *a, uint at, uint count, size_t esize, bool zero, struct memtype *mtype)
120119
{
121120
struct darr_metadata *dm;
122121
uint olen, nlen;
123122

124123
if (!a)
125-
a = __darr_resize(NULL, at + count, esize, mtype);
124+
a = _darr__resize(NULL, at + count, esize, mtype);
126125
dm = (struct darr_metadata *)a - 1;
127126
olen = dm->len;
128127

@@ -137,7 +136,7 @@ void *__darr_insert_n(void *a, uint at, uint count, size_t esize, bool zero,
137136
nlen = olen + count;
138137

139138
if (nlen > dm->cap) {
140-
a = __darr_resize(a, nlen, esize, mtype);
139+
a = _darr__resize(a, nlen, esize, mtype);
141140
dm = (struct darr_metadata *)a - 1;
142141
}
143142

0 commit comments

Comments
 (0)