Correct warning if used -Wextra

This commit is contained in:
german 2026-05-03 19:46:43 +04:00
parent 7190c5fd76
commit f150e9ae06

View File

@ -110,7 +110,7 @@ void __free_string_array(char** arr, size_t size) {
static void* __sized_malloc(size_t size) { static void* __sized_malloc(size_t size) {
void* ptr = malloc(size); void* ptr = malloc(size);
memset(ptr, ((int)(unsigned long)NULL), size); memset(ptr, ((int)(unsigned long)NULL), size);
return ptr; return (void*)ptr;
} }
static unsigned char __compile_and_equals_sflag(char* flags, char* str) { static unsigned char __compile_and_equals_sflag(char* flags, char* str) {
@ -153,15 +153,15 @@ int _lib_argsparse_main(int argc, char** argv, char** config, size_t size) {
int i = 1; int i = 1;
size_t flags = __conf_flags_size(config, size); size_t flags = __conf_flags_size(config, size);
__sfdgssg_parse_result.ArgsGetSimpleFlags() = __sfdgssg_parse_result.ArgsGetSimpleFlags() =
__sized_malloc((flags) * sizeof(char**)); (char**)__sized_malloc((flags) * sizeof(char**));
__sfdgssg_parse_result.ArgsGetNamesFlags() = __sfdgssg_parse_result.ArgsGetNamesFlags() =
__sized_malloc((size - flags) * sizeof(char**)); (char**)__sized_malloc((size - flags) * sizeof(char**));
__sfdgssg_parse_result.ArgsGetNamesVals() = __sfdgssg_parse_result.ArgsGetNamesVals() =
__sized_malloc((size - flags) * sizeof(char**)); (char**)__sized_malloc((size - flags) * sizeof(char**));
__sfdgssg_parse_result.ArgsGetNamesNumbers() = __sfdgssg_parse_result.ArgsGetNamesNumbers() =
__sized_malloc((size - flags) * sizeof(size_t)); (size_t*)__sized_malloc((size - flags) * sizeof(size_t));
__sfdgssg_parse_result.ArgsGetSimpleNumbers() = __sfdgssg_parse_result.ArgsGetSimpleNumbers() =
__sized_malloc((flags) * sizeof(size_t)); (size_t*)__sized_malloc((flags) * sizeof(size_t));
__args_parse_t* out = &__sfdgssg_parse_result; __args_parse_t* out = &__sfdgssg_parse_result;
size_t simple_flags_count = 0; size_t simple_flags_count = 0;
size_t names_flags_count = 0; size_t names_flags_count = 0;