Rename arraddnoff -> arraddnindex
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Fixes #1011. As intended according to https://github.com/nothings/stb/pull/932#issuecomment-657524197.
authored by t-mw · committed by GitHub · parent b42009b · Browse files · 1 file·+18 added−18 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+18 added−18 removed
- other:+18 added−18 removed
Provenance
- Commit
2d82cd1- Tree
f04226b- Author
t-mw <t-mw@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent
b42009b
1 file changed+18 added−18 removed
modified:stb_ds.h+18 added-18 removed
529 unmodified lines530 #define stbds_header(t) ((stbds_array_header *) (t) - 1)531 #define stbds_temp(t) stbds_header(t)->temp532 #define stbds_temp_key(t) (*(char **) stbds_header(t)->hash_table)533 534-#define stbds_arrsetcap(a,n) (stbds_arrgrow(a,0,n))535-#define stbds_arrsetlen(a,n) ((stbds_arrcap(a) < (size_t) (n) ? stbds_arrsetcap((a),(size_t)(n)),0 : 0), (a) ? stbds_header(a)->length = (size_t) (n) : 0)536-#define stbds_arrcap(a) ((a) ? stbds_header(a)->capacity : 0)537-#define stbds_arrlen(a) ((a) ? (ptrdiff_t) stbds_header(a)->length : 0)538-#define stbds_arrlenu(a) ((a) ? stbds_header(a)->length : 0)539-#define stbds_arrput(a,v) (stbds_arrmaybegrow(a,1), (a)[stbds_header(a)->length++] = (v))540-#define stbds_arrpush stbds_arrput // synonym541-#define stbds_arrpop(a) (stbds_header(a)->length--, (a)[stbds_header(a)->length])542-#define stbds_arraddn(a,n) ((void)(stbds_arraddnoff(a, n))) // deprecated, use one of the following instead:543-#define stbds_arraddnptr(a,n) (stbds_arrmaybegrow(a,n), stbds_header(a)->length += (n), &(a)[stbds_header(a)->length-(n)])544-#define stbds_arraddnoff(a,n) (stbds_arrmaybegrow(a,n), stbds_header(a)->length += (n), stbds_header(a)->length-(n))545-#define stbds_arrlast(a) ((a)[stbds_header(a)->length-1])546-#define stbds_arrfree(a) ((void) ((a) ? STBDS_FREE(NULL,stbds_header(a)) : (void)0), (a)=NULL)547-#define stbds_arrdel(a,i) stbds_arrdeln(a,i,1)548-#define stbds_arrdeln(a,i,n) (memmove(&(a)[i], &(a)[(i)+(n)], sizeof *(a) * (stbds_header(a)->length-(n)-(i))), stbds_header(a)->length -= (n))549-#define stbds_arrdelswap(a,i) ((a)[i] = stbds_arrlast(a), stbds_header(a)->length -= 1)550-#define stbds_arrinsn(a,i,n) (stbds_arraddn((a),(n)), memmove(&(a)[(i)+(n)], &(a)[i], sizeof *(a) * (stbds_header(a)->length-(n)-(i))))551-#define stbds_arrins(a,i,v) (stbds_arrinsn((a),(i),1), (a)[i]=(v))534+#define stbds_arrsetcap(a,n) (stbds_arrgrow(a,0,n))535+#define stbds_arrsetlen(a,n) ((stbds_arrcap(a) < (size_t) (n) ? stbds_arrsetcap((a),(size_t)(n)),0 : 0), (a) ? stbds_header(a)->length = (size_t) (n) : 0)536+#define stbds_arrcap(a) ((a) ? stbds_header(a)->capacity : 0)537+#define stbds_arrlen(a) ((a) ? (ptrdiff_t) stbds_header(a)->length : 0)538+#define stbds_arrlenu(a) ((a) ? stbds_header(a)->length : 0)539+#define stbds_arrput(a,v) (stbds_arrmaybegrow(a,1), (a)[stbds_header(a)->length++] = (v))540+#define stbds_arrpush stbds_arrput // synonym541+#define stbds_arrpop(a) (stbds_header(a)->length--, (a)[stbds_header(a)->length])542+#define stbds_arraddn(a,n) ((void)(stbds_arraddnindex(a, n))) // deprecated, use one of the following instead:543+#define stbds_arraddnptr(a,n) (stbds_arrmaybegrow(a,n), stbds_header(a)->length += (n), &(a)[stbds_header(a)->length-(n)])544+#define stbds_arraddnindex(a,n)(stbds_arrmaybegrow(a,n), stbds_header(a)->length += (n), stbds_header(a)->length-(n))545+#define stbds_arrlast(a) ((a)[stbds_header(a)->length-1])546+#define stbds_arrfree(a) ((void) ((a) ? STBDS_FREE(NULL,stbds_header(a)) : (void)0), (a)=NULL)547+#define stbds_arrdel(a,i) stbds_arrdeln(a,i,1)548+#define stbds_arrdeln(a,i,n) (memmove(&(a)[i], &(a)[(i)+(n)], sizeof *(a) * (stbds_header(a)->length-(n)-(i))), stbds_header(a)->length -= (n))549+#define stbds_arrdelswap(a,i) ((a)[i] = stbds_arrlast(a), stbds_header(a)->length -= 1)550+#define stbds_arrinsn(a,i,n) (stbds_arraddn((a),(n)), memmove(&(a)[(i)+(n)], &(a)[i], sizeof *(a) * (stbds_header(a)->length-(n)-(i))))551+#define stbds_arrins(a,i,v) (stbds_arrinsn((a),(i),1), (a)[i]=(v))552 553 #define stbds_arrmaybegrow(a,n) ((!(a) || stbds_header(a)->length + (n) > stbds_header(a)->capacity) \554 ? (stbds_arrgrow(a,n,0),0) : 0)555 1325 unmodified lines