c-string compact toggle param

This commit is contained in:
Tenari
2026-05-25 10:14:04 -05:00
parent 314f30d632
commit ddadc23a70
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -677,7 +677,7 @@ fn Codepoint codepointFromBytesBefore(ptr bytes, u32 offset);
fn Codepoint codepointFromRawInt(u32 c);
fn void codepointFillBuf(Codepoint cp, ptr buf);
fn String stringFromRawCodepoint(Arena* a, u32 c);
fn bool stringInsertCodepointAtByte(String* s, Codepoint c, u32 byte_offset);
fn bool stringInsertCodepointAtByte(String* s, Codepoint c, u32 byte_offset, bool keep_trailing_zero);
fn u8 stringDeleteCodepointAtByte(String* s, u32 byte_offset);
fn bool stringDeleteCodepointsBetweenByteOffsetsInclusive(String* s, u32 start, u32 end);
+2 -2
View File
@@ -244,8 +244,8 @@ fn String stringFromRawCodepoint(Arena* a, u32 c) {
return result;
}
fn bool stringInsertCodepointAtByte(String* s, Codepoint c, u32 byte_offset) {
u32 remaining_space = s->capacity - s->length;
fn bool stringInsertCodepointAtByte(String* s, Codepoint c, u32 byte_offset, bool keep_trailing_zero) {
i32 remaining_space = (s->capacity - (keep_trailing_zero ? 1 : 0)) - s->length;
if (remaining_space < c.size) return false;
char codepoint_bytes[4];