Skip to content
Myr

Merge branch 'master' of https://github.com/blackpawn/stb into stb_h_fix

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parents 8c5a442, a4ab8c0 · Browse files · 1 file+3 added−3 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+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:stb.h+3 added-3 removed
3087 unmodified lines
3088// add N new uninitialized elements starting at index 'i'3089#define stb_arr_insertn(a,i,n) (stb__arr_insertn((void **) &(a), sizeof(*a), i, n))30903091// insert an element at i3092#define stb_arr_insert(a,i,v) (stb__arr_insertn((void **) &(a), sizeof(*a), i, n), ((a)[i] = v))3092#define stb_arr_insert(a,i,v) (stb__arr_insertn((void **) &(a), sizeof(*a), i, 1), ((a)[i] = v))30933094// delete N elements from the middle starting at index 'i'3095#define stb_arr_deleten(a,i,n) (stb__arr_deleten((void **) &(a), sizeof(*a), i, n))3096
177 unmodified lines
3274 return;3275 }32763277 z = stb_arr_len2(p);3278 stb__arr_addlen_(&p, size, i STB__ARGS);3278 stb__arr_addlen_(&p, size, n STB__ARGS);3279 memmove((char *) p + (i+n)*size, (char *) p + i*size, size * (z-i));3280 }3281 *pp = p;3282}
1 unmodified line
3284void stb__arr_deleten_(void **pp, int size, int i, int n STB__PARAMS)3285{3286 void *p = *pp;3287 if (n) {3288 memmove((char *) p + i*size, (char *) p + (i+n)*size, size * (stb_arr_len2(p)-i));3288 memmove((char *) p + i*size, (char *) p + (i+n)*size, size * (stb_arr_len2(p)-(i+n)));3289 stb_arrhead2(p)->len -= n;3290 }3291 *pp = p;3292}
10882 unmodified lines