summaryrefslogtreecommitdiff
path: root/lib/darr.h
AgeCommit message (Collapse)Author
2025-01-13lib: fix new (incorrect) CLANG SA warningsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-12-15lib: darr: fix bug with nested macro useChristian Hopps
- WHen declaring macro scoped variables, can run into problem if the macro variable passed in has the same name as the new variable introduced in the inner scope. We don't get a warning and the uses will be wrong. e.g., ``` { int __len = 10; foo(__len); // => 10 and not 15 as we wanted. } ``` Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-06lib: darr: add free with element cleanup functionsChristian Hopps
- `darr_free_free` to `darr_free` each element prior to `darr_free` the array. - `darr_free_func` to call `func` on each element prior to `darr_free` the array. Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-11lib: fix coverity issuesChristian Hopps
** CID 1575504: Insecure data handling (TAINTED_SCALAR) (maybe) ** CID 1575505: Integer handling issues (CONSTANT_EXPRESSION_RESULT) ** CID 1575506: Integer handling issues (CONSTANT_EXPRESSION_RESULT) ** CID 1575507: Null pointer dereferences (REVERSE_INULL) Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-07lib: fix clang SA warningsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28lib: darr: add ability to set MTYPE for dynamic arraysChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28lib: darr: add new access and str functionsChristian Hopps
- darr_last(), and darr_strdup_cap(). - strcat, strdup, strlen, strnul equivs. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-11lib: darr needs to use memory.h for both alloc and freeChristian Hopps
Was using XREALLOC() and then free(). instant "memleaks". Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-27lib: add dynamic array typeChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>