From 7a89327591ef43c3cb6582dddfda465a488389e4 Mon Sep 17 00:00:00 2001 From: abnercoimbre Date: Wed, 9 Apr 2025 11:56:44 -0700 Subject: [PATCH] C is Evil: Minor Edits --- content/english/operation2030/appendix/c-is-evil-so-what.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/english/operation2030/appendix/c-is-evil-so-what.md b/content/english/operation2030/appendix/c-is-evil-so-what.md index f68f8a4..47966a7 100644 --- a/content/english/operation2030/appendix/c-is-evil-so-what.md +++ b/content/english/operation2030/appendix/c-is-evil-so-what.md @@ -31,12 +31,12 @@ When you dig into File Pilot, you’ll 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!) */