From 7775504b3284273b6c8bcbb825d66652ea9c2831 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Fri, 22 May 2026 08:02:09 +0200 Subject: [PATCH] amake: fix warnings --- base/tools/amake/aimage.c | 17 +++++++++++------ base/tools/amake/project.js | 14 +++++++++++++- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/base/tools/amake/aimage.c b/base/tools/amake/aimage.c index 8bfa77a3..0006c951 100644 --- a/base/tools/amake/aimage.c +++ b/base/tools/amake/aimage.c @@ -28,9 +28,9 @@ static bool ends_with(const char *s, const char *end) { } static gpu_texture_t read_png_jpg(const char *filename) { - int width, height, n; - char *data = stbi_load(filename, &width, &height, &n, 4); - gpu_texture_t img = {.data = data, .width = width, .height = height, .is_hdr = false}; + int width, height, n; + unsigned char *data = stbi_load(filename, &width, &height, &n, 4); + gpu_texture_t img = {.data = data, .width = width, .height = height, .is_hdr = false}; return img; } @@ -163,11 +163,16 @@ static void write_k(int width, int height, const char *format, char *data, int s } static uint16_t float_to_half_fast(float value) { - union { float f; uint32_t u; } v = {value}; + union { + float f; + uint32_t u; + } v = {value}; uint32_t sign = (v.u >> 16) & 0x8000; v.u &= 0x7FFFFFFF; - if (v.u >= 0x47800000) return sign | 0x7C00; - if (v.u < 0x38800000) return sign; + if (v.u >= 0x47800000) + return sign | 0x7C00; + if (v.u < 0x38800000) + return sign; return sign | ((v.u - 0x38000000) >> 13); } diff --git a/base/tools/amake/project.js b/base/tools/amake/project.js index 0eb28c0c..2c9ed1c8 100644 --- a/base/tools/amake/project.js +++ b/base/tools/amake/project.js @@ -15,7 +15,19 @@ project.add_cfiles("main.c"); project.add_cfiles("aimage.c"); project.add_cfiles("ashader.c"); -project.add_cfiles('../../sources/kong/*.c'); + +project.add_cfiles("../../sources/kong/dir.c"); +project.add_cfiles("../../sources/kong/kong.c"); +project.add_cfiles("../../sources/kong/kong_cstyle.c"); +project.add_cfiles("../../sources/kong/stb_ds.c"); +project.add_cfiles("../../sources/kong/kong_spirv.c"); +project.add_cfiles("../../sources/kong/kong_wgsl.c"); +if (platform == "windows") { + project.add_cfiles("../../sources/kong/kong_hlsl.c"); +} +if (platform == "macos" || platform == "ios") { + project.add_cfiles("../../sources/kong/kong_metal.c"); +} if (platform === "windows") { project.add_define('_CRT_SECURE_NO_WARNINGS');