From 7cb49f83cd4d5679ac6ad9f307fffbb05a407329 Mon Sep 17 00:00:00 2001 From: alex-eg Date: Fri, 9 Oct 2026 18:12:04 +0300 Subject: [PATCH] name the colour function type A typedef of a function pointer type compiles now (sex#53). Co-Authored-By: Claude Opus 5.5 --- src/dump.sex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dump.sex b/src/dump.sex index b797d9a..0f8280e 100644 --- a/src/dump.sex +++ b/src/dump.sex @@ -12,13 +12,13 @@ (fn climate-colour ((v i32)) u32 (return (& (cast v u32) 0xFFFFFF))) (fn byte-colour ((v i32)) u32 (return (grey v))) +(typedef colour-fn (fn ((i32)) u32)) + ;;; The inner square of one region's map, placed at (ox, oz) and ;;; stretched to CELL pixels a side, so maps of different resolutions ;;; line up pixel for pixel across mosaics. -;; TODO sex#53: name the colour function type with a typedef once that -;; no longer crashes sexc. (fn paint-map ((im (* image)) (m (* const int-map)) (ox int) (oz int) (cell int) - (colour (fn ((i32)) u32))) void + (colour colour-fn)) void (var inner int (- (. m size) (. m pad-tl) (. m pad-br))) (if (<= inner 0) (return))