From 38a61078a785e3c792446f281cd3b3257ec79ea7 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Tue, 16 Dec 2025 14:25:31 +0100 Subject: [PATCH] Fix warnings --- base/sources/backends/direct3d12_gpu.c | 29 +++++++--------- base/sources/iron.h | 4 +-- base/sources/iron_armpack.c | 8 ++--- base/sources/iron_array.c | 2 +- base/sources/iron_array.h | 2 +- base/sources/iron_gc.c | 4 +-- base/sources/iron_gc.h | 3 +- base/sources/iron_string.c | 11 +++---- base/sources/iron_ui.c | 6 ++-- base/sources/iron_ui_nodes.c | 10 +++--- base/sources/libs/gc.c | 2 +- base/sources/libs/gc.h | 2 +- base/sources/libs/lz4x.h | 4 +-- base/sources/libs/minimp4.h | 8 ++--- base/sources/libs/sinfl.h | 4 +-- base/sources/ts/shader_data.ts | 1 - base/sources/ts/sys.ts | 6 ++-- base/tests/cube/sources/main.ts | 2 +- base/tests/fall/sources/main.ts | 2 +- base/tests/triangle/main.ts | 2 +- base/tools/make.js | 2 +- base/tools/pad/sources/main.ts | 2 +- paint/plugins/io_exr/io_exr.c | 6 ++-- paint/plugins/io_fbx/ufbx/ufbx.c | 4 +-- paint/plugins/io_usd/tinyusdz/tinyusdz.cc | 40 +++++++++++------------ paint/sources/base.ts | 7 ++-- paint/sources/config.ts | 2 +- paint/sources/make_sculpt.ts | 1 - paint/sources/tab_browser.ts | 1 - paint/sources/ui_header.ts | 1 - paint/sources/ui_nodes.ts | 5 --- 31 files changed, 83 insertions(+), 100 deletions(-) diff --git a/base/sources/backends/direct3d12_gpu.c b/base/sources/backends/direct3d12_gpu.c index 7fe4464e..62293926 100644 --- a/base/sources/backends/direct3d12_gpu.c +++ b/base/sources/backends/direct3d12_gpu.c @@ -750,7 +750,6 @@ void gpu_pipeline_compile(gpu_pipeline_t *pipe) { .PS.pShaderBytecode = pipe->fragment_shader->impl.data, .pRootSignature = root_signature, .NumRenderTargets = pipe->color_attachment_count, - .DSVFormat = DXGI_FORMAT_UNKNOWN, .InputLayout.NumElements = vertex_attribute_count, .InputLayout.pInputElementDescs = vertex_desc, .RasterizerState.FillMode = D3D12_FILL_MODE_SOLID, @@ -766,16 +765,12 @@ void gpu_pipeline_compile(gpu_pipeline_t *pipe) { .RasterizerState.ConservativeRaster = D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF, .BlendState.AlphaToCoverageEnable = FALSE, .BlendState.IndependentBlendEnable = FALSE, - .DepthStencilState.DepthEnable = TRUE, - .DepthStencilState.DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL, - .DepthStencilState.DepthFunc = D3D12_COMPARISON_FUNC_LESS, .DepthStencilState.StencilEnable = FALSE, .DepthStencilState.StencilReadMask = D3D12_DEFAULT_STENCIL_READ_MASK, .DepthStencilState.StencilWriteMask = D3D12_DEFAULT_STENCIL_WRITE_MASK, .DepthStencilState.DepthEnable = pipe->depth_mode != GPU_COMPARE_MODE_ALWAYS, .DepthStencilState.DepthWriteMask = pipe->depth_write ? D3D12_DEPTH_WRITE_MASK_ALL : D3D12_DEPTH_WRITE_MASK_ZERO, .DepthStencilState.DepthFunc = convert_compare_mode(pipe->depth_mode), - .DepthStencilState.StencilEnable = false, .DSVFormat = DXGI_FORMAT_D32_FLOAT, .SampleDesc.Count = 1, .SampleMask = 0xFFFFFFFF, @@ -1190,18 +1185,18 @@ void gpu_raytrace_pipeline_init(gpu_raytrace_pipeline_t *pipeline, void *ray_sha {D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1, 8, 0, D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND}, {D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1, 9, 0, D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND}}; - D3D12_ROOT_PARAMETER root_parameters[12] = {{D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {1, &ranges[0]}, D3D12_SHADER_VISIBILITY_ALL}, - {D3D12_ROOT_PARAMETER_TYPE_SRV, {0}, D3D12_SHADER_VISIBILITY_ALL}, - {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {1, &ranges[1]}, D3D12_SHADER_VISIBILITY_ALL}, - {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {1, &ranges[2]}, D3D12_SHADER_VISIBILITY_ALL}, - {D3D12_ROOT_PARAMETER_TYPE_CBV, {0}, D3D12_SHADER_VISIBILITY_ALL}, - {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {1, &ranges[3]}, D3D12_SHADER_VISIBILITY_ALL}, - {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {1, &ranges[4]}, D3D12_SHADER_VISIBILITY_ALL}, - {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {1, &ranges[5]}, D3D12_SHADER_VISIBILITY_ALL}, - {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {1, &ranges[6]}, D3D12_SHADER_VISIBILITY_ALL}, - {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {1, &ranges[7]}, D3D12_SHADER_VISIBILITY_ALL}, - {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {1, &ranges[8]}, D3D12_SHADER_VISIBILITY_ALL}, - {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {1, &ranges[9]}, D3D12_SHADER_VISIBILITY_ALL}}; + D3D12_ROOT_PARAMETER root_parameters[12] = {{D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {{1, &ranges[0]}}, D3D12_SHADER_VISIBILITY_ALL}, + {D3D12_ROOT_PARAMETER_TYPE_SRV, {{0}}, D3D12_SHADER_VISIBILITY_ALL}, + {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {{1, &ranges[1]}}, D3D12_SHADER_VISIBILITY_ALL}, + {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {{1, &ranges[2]}}, D3D12_SHADER_VISIBILITY_ALL}, + {D3D12_ROOT_PARAMETER_TYPE_CBV, {{0}}, D3D12_SHADER_VISIBILITY_ALL}, + {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {{1, &ranges[3]}}, D3D12_SHADER_VISIBILITY_ALL}, + {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {{1, &ranges[4]}}, D3D12_SHADER_VISIBILITY_ALL}, + {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {{1, &ranges[5]}}, D3D12_SHADER_VISIBILITY_ALL}, + {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {{1, &ranges[6]}}, D3D12_SHADER_VISIBILITY_ALL}, + {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {{1, &ranges[7]}}, D3D12_SHADER_VISIBILITY_ALL}, + {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {{1, &ranges[8]}}, D3D12_SHADER_VISIBILITY_ALL}, + {D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, {{1, &ranges[9]}}, D3D12_SHADER_VISIBILITY_ALL}}; D3D12_STATIC_SAMPLER_DESC linear_sampler = { .Filter = D3D12_FILTER_MIN_MAG_MIP_LINEAR, diff --git a/base/sources/iron.h b/base/sources/iron.h index 786643a0..488ee13f 100644 --- a/base/sources/iron.h +++ b/base/sources/iron.h @@ -1143,7 +1143,7 @@ gpu_texture_t *gpu_create_texture_from_encoded_bytes(buffer_t *data, string_t *f LZ4_decompress_safe((char *)data->buffer + 12, (char *)texture_data, compressed_size, output_size); texture_format = GPU_TEXTURE_FORMAT_RGBA32; } - else if (strcmp(fourcc, "LZ4F") == 0) { + else { // "LZ4F" int output_size = width * height * 16; texture_data = (unsigned char *)malloc(output_size); LZ4_decompress_safe((char *)data->buffer + 12, (char *)texture_data, compressed_size, output_size); @@ -1696,7 +1696,7 @@ static H264E_persist_t *iron_mp4_enc = NULL; static H264E_scratch_t *iron_mp4_scratch = NULL; static char iron_mp4_path[512]; static char iron_mp4_path_264[512]; -static char *iron_mp4_yuv_buf; +static uint8_t *iron_mp4_yuv_buf; static size_t iron_mp4_get_nal_size(uint8_t *buf, size_t size) { size_t pos = 3; diff --git a/base/sources/iron_armpack.c b/base/sources/iron_armpack.c index 28dfa038..18487723 100644 --- a/base/sources/iron_armpack.c +++ b/base/sources/iron_armpack.c @@ -26,11 +26,11 @@ static void store_u8(uint8_t u8) { di += 1; } -static void store_i16(int16_t i16) { +/*static void store_i16(int16_t i16) { di += pad(di, 2); *(int16_t *)(decoded + di) = i16; di += 2; -} +}*/ static void store_u32(uint32_t u32) { di += pad(di, 4); @@ -345,7 +345,7 @@ static void read_store_array(uint32_t count) { // Store in any/i32/../_array_t f array_count = count; for (uint32_t i = 0; i < count; ++i) { - uint8_t flag = read_u8(); + /*uint8_t flag =*/ read_u8(); read_store_array(read_i32()); } } @@ -366,7 +366,7 @@ static void read_store_array(uint32_t count) { // Store in any/i32/../_array_t f for (uint32_t i = 0; i < count; ++i) { di = pad(di, PTR_SIZE) + di; - uint8_t flag = read_u8(); + /*uint8_t flag =*/ read_u8(); read_store_map(read_i32()); } } diff --git a/base/sources/iron_array.c b/base/sources/iron_array.c index 2edbbf9f..92b14dbb 100644 --- a/base/sources/iron_array.c +++ b/base/sources/iron_array.c @@ -378,7 +378,7 @@ buffer_t *buffer_create(uint32_t length) { return b; } -buffer_t *buffer_create_from_raw(char *raw, uint32_t length) { +buffer_t *buffer_create_from_raw(uint8_t *raw, uint32_t length) { buffer_t *b = gc_alloc(sizeof(buffer_t)); b->buffer = raw; b->length = length; diff --git a/base/sources/iron_array.h b/base/sources/iron_array.h index 2f413451..43e03d03 100644 --- a/base/sources/iron_array.h +++ b/base/sources/iron_array.h @@ -117,7 +117,7 @@ void buffer_set_i32(buffer_t *b, uint32_t p, int32_t n); void buffer_set_f32(buffer_t *b, uint32_t p, float n); buffer_t *buffer_create(uint32_t length); -buffer_t *buffer_create_from_raw(char *raw, uint32_t length); +buffer_t *buffer_create_from_raw(uint8_t *raw, uint32_t length); f32_array_t *f32_array_create(uint32_t length); f32_array_t *f32_array_create_from_buffer(buffer_t *b); f32_array_t *f32_array_create_from_array(f32_array_t *from); diff --git a/base/sources/iron_gc.c b/base/sources/iron_gc.c index f20f06e3..c19d539d 100644 --- a/base/sources/iron_gc.c +++ b/base/sources/iron_gc.c @@ -31,7 +31,7 @@ void *gc_alloc(size_t size) { #endif } -void gc_array(void *ptr, int *length) {} +void gc_array(void *ptr, uint32_t *length) {} void gc_leaf(void *ptr) {} @@ -84,7 +84,7 @@ void *gc_alloc(size_t size) { return _gc_calloc(size, sizeof(uint8_t)); } -void gc_array(void *ptr, int *length) { +void gc_array(void *ptr, uint32_t *length) { _gc_array(ptr, length); } diff --git a/base/sources/iron_gc.h b/base/sources/iron_gc.h index 15ebfa7a..bf704949 100644 --- a/base/sources/iron_gc.h +++ b/base/sources/iron_gc.h @@ -1,12 +1,13 @@ #pragma once #include +#include // point_t *p = GC_ALLOC_INIT(point_t, {x: 1.5, y: 3.5}); #define GC_ALLOC_INIT(type, ...) (type *)memcpy(gc_alloc(sizeof(type)), (type[]){__VA_ARGS__}, sizeof(type)) void *gc_alloc(size_t size); -void gc_array(void *ptr, int *length); +void gc_array(void *ptr, uint32_t *length); void gc_leaf(void *ptr); void gc_root(void *ptr); void gc_unroot(void *ptr); diff --git a/base/sources/iron_string.c b/base/sources/iron_string.c index a0c98273..cc25fc4d 100644 --- a/base/sources/iron_string.c +++ b/base/sources/iron_string.c @@ -56,16 +56,16 @@ char *i32_to_string_hex(int32_t i) { } char *i64_to_string(int64_t i) { - int l = snprintf(NULL, 0, "%ld", i); + int l = snprintf(NULL, 0, "%lld", i); char *r = string_alloc(l + 1); - sprintf(r, "%ld", i); + sprintf(r, "%lld", i); return r; } char *u64_to_string(uint64_t i) { - int l = snprintf(NULL, 0, "%lu", i); + int l = snprintf(NULL, 0, "%llu", i); char *r = string_alloc(l + 1); - sprintf(r, "%lu", i); + sprintf(r, "%llu", i); return r; } @@ -254,9 +254,8 @@ int string_utf8_decode(const char *str, int *i) { if (is_unicode(u)) { int a = (u & 0x20) ? ((u & 0x10) ? ((u & 0x08) ? ((u & 0x04) ? 6 : 5) : 4) : 3) : 2; if (a < 6 || !(u & 0x02)) { - int b, p = 0; u = ((u << (a + 1)) & 0xff) >> (a + 1); - for (b = 1; b < a; ++b) + for (int b = 1; b < a; ++b) u = (u << 6) | (s[l++] & 0x3f); } } diff --git a/base/sources/iron_ui.c b/base/sources/iron_ui.c index cf0240e5..b8cd5bb5 100644 --- a/base/sources/iron_ui.c +++ b/base/sources/iron_ui.c @@ -19,8 +19,6 @@ static bool ui_dynamic_glyph_load = true; // Allow text input fields to static float ui_key_repeat_time = 0.0; static char ui_text_to_paste[1024]; static char ui_text_to_copy[1024]; -static ui_t *ui_copy_receiver = NULL; -static int ui_copy_frame = 0; static bool ui_combo_first = true; static ui_handle_t *ui_combo_search_handle = NULL; static int touch_hold_x = -1; @@ -1848,7 +1846,7 @@ int ui_text(char *text, int align, int bg) { bool started = ui_get_started(h); bool down = ui_get_pushed(h); bool released = ui_get_released(h); - bool hover = ui_get_hover(h); + /*bool hover =*/ ui_get_hover(h); if (bg != 0x0000000) { draw_set_color(bg); draw_filled_rect(current->_x + current->button_offset_y, current->_y + current->button_offset_y, current->_w - current->button_offset_y * 2, @@ -3193,7 +3191,7 @@ char *ui_text_area(ui_handle_t *handle, int align, bool editable, char *label, b } else { // Multi-line selection highlight - if (text_area_selection_start > -1 && (i >= text_area_selection_start && i < handle->i) || (i <= text_area_selection_start && i > handle->i)) { + if (text_area_selection_start > -1 && ((i >= text_area_selection_start && i < handle->i) || (i <= text_area_selection_start && i > handle->i))) { int line_height = UI_ELEMENT_H(); int cursor_height = line_height - current->button_offset_y * 3.0; int linew = draw_string_width(current->ops->font, current->font_size, line); diff --git a/base/sources/iron_ui_nodes.c b/base/sources/iron_ui_nodes.c index 6a22d399..ba39f231 100644 --- a/base/sources/iron_ui_nodes.c +++ b/base/sources/iron_ui_nodes.c @@ -410,7 +410,7 @@ void ui_node_draw_body(ui_node_t *node, ui_node_canvas_t *canvas, float nx, floa float wx = current->_window_x; float wy = current->_window_y; float w = UI_NODE_W(node); - float h = UI_NODE_H(canvas, node); + // float h = UI_NODE_H(canvas, node); float lineh = UI_LINE_H(); // Outputs @@ -515,7 +515,7 @@ void ui_node_draw_body(ui_node_t *node, ui_node_canvas_t *canvas, float nx, floa ui_node_socket_t *soc = but->output >= 0 ? node->outputs->buffer[but->output] : NULL; ui_handle_t *h = ui_nest(nhandle, buti); if (h->init) { - h->text = soc != NULL ? soc->default_value->buffer : but->default_value->buffer != NULL ? but->default_value->buffer : ""; + h->text = soc != NULL ? (char *)soc->default_value->buffer : but->default_value->buffer != NULL ? (char *)but->default_value->buffer : ""; } but->default_value->buffer = ui_text_input(h, ui_tr(but->name), UI_ALIGN_LEFT, true, false); but->default_value->length = strlen(but->default_value->buffer) + 1; @@ -805,7 +805,7 @@ void ui_node_draw(ui_node_t *node, ui_node_canvas_t *canvas) { // Title draw_set_color(current->ops->theme->TEXT_COL); - float textw = draw_string_width(current->ops->font, current->font_size, text); + // float textw = draw_string_width(current->ops->font, current->font_size, text); draw_string(text, nx + ui_p(20), ny + ui_p(6)); ny += lineh * 0.5; @@ -1286,7 +1286,7 @@ void ui_node_canvas(ui_nodes_t *nodes, ui_node_canvas_t *canvas) { ui_node_button_t *but = paste_canvas->nodes->buffer[i]->buttons->buffer[j]; if (but->data != NULL) { char *s = string_replace_all(but->data, "\\n", "\n"); - but->data = u8_array_create_from_raw(s, strlen(s) + 1); + but->data = u8_array_create_from_raw((uint8_t *)s, strlen(s) + 1); } } } @@ -1692,7 +1692,7 @@ char *ui_node_canvas_to_json(ui_node_canvas_t *canvas) { json_encode_f32_array("default_value", canvas->nodes->buffer[i]->buttons->buffer[j]->default_value); u8_array_t *data = canvas->nodes->buffer[i]->buttons->buffer[j]->data; if (data != NULL) { - char *s = string_replace_all(data->buffer, "\n", "\\n"); + char *s = string_replace_all((char *)data->buffer, "\n", "\\n"); json_encode_string("data", s); } else { diff --git a/base/sources/libs/gc.c b/base/sources/libs/gc.c index b8761579..5deed9d0 100644 --- a/base/sources/libs/gc.c +++ b/base/sources/libs/gc.c @@ -277,7 +277,7 @@ static void *gc_allocate(size_t count, size_t size) { return ptr; } -void _gc_array(void *ptr, int *length) { +void _gc_array(void *ptr, uint32_t *length) { gc_allocation_t *alloc = gc_allocation_map_get(gc->allocs, ptr); if (alloc) { // alloc->array_length = length; diff --git a/base/sources/libs/gc.h b/base/sources/libs/gc.h index a924a5bd..1aa08daf 100644 --- a/base/sources/libs/gc.h +++ b/base/sources/libs/gc.h @@ -12,7 +12,7 @@ void _gc_pause(); void _gc_resume(); size_t _gc_run(); void *_gc_calloc(size_t count, size_t size); -void _gc_array(void *ptr, int *length); +void _gc_array(void *ptr, uint32_t *length); void _gc_leaf(void *ptr); void _gc_root(void *ptr); void _gc_unroot(void *ptr); diff --git a/base/sources/libs/lz4x.h b/base/sources/libs/lz4x.h index 23dbd5d8..a31677a2 100644 --- a/base/sources/libs/lz4x.h +++ b/base/sources/libs/lz4x.h @@ -158,8 +158,8 @@ size_t LZ4_compress(const char *source, int sourceSize, char *dest, const int ma while (p < pp) { const U32 h = HASH_32(p); tail[p & WINDOW_MASK] = head[h]; - size_t read_offset = 0; - size_t write_offset = 0; + // size_t read_offset = 0; + // size_t write_offset = 0; head[h] = p++; } } diff --git a/base/sources/libs/minimp4.h b/base/sources/libs/minimp4.h index d31e7831..141d2286 100644 --- a/base/sources/libs/minimp4.h +++ b/base/sources/libs/minimp4.h @@ -859,7 +859,7 @@ int MP4E_add_track(MP4E_mux_t *mux, const MP4E_track_t *track_data) return ntr; } -static const unsigned char *next_dsi(const unsigned char *p, const unsigned char *end, int *bytes) +/*static const unsigned char *next_dsi(const unsigned char *p, const unsigned char *end, int *bytes) { if (p < end + 2) { @@ -867,7 +867,7 @@ static const unsigned char *next_dsi(const unsigned char *p, const unsigned char return p + 2; } else return NULL; -} +}*/ static int append_mem(minimp4_vector_t *v, const void *mem, int bytes) { @@ -1000,11 +1000,11 @@ static int mp4e_write_fragment_header(MP4E_mux_t *mux, int track_num, int data_b unsigned char **stack = stack_base; unsigned char *pdata_offset; unsigned flags; - enum + /*enum { default_sample_duration_present = 0x000008, default_sample_flags_present = 0x000020, - } e; + } e;*/ track_t *tr = ((track_t*)mux->tracks.data) + track_num; diff --git a/base/sources/libs/sinfl.h b/base/sources/libs/sinfl.h index 3f60e887..12517f23 100644 --- a/base/sources/libs/sinfl.h +++ b/base/sources/libs/sinfl.h @@ -195,11 +195,11 @@ sinfl_copy64(unsigned char **dst, unsigned char **src) { memcpy(*dst, &n, 8); *dst += 8, *src += 8; } -static unsigned char* +/*static unsigned char* sinfl_write64(unsigned char *dst, unsigned long long w) { memcpy(dst, &w, 8); return dst + 8; -} +}*/ #ifndef SINFL_NO_SIMD static unsigned char* sinfl_write128(unsigned char *dst, sinfl_char16 w) { diff --git a/base/sources/ts/shader_data.ts b/base/sources/ts/shader_data.ts index ef242cae..be5bc819 100644 --- a/base/sources/ts/shader_data.ts +++ b/base/sources/ts/shader_data.ts @@ -238,7 +238,6 @@ function shader_context_finish_compile(raw: shader_context_t) { } if (raw.texture_units != null) { for (let i: i32 = 0; i < raw.texture_units.length; ++i) { - let tu: tex_unit_t = raw.texture_units[i]; shader_context_add_tex(raw, i); } } diff --git a/base/sources/ts/sys.ts b/base/sources/ts/sys.ts index c7c50349..ca357d19 100644 --- a/base/sources/ts/sys.ts +++ b/base/sources/ts/sys.ts @@ -30,7 +30,7 @@ declare type iron_window_options_t = { width?: i32; height?: i32; features?: window_features_t; - mode?: window_mode_t; + mode?: iron_window_mode_t; frequency?: i32; vsync?: bool; display_index?: i32; @@ -325,8 +325,8 @@ enum window_features_t { MAXIMIZABLE = 4, } -enum window_mode_t { - WINDOWED, +declare enum iron_window_mode_t { + WINDOW, FULLSCREEN, } diff --git a/base/tests/cube/sources/main.ts b/base/tests/cube/sources/main.ts index afaff93c..111ae56b 100644 --- a/base/tests/cube/sources/main.ts +++ b/base/tests/cube/sources/main.ts @@ -8,7 +8,7 @@ function main() { x : -1, y : -1, features : window_features_t.RESIZABLE | window_features_t.MINIMIZABLE | window_features_t.MAXIMIZABLE, - mode : window_mode_t.WINDOWED, + mode : iron_window_mode_t.WINDOW, frequency : 60, vsync : true, depth_bits : 32 diff --git a/base/tests/fall/sources/main.ts b/base/tests/fall/sources/main.ts index 74ebb448..3a145187 100644 --- a/base/tests/fall/sources/main.ts +++ b/base/tests/fall/sources/main.ts @@ -12,7 +12,7 @@ function main() { x : -1, y : -1, features : window_features_t.RESIZABLE | window_features_t.MINIMIZABLE | window_features_t.MAXIMIZABLE, - mode : window_mode_t.WINDOWED, + mode : iron_window_mode_t.WINDOW, frequency : 60, vsync : true, depth_bits : 32 diff --git a/base/tests/triangle/main.ts b/base/tests/triangle/main.ts index dfdb6d19..fc50cf9c 100644 --- a/base/tests/triangle/main.ts +++ b/base/tests/triangle/main.ts @@ -22,7 +22,7 @@ function main() { height : 480, x : -1, y : -1, - mode : window_mode_t.WINDOWED, + mode : iron_window_mode_t.WINDOW, features : window_features_t.RESIZABLE | window_features_t.MINIMIZABLE | window_features_t.MAXIMIZABLE, vsync : true, frequency : 60, diff --git a/base/tools/make.js b/base/tools/make.js index c590776f..779d9302 100644 --- a/base/tools/make.js +++ b/base/tools/make.js @@ -689,7 +689,7 @@ class VisualStudioExporter extends Exporter { this.p('', indent + 1); this.p('' + includes + '', indent + 2); - this.p('-Wno-deprecated-declarations -Wno-incompatible-pointer-types -Wno-incompatible-function-pointer-types -Wno-microsoft-enum-forward-reference /bigobj %(AdditionalOptions)', indent + 2); + this.p('-Wno-deprecated-declarations -Wno-c23-extensions -Wno-incompatible-pointer-types -Wno-incompatible-function-pointer-types -Wno-microsoft-enum-forward-reference /bigobj %(AdditionalOptions)', indent + 2); this.p('Level3', indent + 2); this.p('' + this.get_optimization(config) + '', indent + 2); diff --git a/base/tools/pad/sources/main.ts b/base/tools/pad/sources/main.ts index 63b82136..32c53ba1 100644 --- a/base/tools/pad/sources/main.ts +++ b/base/tools/pad/sources/main.ts @@ -83,7 +83,7 @@ function main() { width : storage.window_w, height : storage.window_h, features : window_features_t.RESIZABLE | window_features_t.MAXIMIZABLE | window_features_t.MINIMIZABLE, - mode : window_mode_t.WINDOWED, + mode : iron_window_mode_t.WINDOW, frequency : 60, vsync : true, display_index : 0, diff --git a/paint/plugins/io_exr/io_exr.c b/paint/plugins/io_exr/io_exr.c index 49550a4d..9b13dae0 100644 --- a/paint/plugins/io_exr/io_exr.c +++ b/paint/plugins/io_exr/io_exr.c @@ -73,12 +73,12 @@ void *io_exr_parse(uint8_t *buf, size_t buf_size) { int32_t chpixel_type = *(int32_t *)(buf + chpos); chpos += 4; - uint8_t pLinear = buf[chpos]; + // uint8_t pLinear = buf[chpos]; chpos += 1; // 1 byte chpos += 3; // Skip reserved (3 bytes) - int32_t xSampling = *(int32_t *)(buf + chpos); + // int32_t xSampling = *(int32_t *)(buf + chpos); chpos += 4; - int32_t ySampling = *(int32_t *)(buf + chpos); + // int32_t ySampling = *(int32_t *)(buf + chpos); chpos += 4; strcpy(channels[num_channels].name, chname); diff --git a/paint/plugins/io_fbx/ufbx/ufbx.c b/paint/plugins/io_fbx/ufbx/ufbx.c index e0be9698..d2976820 100644 --- a/paint/plugins/io_fbx/ufbx/ufbx.c +++ b/paint/plugins/io_fbx/ufbx/ufbx.c @@ -6055,14 +6055,14 @@ ufbxi_nodiscard static ufbxi_noinline int ufbxi_report_progress(ufbxi_context *u } // TODO: Remove `ufbxi_unused` when it's not needed anymore -ufbxi_unused ufbxi_nodiscard static ufbxi_forceinline int ufbxi_progress(ufbxi_context *uc, size_t work_units) +/*ufbxi_unused ufbxi_nodiscard static ufbxi_forceinline int ufbxi_progress(ufbxi_context *uc, size_t work_units) { if (!uc->opts.progress_cb.fn) return 1; ptrdiff_t left = uc->progress_timer - (ptrdiff_t)work_units; uc->progress_timer = left; if (left > 0) return 1; return ufbxi_report_progress(uc); -} +}*/ // -- IO diff --git a/paint/plugins/io_usd/tinyusdz/tinyusdz.cc b/paint/plugins/io_usd/tinyusdz/tinyusdz.cc index b6f35c28..3de152c5 100644 --- a/paint/plugins/io_usd/tinyusdz/tinyusdz.cc +++ b/paint/plugins/io_usd/tinyusdz/tinyusdz.cc @@ -3354,23 +3354,23 @@ bool Parser::_BuildLiveFieldSets() { std::cout << "# of live fieldsets = " << _live_fieldsets.size() << "\n"; #endif - size_t sum = 0; - for (const auto &item : _live_fieldsets) { -#if TINYUSDZ_LOCAL_DEBUG_PRINT - std::cout << "livefieldsets[" << item.first.value - << "].count = " << item.second.size() << "\n"; -#endif - sum += item.second.size(); + //size_t sum = 0; + //for (const auto &item : _live_fieldsets) { +//#if TINYUSDZ_LOCAL_DEBUG_PRINT +// std::cout << "livefieldsets[" << item.first.value +// << "].count = " << item.second.size() << "\n"; +//#endif + //sum += item.second.size(); -#if TINYUSDZ_LOCAL_DEBUG_PRINT - for (size_t i = 0; i < item.second.size(); i++) { - std::cout << " [" << i << "] name = " << item.second[i].first << "\n"; - } -#endif - } -#if TINYUSDZ_LOCAL_DEBUG_PRINT - std::cout << "Total fields used = " << sum << "\n"; -#endif +//#if TINYUSDZ_LOCAL_DEBUG_PRINT +// for (size_t i = 0; i < item.second.size(); i++) { +// std::cout << " [" << i << "] name = " << item.second[i].first << "\n"; +// } +//#endif +// } +//#if TINYUSDZ_LOCAL_DEBUG_PRINT +// std::cout << "Total fields used = " << sum << "\n"; +//#endif return true; } @@ -3626,7 +3626,7 @@ bool Parser::_ReconstructGeomMesh( const std::unordered_map &path_index_to_spec_index_map, GeomMesh *mesh) { - bool has_position{false}; + //bool has_position{false}; for (const auto &fv : fields) { if (fv.first == "properties") { @@ -3637,7 +3637,7 @@ bool Parser::_ReconstructGeomMesh( assert(fv.second.IsArray()); for (size_t i = 0; i < fv.second.GetStringArray().size(); i++) { if (fv.second.GetStringArray()[i] == "points") { - has_position = true; + //has_position = true; } } } @@ -4373,12 +4373,12 @@ bool Parser::_ReconstructSceneRecursively( // Check if TokenArray contains known child nodes const auto &tokens = fv.second.GetStringArray(); - bool valid = true; + //bool valid = true; for (const auto &token : tokens) { if (!node.GetPrimChildren().count(token)) { _err += "primChild '" + token + "' not found in node '" + node.GetPath().full_path_name() + "'\n"; - valid = false; + //valid = false; break; } } diff --git a/paint/sources/base.ts b/paint/sources/base.ts index cf07a714..615f9299 100644 --- a/paint/sources/base.ts +++ b/paint/sources/base.ts @@ -655,15 +655,15 @@ function base_get_asset_index(file_name: string): i32 { } function base_toggle_fullscreen() { - if (iron_window_get_mode() == window_mode_t.WINDOWED) { + if (iron_window_get_mode() == iron_window_mode_t.WINDOW) { config_raw.window_w = iron_window_width(); config_raw.window_h = iron_window_height(); config_raw.window_x = iron_window_x(); config_raw.window_y = iron_window_y(); - iron_window_change_mode(window_mode_t.FULLSCREEN); + iron_window_change_mode(iron_window_mode_t.FULLSCREEN); } else { - iron_window_change_mode(window_mode_t.WINDOWED); + iron_window_change_mode(iron_window_mode_t.WINDOW); iron_window_resize(config_raw.window_w, config_raw.window_h); iron_window_move(config_raw.window_x, config_raw.window_y); } @@ -1481,7 +1481,6 @@ function ui_base_update_ui() { context_raw.tool == tool_type_t.CLONE && operator_shortcut(map_get(config_keymap, "set_clone_source") + "+" + map_get(config_keymap, "action_paint"), shortcut_type_t.DOWN); - let decal: bool = context_is_decal(); let decal_mask: bool = context_is_decal_mask_paint(); let down: bool = operator_shortcut(map_get(config_keymap, "action_paint"), shortcut_type_t.DOWN) || decal_mask || set_clone_source || diff --git a/paint/sources/config.ts b/paint/sources/config.ts index 8e6ac972..2c4610d1 100644 --- a/paint/sources/config.ts +++ b/paint/sources/config.ts @@ -244,7 +244,7 @@ function config_get_date(): string { } function config_get_options(): iron_window_options_t { - let window_mode: window_mode_t = config_raw.window_mode == 0 ? window_mode_t.WINDOWED : window_mode_t.FULLSCREEN; + let window_mode: iron_window_mode_t = config_raw.window_mode == 0 ? iron_window_mode_t.WINDOW : iron_window_mode_t.FULLSCREEN; let features: window_features_t = window_features_t.NONE; if (config_raw.window_resizable) { features |= window_features_t.RESIZABLE; diff --git a/paint/sources/make_sculpt.ts b/paint/sources/make_sculpt.ts index a30fac46..3cf061fb 100644 --- a/paint/sources/make_sculpt.ts +++ b/paint/sources/make_sculpt.ts @@ -233,7 +233,6 @@ function sculpt_layers_create_sculpt_layer() { render_path_load_shader("Scene/copy_pass/copyR32_pass"); for (let i: i32 = 0; i < history_undo_layers.length; ++i) { - let len: i32 = history_undo_layers.length; let ext: string = "_undo" + i; let l: slot_layer_t = history_undo_layers[i]; diff --git a/paint/sources/tab_browser.ts b/paint/sources/tab_browser.ts index 5faef01a..05e38389 100644 --- a/paint/sources/tab_browser.ts +++ b/paint/sources/tab_browser.ts @@ -132,7 +132,6 @@ function tab_browser_draw(htab: ui_handle_t) { } ui_files_file_browser(tab_browser_hpath, true, tab_browser_hsearch.text, tab_browser_refresh, function(file: string) { - let file_name: string = substring(file, string_last_index_of(file, path_sep) + 1, file.length); _tab_browser_draw_file = file; // Context menu diff --git a/paint/sources/ui_header.ts b/paint/sources/ui_header.ts index d348eb67..a2b5acd2 100644 --- a/paint/sources/ui_header.ts +++ b/paint/sources/ui_header.ts @@ -342,7 +342,6 @@ function ui_header_draw_tool_properties() { context_raw.tool == tool_type_t.DECAL || context_raw.tool == tool_type_t.TEXT || context_raw.tool == tool_type_t.CLONE || context_raw.tool == tool_type_t.BLUR || context_raw.tool == tool_type_t.SMUDGE || context_raw.tool == tool_type_t.PARTICLE) { - let decal: bool = context_is_decal(); let decal_mask: bool = context_is_decal_mask(); if (context_raw.tool != tool_type_t.FILL) { if (decal_mask) { diff --git a/paint/sources/ui_nodes.ts b/paint/sources/ui_nodes.ts index 8c2fb678..f5a9ace3 100644 --- a/paint/sources/ui_nodes.ts +++ b/paint/sources/ui_nodes.ts @@ -1037,13 +1037,8 @@ function ui_nodes_render() { if (ui_nodes_show_menu) { let list: node_list_t[] = ui_nodes_canvas_type == canvas_type_t.MATERIAL ? nodes_material_list : nodes_brush_list; let category: ui_node_t[] = list[ui_nodes_menu_category]; - let num_nodes: i32 = category.length; let is_group_category: bool = ui_nodes_canvas_type == canvas_type_t.MATERIAL && nodes_material_categories[ui_nodes_menu_category] == "Group"; - if (is_group_category) { - num_nodes += project_material_groups.length; - } - let py: i32 = ui_nodes_popup_y; let menuw: i32 = math_floor(ew * 2.3); draw_begin(null);