C is Evil: Minor Edits

main
abnercoimbre 2025-04-09 11:56:44 -07:00
parent 8b51720358
commit 7a89327591
1 changed files with 2 additions and 2 deletions

View File

@ -31,12 +31,12 @@ When you dig into File Pilot, youll find its author wrote the entire thing in
Abner pokes fun at Rustaceans too. For example while extending [microui](https://github.com/rxi/microui) to support growable command lists (to queue up more draw commands per frame) he went straight for the jugular:
```c
function __attribute__((nonnull)) void mu_grow_command_list(mu_Context *ctx, int capacity) {
function void mu_grow_command_list(mu_Context *ctx, int capacity) __attribute__((nonnull)) {
expect(capacity > ctx->command_list.capacity);
char *old_base = ctx->command_list.items;
ctx->command_list.items = TC_REALLOC(ctx->command_list.items, capacity);
ctx->command_list.items = REALLOC(ctx->command_list.items, capacity);
ctx->command_list.capacity = capacity;
/* patch up pointers (Rust enthusiasts: avert your eyes!) */