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

@@ -74,16 +74,16 @@ ResultType(SolsTokens, charptr) createSolsTokens() {
return Success(SolsTokens, charptr, tokens);
}
ResultType(voidptr, charptr) addTokenToSolsTokens(SolsTokens* tokens, SolsToken token) {
ResultType(Nothing, charptr) addTokenToSolsTokens(SolsTokens* tokens, SolsToken token) {
if (tokens->capacity < tokens->count + 1) {
tokens->capacity *= 2;
SolsToken* tmp = realloc(tokens->at, sizeof(SolsToken) * tokens->capacity);
if (tmp == NULL) {
return Error(voidptr, charptr, "Failed to allocate memory (in addTokenToSolsTokens() function)");
return Error(Nothing, charptr, "Failed to allocate memory (in addTokenToSolsTokens() function)");
}
tokens->at = tmp;
}
tokens->at[tokens->count] = token;
tokens->count++;
return Success(voidptr, charptr, NULL);
return Success(Nothing, charptr, {});
}