better disk output

This commit is contained in:
Linus Dierheimer
2021-03-28 15:38:52 +02:00
parent 184eafce20
commit c44bd6dbc1
8 changed files with 91 additions and 16 deletions
+10
View File
@@ -333,6 +333,16 @@ void ffStrbufRemoveStrings(FFstrbuf* strbuf, uint32_t numStrings, ...)
}
}
uint32_t ffStrbufFirstIndexC(FFstrbuf* strbuf, const char c)
{
for(uint32_t i = 0; i < strbuf->length; i++)
{
if(strbuf->chars[i] == c)
return i;
}
return strbuf->length;
}
uint32_t ffStrbufLastIndexC(FFstrbuf* strbuf, const char c)
{
//We need to loop one higher than the actual index, because uint32_t is guranteed to be >= 0, so this statement would always be true
+1
View File
@@ -68,6 +68,7 @@ void ffStrbufTrim(FFstrbuf* strbuf, char c);
void ffStrbufRemoveStrings(FFstrbuf* strbuf, uint32_t numStrings, ...);
uint32_t ffStrbufFirstIndexC(FFstrbuf* strbuf, const char c);
uint32_t ffStrbufLastIndexC(FFstrbuf* strbuf, const char c);
void ffStrbufLimitLength(FFstrbuf* strbuf, uint32_t length);