feat(core): rename string and stream functions for clarity

- Rename `cstring_push` to `cstring_append_ch` and `cstring_push_cstr` to `cstring_append_cstr` for consistent naming with new `cstring_append` function
- Update all callers in lexer and tests to use new function names
- Rename stream `destroy` method to `drop` for consistency with resource management conventions
- Fix potential overflow in string capacity calculation by adjusting growth logic
This commit is contained in:
zzy
2025-12-09 18:04:53 +08:00
parent 36bff64a91
commit 186602a301
5 changed files with 28 additions and 16 deletions

View File

@@ -68,8 +68,8 @@ static cbool mem_probe_stream_back(core_probe_stream_t *_stream) {
return true;
}
static usize mem_probe_stream_read_buf(core_probe_stream_t *_stream, char *buffer,
usize count) {
static usize mem_probe_stream_read_buf(core_probe_stream_t *_stream,
char *buffer, usize count) {
Assert(_stream != null);
core_mem_probe_stream_t *stream = (core_mem_probe_stream_t *)_stream;
@@ -164,7 +164,7 @@ core_probe_stream_t *core_mem_probe_stream_init(core_mem_probe_stream_t *stream,
stream->stream.read_buf = mem_probe_stream_read_buf;
stream->stream.reset = mem_probe_stream_reset;
stream->stream.is_at_end = mem_probe_stream_is_at_end;
stream->stream.destroy = mem_probe_stream_destroy;
stream->stream.drop = mem_probe_stream_destroy;
return (core_probe_stream_t *)stream;
}