Skip to content
Myr

Adding arrpop macro to stb_ds.h

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

authored by Rafael Sachetto · committed by Rafael Sachetto · parent 89bccdd · Browse files · 1 file+2 added−0 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+2 added−0 removed

  • other:+2 added−0 removed

1 file+2 added−0 removed

modified:stb_ds.h+2 added
319 unmodified lines
320#define arrlen stbds_arrlen321#define arrlenu stbds_arrlenu322#define arrput stbds_arrput323#define arrpush stbds_arrput324#define arrpop stbds_arrpop325#define arrfree stbds_arrfree326#define arraddn stbds_arraddn327#define arrsetlen stbds_arrsetlen328#define arrlast stbds_arrlast
107 unmodified lines
436#define stbds_arrlen(a) ((a) ? (ptrdiff_t) stbds_header(a)->length : 0)437#define stbds_arrlenu(a) ((a) ? stbds_header(a)->length : 0)438#define stbds_arrput(a,v) (stbds_arrmaybegrow(a,1), (a)[stbds_header(a)->length++] = (v))439#define stbds_arrpush stbds_arrput // synonym440#define stbds_arrpop(a) (stbds_header(a)->length--, (a)[stbds_header(a)->length])441#define stbds_arraddn(a,n) (stbds_arrmaybegrow(a,n), stbds_header(a)->length += (n))442#define stbds_arrlast(a) ((a)[stbds_header(a)->length-1])443#define stbds_arrfree(a) ((void) ((a) ? realloc(stbds_header(a),0) : 0), (a)=NULL)444#define stbds_arrdel(a,i) stbds_arrdeln(a,i,1)
1197 unmodified lines