size arrays by the constants' own names

sexc converts an array bound's name now (sex#50), so MAX_STRATA and
the like go back to being written as defined.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 18:06:24 +03:00
parent 28f0e8acac
commit d299ba05ac
9 changed files with 31 additions and 65 deletions

View File

@@ -78,10 +78,8 @@
;; the reading
(readable bool) (place int) (y natfloat) (abs-avg double) (bearing u32)))
;; TODO sex#50: write MAX-MINERALS once constants in array types are
;; kebab-converted.
(pub record ores
((minerals [mineral MAX_MINERALS]) (count int) (granite int) (sea-level int)))
((minerals [mineral MAX-MINERALS]) (count int) (granite int) (sea-level int)))
;;; The reading at one column: TotalFactor and PartsPerThousand.
(pub record mineral-reading ((total double) (ppt double)))
@@ -321,7 +319,7 @@
(= (. o sea-level) (cast (* 0.4313725490196078 (. settings size-y)) int))
(var root [char 1024])
(snprintf root (sizeof root) "%s/survival/worldgen/deposits" assets-dir)
(var paths [* char MAX_DEPOSIT_FILES])
(var paths [* char MAX-DEPOSIT-FILES])
(var n int 0)
(list-files root "" paths (& n))
(qsort paths n (sizeof [paths 0]) by-name)