Skip to content
Myr

hmlen and hmlenu now returns 0 on NULL pointer

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

authored by Vinh Truong · committed by Vinh Truong · parent 1034f5e · Browse files · 1 file+2 added−2 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−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:stb_ds.h+2 added-2 removed
489 unmodified lines
490 ((void) ((p) != NULL ? stbds_hmfree_func((p)-1,sizeof*(p),STBDS_OFFSETOF((p),key)),0 : 0),(p)=NULL)491492#define stbds_hmgets(t, k) (*stbds_hmgetp(t,k))493#define stbds_hmget(t, k) (stbds_hmgetp(t,k)->value)494#define stbds_hmlen(t) (stbds_arrlen((t)-1)-1)495#define stbds_hmlenu(t) (stbds_arrlenu((t)-1)-1)494#define stbds_hmlen(t) ((t) ? (ptrdiff_t) stbds_header((t)-1)->length-1 : 0)495#define stbds_hmlenu(t) ((t) ? stbds_header((t)-1)->length-1 : 0)496497#define stbds_shput(t, k, v) \498 ((t) = stbds_hmput_key_wrapper((t), sizeof *(t), (void*) (k), sizeof (t)->key, STBDS_HM_STRING), \499 (t)[stbds_temp(t-1)].value = (v))
1170 unmodified lines