comments, use Nothing instead of voidptr

This commit is contained in:
2026-02-21 14:18:48 +11:00
parent cb13200545
commit f325b8deef
9 changed files with 84 additions and 44 deletions

View File

@@ -46,12 +46,12 @@ ResultType(SolsType, charptr) copySolsType(SolsType* type) {
return Success(SolsType, charptr, ret);
}
ResultType(voidptr, charptr) addChildToSolsType(SolsType* type, SolsType child, const char* name) {
ResultType(Nothing, charptr) addChildToSolsType(SolsType* type, SolsType child, const char* name) {
if (type->children.capacity < type->children.count + 1) {
type->children.capacity *= 2;
SolsTypeField* ptr = realloc(type->children.at, sizeof(SolsTypeField) * type->children.capacity);
if (ptr == NULL) {
return Error(voidptr, charptr, "Couldn't allocate memory (in addChildToSolsType() function)");
return Error(Nothing, charptr, "Couldn't allocate memory (in addChildToSolsType() function)");
}
type->children.at = ptr;
}
@@ -59,7 +59,7 @@ ResultType(voidptr, charptr) addChildToSolsType(SolsType* type, SolsType child,
if (copied.error) {
Estr err = CREATE_ESTR(copied.as.error);
APPEND_ESTR(err, " (in addChildToSolsType() function)");
return Error(voidptr, charptr, err.str);
return Error(Nothing, charptr, err.str);
}
type->children.at[type->children.count].type = copied.as.success;
if (name == NULL) {
@@ -70,7 +70,7 @@ ResultType(voidptr, charptr) addChildToSolsType(SolsType* type, SolsType child,
}
type->children.count++;
return Success(voidptr, charptr, NULL);
return Success(Nothing, charptr, {});
}
void freeSolsType(SolsType* type) {