From 9f0d99ed1a5624923d56553f45e7914faf150ff3 Mon Sep 17 00:00:00 2001 From: themanyone Date: Thu, 18 Sep 2025 01:02:10 -0800 Subject: [PATCH 01/16] =?UTF-8?q?avrdude/avr.c:86:5:=20fix=20warning:=20th?= =?UTF-8?q?is=20=E2=80=98while=E2=80=99=20clause=20does=20not=20guard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundled_deps/avrdude/avrdude/avr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundled_deps/avrdude/avrdude/avr.c b/bundled_deps/avrdude/avrdude/avr.c index defae75d50c..3cf471d1430 100644 --- a/bundled_deps/avrdude/avrdude/avr.c +++ b/bundled_deps/avrdude/avrdude/avr.c @@ -83,7 +83,8 @@ int avr_tpi_chip_erase(PROGRAMMER * pgm, AVRPART * p) 0xFF }; - while (avr_tpi_poll_nvmbsy(pgm)); + while (avr_tpi_poll_nvmbsy(pgm)) + ; err = pgm->cmd_tpi(pgm, cmd, sizeof(cmd), NULL, 0); if(err) From b63faecb9e919c80c5258b4cdfbdca9584a7ea05 Mon Sep 17 00:00:00 2001 From: themanyone Date: Thu, 18 Sep 2025 01:35:49 -0800 Subject: [PATCH 02/16] =?UTF-8?q?/buspirate.c:572:40:=20fix=20warning:=20d?= =?UTF-8?q?angling=20pointer=20=E2=80=98submode=E2=80=99=20to=20an=20unnam?= =?UTF-8?q?ed=20temporary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundled_deps/avrdude/avrdude/buspirate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bundled_deps/avrdude/avrdude/buspirate.c b/bundled_deps/avrdude/avrdude/buspirate.c index dc8c68fbebd..29b606f859d 100644 --- a/bundled_deps/avrdude/avrdude/buspirate.c +++ b/bundled_deps/avrdude/avrdude/buspirate.c @@ -568,8 +568,7 @@ static int buspirate_start_mode_bin(struct programmer_t *pgm) memset(buf, 0, sizeof(buf)); buspirate_recv_bin(pgm, buf, 4); if (sscanf((const char*)buf, submode->entered_format, &PDATA(pgm)->submode_version) != 1) { - avrdude_message(MSG_INFO, "%s mode not confirmed: '%s'\n", - submode->name, buf); + avrdude_message(MSG_INFO, "BusPirate submode not confirmed: '%s'\n", buf); buspirate_reset_from_binmode(pgm); return -1; } From 1d423f90a0517305b036a7f0d1d09542fbc77ae6 Mon Sep 17 00:00:00 2001 From: themanyone Date: Thu, 18 Sep 2025 01:42:27 -0800 Subject: [PATCH 03/16] clipper.cpp: fix warn: use assignment instead of clearing. --- src/clipper/clipper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clipper/clipper.cpp b/src/clipper/clipper.cpp index 4da58dc26b2..35fd33ed842 100644 --- a/src/clipper/clipper.cpp +++ b/src/clipper/clipper.cpp @@ -428,7 +428,7 @@ void ReversePolyPtLinks(OutPt *pp) inline void InitEdge(TEdge* e, TEdge* eNext, TEdge* ePrev, const IntPoint& Pt) { - std::memset(e, 0, sizeof(TEdge)); + *e = TEdge(); e->Next = eNext; e->Prev = ePrev; e->Curr = Pt; From b1001c006b4e49c29e6936f9eaed3f6a36245069 Mon Sep 17 00:00:00 2001 From: themanyone Date: Thu, 18 Sep 2025 01:43:53 -0800 Subject: [PATCH 04/16] clipper.cpp:789:30: fix warning: comparison of integer expressions of different signedness --- src/clipper/clipper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clipper/clipper.cpp b/src/clipper/clipper.cpp index 35fd33ed842..1e3213f74a4 100644 --- a/src/clipper/clipper.cpp +++ b/src/clipper/clipper.cpp @@ -786,7 +786,7 @@ bool ClipperBase::AddPathInternal(const Path &pg, int highI, PolyType PolyTyp, b throw clipperException("AddPath: Open paths have been disabled."); #endif - assert(highI >= 0 && highI < pg.size()); + assert(highI >= 0 && static_cast(highI) < pg.size()); //1. Basic (first) edge initialization ... try From 664617e2a77e532f5898c90d06144607ea572bcb Mon Sep 17 00:00:00 2001 From: themanyone Date: Thu, 18 Sep 2025 01:48:10 -0800 Subject: [PATCH 05/16] ViewerImpl.cpp: Fix signed/unsigned comparison warnings by changing loop counters from int to size_t --- src/libvgcode/src/ViewerImpl.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libvgcode/src/ViewerImpl.cpp b/src/libvgcode/src/ViewerImpl.cpp index e2a0093da59..504f9b2a62b 100644 --- a/src/libvgcode/src/ViewerImpl.cpp +++ b/src/libvgcode/src/ViewerImpl.cpp @@ -186,7 +186,7 @@ static Mat4x4 inverse(const Mat4x4& m) det = 1.0f / det; std::array ret = {}; - for (int i = 0; i < 16; ++i) { + for (size_t i = 0; i < 16; ++i) { ret[i] = inv[i] * det; } @@ -1888,7 +1888,7 @@ void ViewerImpl::render_segments(const Mat4x4& view_matrix, const Mat4x4& projec } #else std::array curr_bound_texture = { 0, 0, 0, 0 }; - for (int i = 0; i < curr_bound_texture.size(); ++i) { + for (size_t i = 0; i < curr_bound_texture.size(); ++i) { glsafe(glActiveTexture(GL_TEXTURE0 + i)); glsafe(glGetIntegerv(GL_TEXTURE_BINDING_BUFFER, &curr_bound_texture[i])); //assert(curr_bound_texture[i] == 0); @@ -1917,7 +1917,7 @@ void ViewerImpl::render_segments(const Mat4x4& view_matrix, const Mat4x4& projec #ifdef ENABLE_OPENGL_ES glsafe(glBindTexture(GL_TEXTURE_2D, curr_bound_texture)); #else - for (int i = 0; i < curr_bound_texture.size(); ++i) { + for (size_t i = 0; i < curr_bound_texture.size(); ++i) { glsafe(glActiveTexture(GL_TEXTURE0 + i)); glsafe(glBindTexture(GL_TEXTURE_BUFFER, curr_bound_texture[i])); } @@ -1975,7 +1975,7 @@ void ViewerImpl::render_options(const Mat4x4& view_matrix, const Mat4x4& project } #else std::array curr_bound_texture = { 0, 0, 0, 0 }; - for (int i = 0; i < curr_bound_texture.size(); ++i) { + for (size_t i = 0; i < curr_bound_texture.size(); ++i) { glsafe(glActiveTexture(GL_TEXTURE0 + i)); glsafe(glGetIntegerv(GL_TEXTURE_BINDING_BUFFER, &curr_bound_texture[i])); //assert(curr_bound_texture[i] == 0); @@ -2004,7 +2004,7 @@ void ViewerImpl::render_options(const Mat4x4& view_matrix, const Mat4x4& project #ifdef ENABLE_OPENGL_ES glsafe(glBindTexture(GL_TEXTURE_2D, curr_bound_texture)); #else - for (int i = 0; i < curr_bound_texture.size(); ++i) { + for (size_t i = 0; i < curr_bound_texture.size(); ++i) { glsafe(glActiveTexture(GL_TEXTURE0 + i)); glsafe(glBindTexture(GL_TEXTURE_BUFFER, curr_bound_texture[i])); } From 9b33e81eb37ae96abe9b58351b9e26b5f0cf6cb8 Mon Sep 17 00:00:00 2001 From: themanyone Date: Thu, 18 Sep 2025 01:53:18 -0800 Subject: [PATCH 06/16] normals.cpp:191:30: fix warning: comparison of integer expressions of different signedness --- bundled_deps/admesh/admesh/normals.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundled_deps/admesh/admesh/normals.cpp b/bundled_deps/admesh/admesh/normals.cpp index 3b677641f99..147087e12ee 100644 --- a/bundled_deps/admesh/admesh/normals.cpp +++ b/bundled_deps/admesh/admesh/normals.cpp @@ -188,7 +188,7 @@ void stl_fix_normal_directions(stl_file *stl) // Get next facet to fix from top of list. if (head->next != tail) { facet_num = head->next->facet_num; - assert(facet_num < stl->stats.number_of_facets); + assert(static_cast(facet_num) < stl->stats.number_of_facets); if (norm_sw[facet_num] != 1) { // If facet is in list mutiple times norm_sw[facet_num] = 1; // Record this one as being fixed. ++ checked; From 46bed2e11705dc5bbabd043eaf531b832474a845 Mon Sep 17 00:00:00 2001 From: themanyone Date: Thu, 18 Sep 2025 01:55:16 -0800 Subject: [PATCH 07/16] =?UTF-8?q?normals.cpp:196:29:=20fix=20warning:=20un?= =?UTF-8?q?used=20variable=20=E2=80=98temp=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundled_deps/admesh/admesh/normals.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/bundled_deps/admesh/admesh/normals.cpp b/bundled_deps/admesh/admesh/normals.cpp index 147087e12ee..8ec376aa43e 100644 --- a/bundled_deps/admesh/admesh/normals.cpp +++ b/bundled_deps/admesh/admesh/normals.cpp @@ -193,7 +193,6 @@ void stl_fix_normal_directions(stl_file *stl) norm_sw[facet_num] = 1; // Record this one as being fixed. ++ checked; } - stl_normal *temp = head->next; // Delete this facet from the list. head->next = head->next->next; // pool.destroy(temp); } else { // If we ran out of facets to fix: All of the facets in this part have been fixed. From 96ee323bf40f699cc3876904f4afc928ec7cb517 Mon Sep 17 00:00:00 2001 From: themanyone Date: Thu, 18 Sep 2025 01:58:25 -0800 Subject: [PATCH 08/16] connect.cpp: fix warnings: comparison of integer expressions of different signednes --- bundled_deps/admesh/admesh/connect.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bundled_deps/admesh/admesh/connect.cpp b/bundled_deps/admesh/admesh/connect.cpp index 8c3ab154adf..847e711a5c3 100644 --- a/bundled_deps/admesh/admesh/connect.cpp +++ b/bundled_deps/admesh/admesh/connect.cpp @@ -482,9 +482,10 @@ void stl_check_facets_nearby(stl_file *stl, float tolerance) { assert(stl->stats.connected_facets_3_edge <= stl->stats.connected_facets_2_edge); assert(stl->stats.connected_facets_2_edge <= stl->stats.connected_facets_1_edge); - assert(stl->stats.connected_facets_1_edge <= stl->stats.number_of_facets); + // cast number_of_facets to int to avoid signed/unsigned comparison warnings + assert(stl->stats.connected_facets_1_edge <= static_cast(stl->stats.number_of_facets)); - if (stl->stats.connected_facets_3_edge == stl->stats.number_of_facets) + if (stl->stats.connected_facets_3_edge == static_cast(stl->stats.number_of_facets)) // No need to check any further. All facets are connected. return; @@ -533,7 +534,8 @@ void stl_remove_unconnected_facets(stl_file *stl) for (int i = 0; i < 3; ++ i) if (neighbors.neighbor[i] != -1) { int &other_face_idx = stl->neighbors_start[neighbors.neighbor[i]].neighbor[(neighbors.which_vertex_not[i] + 1) % 3]; - if (other_face_idx != stl->stats.number_of_facets) { + // compare with casted value to avoid signed/unsigned mismatch + if (other_face_idx != static_cast(stl->stats.number_of_facets)) { BOOST_LOG_TRIVIAL(info) << "in remove_facet: neighbor = " << other_face_idx << " numfacets = " << stl->stats.number_of_facets << " this is wrong"; return; } From 3e9ecdde13332a6088419d3db8d1250c76c036ca Mon Sep 17 00:00:00 2001 From: themanyone Date: Thu, 18 Sep 2025 02:02:55 -0800 Subject: [PATCH 09/16] connect.cpp: Qualify calls to static member functions inside the lambdas --- bundled_deps/admesh/admesh/connect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundled_deps/admesh/admesh/connect.cpp b/bundled_deps/admesh/admesh/connect.cpp index 847e711a5c3..2aefcc34ac5 100644 --- a/bundled_deps/admesh/admesh/connect.cpp +++ b/bundled_deps/admesh/admesh/connect.cpp @@ -140,12 +140,12 @@ struct HashTableEdges { void insert_edge_exact(stl_file *stl, const HashEdge &edge) { - this->insert_edge(stl, edge, [stl](const HashEdge& edge1, const HashEdge& edge2) { record_neighbors(stl, edge1, edge2); }); + this->insert_edge(stl, edge, [stl](const HashEdge& edge1, const HashEdge& edge2) { HashTableEdges::record_neighbors(stl, edge1, edge2); }); } void insert_edge_nearby(stl_file *stl, const HashEdge &edge) { - this->insert_edge(stl, edge, [stl](const HashEdge& edge1, const HashEdge& edge2) { match_neighbors_nearby(stl, edge1, edge2); }); + this->insert_edge(stl, edge, [stl](const HashEdge& edge1, const HashEdge& edge2) { HashTableEdges::match_neighbors_nearby(stl, edge1, edge2); }); } // Hash table on edges From 00f1d0e1f3d7f0a48c9659ea9ae7efecb2922d06 Mon Sep 17 00:00:00 2001 From: themanyone Date: Thu, 18 Sep 2025 02:04:29 -0800 Subject: [PATCH 10/16] =?UTF-8?q?connect.cpp:219:51:=20fix=20warning:=20un?= =?UTF-8?q?used=20variable=20=E2=80=98temp=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundled_deps/admesh/admesh/connect.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/bundled_deps/admesh/admesh/connect.cpp b/bundled_deps/admesh/admesh/connect.cpp index 2aefcc34ac5..fb3e043f484 100644 --- a/bundled_deps/admesh/admesh/connect.cpp +++ b/bundled_deps/admesh/admesh/connect.cpp @@ -216,7 +216,6 @@ struct HashTableEdges { // This is a match. Record result in neighbors list. match_neighbors(edge, *link->next); // Delete the matched edge from the list. - HashEdge *temp = link->next; link->next = link->next->next; // pool.destroy(temp); #ifndef NDEBUG From 1805ec35625f4bb7379bc4c12940b59fa16a5b35 Mon Sep 17 00:00:00 2001 From: themanyone Date: Thu, 18 Sep 2025 02:09:13 -0800 Subject: [PATCH 11/16] shared.cpp: fix warning: comparison of integer expressions of different signedness --- bundled_deps/admesh/admesh/shared.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundled_deps/admesh/admesh/shared.cpp b/bundled_deps/admesh/admesh/shared.cpp index 1948255c0cf..00e22b9fc3c 100644 --- a/bundled_deps/admesh/admesh/shared.cpp +++ b/bundled_deps/admesh/admesh/shared.cpp @@ -90,7 +90,7 @@ void stl_generate_shared_vertices(stl_file *stl, indexed_triangle_set &its) fan_traversal_facet_visited[facet_in_fan_idx] = fan_traversal_stamp; // next_edge is an index of the starting vertex of the edge, not an index of the opposite vertex to the edge! - int next_facet = stl->neighbors_start[facet_in_fan_idx].neighbor[next_edge]; + uint32_t next_facet = stl->neighbors_start[facet_in_fan_idx].neighbor[next_edge]; if (next_facet == -1) { // No neighbor going in the current direction. if (traversal_reversed) { From 64188af360b8c49dbc642d90835081b8619d5a54 Mon Sep 17 00:00:00 2001 From: themanyone Date: Thu, 18 Sep 2025 02:11:26 -0800 Subject: [PATCH 12/16] stlinit.cpp:206: use setZero() instead of memset that generates warnings stlinit.cpp: fix typos introduced by patch stlinit.cpp:292:1: fix typo --- bundled_deps/admesh/admesh/stlinit.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bundled_deps/admesh/admesh/stlinit.cpp b/bundled_deps/admesh/admesh/stlinit.cpp index f2a518486fd..9da553ff2db 100644 --- a/bundled_deps/admesh/admesh/stlinit.cpp +++ b/bundled_deps/admesh/admesh/stlinit.cpp @@ -203,7 +203,8 @@ static bool stl_read(stl_file *stl, FILE *fp, int first_facet, bool first) sscanf(normal_buf[2], "%f", &facet.normal(2)) != 1) { // Normal was mangled. Maybe denormals or "not a number" were stored? // Just reset the normal and silently ignore it. - memset(&facet.normal, 0, sizeof(facet.normal)); + // Avoid raw-memory writes into non-trivially-copyable Eigen types. + facet.normal.setZero(); } } @@ -288,3 +289,4 @@ void stl_facet_stats(stl_file *stl, stl_facet facet, bool &first) stl->stats.max = stl->stats.max.cwiseMax(facet.vertex[i]); } } + From c422bda52f882ac8102a2c6799551c47d3d89509 Mon Sep 17 00:00:00 2001 From: themanyone Date: Thu, 18 Sep 2025 02:12:54 -0800 Subject: [PATCH 13/16] =?UTF-8?q?util.cpp:327:9:=20fix=20warning:=20this?= =?UTF-8?q?=20=E2=80=98if=E2=80=99=20clause=20does=20not=20guard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundled_deps/admesh/admesh/util.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bundled_deps/admesh/admesh/util.cpp b/bundled_deps/admesh/admesh/util.cpp index 644fa1834ca..1cdb9aba676 100644 --- a/bundled_deps/admesh/admesh/util.cpp +++ b/bundled_deps/admesh/admesh/util.cpp @@ -324,10 +324,12 @@ void stl_repair( } if (nearby_flag || fixall_flag) { - if (! tolerance_flag) + if (! tolerance_flag) { tolerance = stl->stats.shortest_edge; - if (! increment_flag) + } + if (! increment_flag){ increment = stl->stats.bounding_diameter / 10000.0; + } } if (stl->stats.connected_facets_3_edge < int(stl->stats.number_of_facets)) { From e55179c00e9b18cee30eb2e5ec91ae598e37917c Mon Sep 17 00:00:00 2001 From: themanyone Date: Thu, 18 Sep 2025 02:15:51 -0800 Subject: [PATCH 14/16] ShadersES.hpp: fix warninges about unusd defines (comment out) --- src/libvgcode/src/ShadersES.hpp | 420 ++++++++++++++++---------------- 1 file changed, 210 insertions(+), 210 deletions(-) diff --git a/src/libvgcode/src/ShadersES.hpp b/src/libvgcode/src/ShadersES.hpp index e688fa7b4c6..76c9844c5ac 100644 --- a/src/libvgcode/src/ShadersES.hpp +++ b/src/libvgcode/src/ShadersES.hpp @@ -10,219 +10,219 @@ namespace libvgcode { -static const char* Segments_Vertex_Shader_ES = -"#version 300 es\n" -"precision lowp usampler2D;\n" -"#define POINTY_CAPS\n" -"#define FIX_TWISTING\n" -"const vec3 light_top_dir = vec3(-0.4574957, 0.4574957, 0.7624929);\n" -"const float light_top_diffuse = 0.6 * 0.8;\n" -"const float light_top_specular = 0.6 * 0.125;\n" -"const float light_top_shininess = 20.0;\n" -"const vec3 light_front_dir = vec3(0.6985074, 0.1397015, 0.6985074);\n" -"const float light_front_diffuse = 0.6 * 0.3;\n" -"const float ambient = 0.3;\n" -"const float emission = 0.15;\n" -"const vec3 UP = vec3(0, 0, 1);\n" -"uniform mat4 view_matrix;\n" -"uniform mat4 projection_matrix;\n" -"uniform vec3 camera_position;\n" -"uniform sampler2D position_tex;\n" -"uniform sampler2D height_width_angle_tex;\n" -"uniform sampler2D color_tex;\n" -"uniform usampler2D segment_index_tex;\n" -"in float vertex_id_float;\n" -"out vec3 color;\n" -"vec3 decode_color(float color) {\n" -" int c = int(round(color));\n" -" int r = (c >> 16) & 0xFF;\n" -" int g = (c >> 8) & 0xFF;\n" -" int b = (c >> 0) & 0xFF;\n" -" float f = 1.0 / 255.0f;\n" -" return f * vec3(r, g, b);\n" -"}\n" -"float lighting(vec3 eye_position, vec3 eye_normal) {\n" -" float top_diffuse = light_top_diffuse * max(dot(eye_normal, light_top_dir), 0.0);\n" -" float front_diffuse = light_front_diffuse * max(dot(eye_normal, light_front_dir), 0.0);\n" -" float top_specular = light_top_specular * pow(max(dot(-normalize(eye_position), reflect(-light_top_dir, eye_normal)), 0.0), light_top_shininess);\n" -" return ambient + top_diffuse + front_diffuse + top_specular + emission;\n" -"}\n" -"ivec2 tex_coord(sampler2D sampler, int id) {\n" -" ivec2 tex_size = textureSize(sampler, 0);\n" -" return (tex_size.y == 1) ? ivec2(id, 0) : ivec2(id % tex_size.x, id / tex_size.x);\n" -"}\n" -"ivec2 tex_coord_u(usampler2D sampler, int id) {\n" -" ivec2 tex_size = textureSize(sampler, 0);\n" -" return (tex_size.y == 1) ? ivec2(id, 0) : ivec2(id % tex_size.x, id / tex_size.x);\n" -"}\n" -"void main() {\n" -" int vertex_id = int(vertex_id_float);\n" -" int id_a = int(texelFetch(segment_index_tex, tex_coord_u(segment_index_tex, gl_InstanceID), 0).r);\n" -" int id_b = id_a + 1;\n" -" vec3 pos_a = texelFetch(position_tex, tex_coord(position_tex, id_a), 0).xyz;\n" -" vec3 pos_b = texelFetch(position_tex, tex_coord(position_tex, id_b), 0).xyz;\n" -" vec3 line = pos_b - pos_a;\n" -" // directions of the line box in world space\n" -" float line_len = length(line);\n" -" vec3 line_dir;\n" -" if (line_len < 1e-4)\n" -" line_dir = vec3(1.0, 0.0, 0.0);\n" -" else\n" -" line_dir = line / line_len;\n" -" vec3 line_right_dir;\n" -" if (abs(dot(line_dir, UP)) > 0.9) {\n" -" // For vertical lines, the width and height should be same, there is no concept of up and down.\n" -" // For simplicity, the code will expand width in the x axis, and height in the y axis\n" -" line_right_dir = normalize(cross(vec3(1, 0, 0), line_dir));\n" -" }\n" -" else\n" -" line_right_dir = normalize(cross(line_dir, UP));\n" -" vec3 line_up_dir = normalize(cross(line_right_dir, line_dir));\n" -" const vec2 horizontal_vertical_view_signs_array[16] = vec2[](\n" -" //horizontal view (from right)\n" -" vec2(1.0, 0.0),\n" -" vec2(0.0, 1.0),\n" -" vec2(0.0, 0.0),\n" -" vec2(0.0, -1.0),\n" -" vec2(0.0, -1.0),\n" -" vec2(1.0, 0.0),\n" -" vec2(0.0, 1.0),\n" -" vec2(0.0, 0.0),\n" -" // vertical view (from top)\n" -" vec2(0.0, 1.0),\n" -" vec2(-1.0, 0.0),\n" -" vec2(0.0, 0.0),\n" -" vec2(1.0, 0.0),\n" -" vec2(1.0, 0.0),\n" -" vec2(0.0, 1.0),\n" -" vec2(-1.0, 0.0),\n" -" vec2(0.0, 0.0)\n" -" );\n" -" int id = vertex_id < 4 ? id_a : id_b;\n" -" vec3 endpoint_pos = vertex_id < 4 ? pos_a : pos_b;\n" -" vec3 height_width_angle = texelFetch(height_width_angle_tex, tex_coord(height_width_angle_tex, id), 0).xyz;\n" -"#ifdef FIX_TWISTING\n" -" int closer_id = (dot(camera_position - pos_a, camera_position - pos_a) < dot(camera_position - pos_b, camera_position - pos_b)) ? id_a : id_b;\n" -" vec3 closer_pos = (closer_id == id_a) ? pos_a : pos_b;\n" -" vec3 camera_view_dir = normalize(closer_pos - camera_position);\n" -" vec3 closer_height_width_angle = texelFetch(height_width_angle_tex, tex_coord(height_width_angle_tex, closer_id), 0).xyz;\n" -" vec3 diagonal_dir_border = normalize(closer_height_width_angle.x * line_up_dir + closer_height_width_angle.y * line_right_dir);\n" -"#else\n" -" vec3 camera_view_dir = normalize(endpoint_pos - camera_position);\n" -" vec3 diagonal_dir_border = normalize(height_width_angle.x * line_up_dir + height_width_angle.y * line_right_dir);\n" -"#endif\n" -" bool is_vertical_view = abs(dot(camera_view_dir, line_up_dir)) / abs(dot(diagonal_dir_border, line_up_dir)) >\n" -" abs(dot(camera_view_dir, line_right_dir)) / abs(dot(diagonal_dir_border, line_right_dir));\n" -" vec2 signs = horizontal_vertical_view_signs_array[vertex_id + 8 * int(is_vertical_view)];\n" -"#ifndef POINTY_CAPS\n" -" if (vertex_id == 2 || vertex_id == 7) signs = -horizontal_vertical_view_signs_array[(vertex_id - 2) + 8 * int(is_vertical_view)];\n" -"#endif\n" -" float view_right_sign = sign(dot(-camera_view_dir, line_right_dir));\n" -" float view_top_sign = sign(dot(-camera_view_dir, line_up_dir));\n" -" float half_height = 0.5 * height_width_angle.x;\n" -" float half_width = 0.5 * height_width_angle.y;\n" -" vec3 horizontal_dir = half_width * line_right_dir;\n" -" vec3 vertical_dir = half_height * line_up_dir;\n" -" float horizontal_sign = signs.x * view_right_sign;\n" -" float vertical_sign = signs.y * view_top_sign;\n" -" vec3 pos = endpoint_pos + horizontal_sign * horizontal_dir + vertical_sign * vertical_dir;\n" -" if (vertex_id == 2 || vertex_id == 7) {\n" -" float line_dir_sign = (vertex_id == 2) ? -1.0 : 1.0;\n" -" if (height_width_angle.z == 0.0) {\n" -"#ifdef POINTY_CAPS\n" -" // There I add a cap to lines that do not have a following line\n" -" // (or they have one, but perfectly aligned, so the cap is hidden inside the next line).\n" -" pos += line_dir_sign * line_dir * half_width;\n" -"#endif\n" -" }\n" -" else {\n" -" pos += line_dir_sign * line_dir * half_width * sin(abs(height_width_angle.z) * 0.5);\n" -" pos += sign(height_width_angle.z) * horizontal_dir * cos(abs(height_width_angle.z) * 0.5);\n" -" }\n" -" }\n" -" vec3 eye_position = (view_matrix * vec4(pos, 1.0)).xyz;\n" -" vec3 eye_normal = (view_matrix * vec4(normalize(pos - endpoint_pos), 0.0)).xyz;\n" -" vec3 color_base = decode_color(texelFetch(color_tex, tex_coord(color_tex, id), 0).r);\n" -" color = color_base * lighting(eye_position, eye_normal);\n" -" gl_Position = projection_matrix * vec4(eye_position, 1.0);\n" -"}\n"; +// static const char* Segments_Vertex_Shader_ES = +// "#version 300 es\n" +// "precision lowp usampler2D;\n" +// "#define POINTY_CAPS\n" +// "#define FIX_TWISTING\n" +// "const vec3 light_top_dir = vec3(-0.4574957, 0.4574957, 0.7624929);\n" +// "const float light_top_diffuse = 0.6 * 0.8;\n" +// "const float light_top_specular = 0.6 * 0.125;\n" +// "const float light_top_shininess = 20.0;\n" +// "const vec3 light_front_dir = vec3(0.6985074, 0.1397015, 0.6985074);\n" +// "const float light_front_diffuse = 0.6 * 0.3;\n" +// "const float ambient = 0.3;\n" +// "const float emission = 0.15;\n" +// "const vec3 UP = vec3(0, 0, 1);\n" +// "uniform mat4 view_matrix;\n" +// "uniform mat4 projection_matrix;\n" +// "uniform vec3 camera_position;\n" +// "uniform sampler2D position_tex;\n" +// "uniform sampler2D height_width_angle_tex;\n" +// "uniform sampler2D color_tex;\n" +// "uniform usampler2D segment_index_tex;\n" +// "in float vertex_id_float;\n" +// "out vec3 color;\n" +// "vec3 decode_color(float color) {\n" +// " int c = int(round(color));\n" +// " int r = (c >> 16) & 0xFF;\n" +// " int g = (c >> 8) & 0xFF;\n" +// " int b = (c >> 0) & 0xFF;\n" +// " float f = 1.0 / 255.0f;\n" +// " return f * vec3(r, g, b);\n" +// "}\n" +// "float lighting(vec3 eye_position, vec3 eye_normal) {\n" +// " float top_diffuse = light_top_diffuse * max(dot(eye_normal, light_top_dir), 0.0);\n" +// " float front_diffuse = light_front_diffuse * max(dot(eye_normal, light_front_dir), 0.0);\n" +// " float top_specular = light_top_specular * pow(max(dot(-normalize(eye_position), reflect(-light_top_dir, eye_normal)), 0.0), light_top_shininess);\n" +// " return ambient + top_diffuse + front_diffuse + top_specular + emission;\n" +// "}\n" +// "ivec2 tex_coord(sampler2D sampler, int id) {\n" +// " ivec2 tex_size = textureSize(sampler, 0);\n" +// " return (tex_size.y == 1) ? ivec2(id, 0) : ivec2(id % tex_size.x, id / tex_size.x);\n" +// "}\n" +// "ivec2 tex_coord_u(usampler2D sampler, int id) {\n" +// " ivec2 tex_size = textureSize(sampler, 0);\n" +// " return (tex_size.y == 1) ? ivec2(id, 0) : ivec2(id % tex_size.x, id / tex_size.x);\n" +// "}\n" +// "void main() {\n" +// " int vertex_id = int(vertex_id_float);\n" +// " int id_a = int(texelFetch(segment_index_tex, tex_coord_u(segment_index_tex, gl_InstanceID), 0).r);\n" +// " int id_b = id_a + 1;\n" +// " vec3 pos_a = texelFetch(position_tex, tex_coord(position_tex, id_a), 0).xyz;\n" +// " vec3 pos_b = texelFetch(position_tex, tex_coord(position_tex, id_b), 0).xyz;\n" +// " vec3 line = pos_b - pos_a;\n" +// " // directions of the line box in world space\n" +// " float line_len = length(line);\n" +// " vec3 line_dir;\n" +// " if (line_len < 1e-4)\n" +// " line_dir = vec3(1.0, 0.0, 0.0);\n" +// " else\n" +// " line_dir = line / line_len;\n" +// " vec3 line_right_dir;\n" +// " if (abs(dot(line_dir, UP)) > 0.9) {\n" +// " // For vertical lines, the width and height should be same, there is no concept of up and down.\n" +// " // For simplicity, the code will expand width in the x axis, and height in the y axis\n" +// " line_right_dir = normalize(cross(vec3(1, 0, 0), line_dir));\n" +// " }\n" +// " else\n" +// " line_right_dir = normalize(cross(line_dir, UP));\n" +// " vec3 line_up_dir = normalize(cross(line_right_dir, line_dir));\n" +// " const vec2 horizontal_vertical_view_signs_array[16] = vec2[](\n" +// " //horizontal view (from right)\n" +// " vec2(1.0, 0.0),\n" +// " vec2(0.0, 1.0),\n" +// " vec2(0.0, 0.0),\n" +// " vec2(0.0, -1.0),\n" +// " vec2(0.0, -1.0),\n" +// " vec2(1.0, 0.0),\n" +// " vec2(0.0, 1.0),\n" +// " vec2(0.0, 0.0),\n" +// " // vertical view (from top)\n" +// " vec2(0.0, 1.0),\n" +// " vec2(-1.0, 0.0),\n" +// " vec2(0.0, 0.0),\n" +// " vec2(1.0, 0.0),\n" +// " vec2(1.0, 0.0),\n" +// " vec2(0.0, 1.0),\n" +// " vec2(-1.0, 0.0),\n" +// " vec2(0.0, 0.0)\n" +// " );\n" +// " int id = vertex_id < 4 ? id_a : id_b;\n" +// " vec3 endpoint_pos = vertex_id < 4 ? pos_a : pos_b;\n" +// " vec3 height_width_angle = texelFetch(height_width_angle_tex, tex_coord(height_width_angle_tex, id), 0).xyz;\n" +// "#ifdef FIX_TWISTING\n" +// " int closer_id = (dot(camera_position - pos_a, camera_position - pos_a) < dot(camera_position - pos_b, camera_position - pos_b)) ? id_a : id_b;\n" +// " vec3 closer_pos = (closer_id == id_a) ? pos_a : pos_b;\n" +// " vec3 camera_view_dir = normalize(closer_pos - camera_position);\n" +// " vec3 closer_height_width_angle = texelFetch(height_width_angle_tex, tex_coord(height_width_angle_tex, closer_id), 0).xyz;\n" +// " vec3 diagonal_dir_border = normalize(closer_height_width_angle.x * line_up_dir + closer_height_width_angle.y * line_right_dir);\n" +// "#else\n" +// " vec3 camera_view_dir = normalize(endpoint_pos - camera_position);\n" +// " vec3 diagonal_dir_border = normalize(height_width_angle.x * line_up_dir + height_width_angle.y * line_right_dir);\n" +// "#endif\n" +// " bool is_vertical_view = abs(dot(camera_view_dir, line_up_dir)) / abs(dot(diagonal_dir_border, line_up_dir)) >\n" +// " abs(dot(camera_view_dir, line_right_dir)) / abs(dot(diagonal_dir_border, line_right_dir));\n" +// " vec2 signs = horizontal_vertical_view_signs_array[vertex_id + 8 * int(is_vertical_view)];\n" +// "#ifndef POINTY_CAPS\n" +// " if (vertex_id == 2 || vertex_id == 7) signs = -horizontal_vertical_view_signs_array[(vertex_id - 2) + 8 * int(is_vertical_view)];\n" +// "#endif\n" +// " float view_right_sign = sign(dot(-camera_view_dir, line_right_dir));\n" +// " float view_top_sign = sign(dot(-camera_view_dir, line_up_dir));\n" +// " float half_height = 0.5 * height_width_angle.x;\n" +// " float half_width = 0.5 * height_width_angle.y;\n" +// " vec3 horizontal_dir = half_width * line_right_dir;\n" +// " vec3 vertical_dir = half_height * line_up_dir;\n" +// " float horizontal_sign = signs.x * view_right_sign;\n" +// " float vertical_sign = signs.y * view_top_sign;\n" +// " vec3 pos = endpoint_pos + horizontal_sign * horizontal_dir + vertical_sign * vertical_dir;\n" +// " if (vertex_id == 2 || vertex_id == 7) {\n" +// " float line_dir_sign = (vertex_id == 2) ? -1.0 : 1.0;\n" +// " if (height_width_angle.z == 0.0) {\n" +// "#ifdef POINTY_CAPS\n" +// " // There I add a cap to lines that do not have a following line\n" +// " // (or they have one, but perfectly aligned, so the cap is hidden inside the next line).\n" +// " pos += line_dir_sign * line_dir * half_width;\n" +// "#endif\n" +// " }\n" +// " else {\n" +// " pos += line_dir_sign * line_dir * half_width * sin(abs(height_width_angle.z) * 0.5);\n" +// " pos += sign(height_width_angle.z) * horizontal_dir * cos(abs(height_width_angle.z) * 0.5);\n" +// " }\n" +// " }\n" +// " vec3 eye_position = (view_matrix * vec4(pos, 1.0)).xyz;\n" +// " vec3 eye_normal = (view_matrix * vec4(normalize(pos - endpoint_pos), 0.0)).xyz;\n" +// " vec3 color_base = decode_color(texelFetch(color_tex, tex_coord(color_tex, id), 0).r);\n" +// " color = color_base * lighting(eye_position, eye_normal);\n" +// " gl_Position = projection_matrix * vec4(eye_position, 1.0);\n" +// "}\n"; -static const char* Segments_Fragment_Shader_ES = -"#version 300 es\n" -"precision highp float;\n" -"in vec3 color;\n" -"out vec4 fragment_color;\n" -"void main() {\n" -" fragment_color = vec4(color, 1.0);\n" -"}\n"; +// static const char* Segments_Fragment_Shader_ES = +// "#version 300 es\n" +// "precision highp float;\n" +// "in vec3 color;\n" +// "out vec4 fragment_color;\n" +// "void main() {\n" +// " fragment_color = vec4(color, 1.0);\n" +// "}\n"; -static const char* Options_Vertex_Shader_ES = -"#version 300 es\n" -"precision lowp usampler2D;\n" -"const vec3 light_top_dir = vec3(-0.4574957, 0.4574957, 0.7624929);\n" -"const float light_top_diffuse = 0.6 * 0.8;\n" -"const float light_top_specular = 0.6 * 0.125;\n" -"const float light_top_shininess = 20.0;\n" -"const vec3 light_front_dir = vec3(0.6985074, 0.1397015, 0.6985074);\n" -"const float light_front_diffuse = 0.6 * 0.3;\n" -"const float ambient = 0.3;\n" -"const float emission = 0.25;\n" -"const float scaling_factor = 1.5;\n" -"uniform mat4 view_matrix;\n" -"uniform mat4 projection_matrix;\n" -"uniform sampler2D position_tex;\n" -"uniform sampler2D height_width_angle_tex;\n" -"uniform sampler2D color_tex;\n" -"uniform usampler2D segment_index_tex;\n" -"in vec3 in_position;\n" -"in vec3 in_normal;\n" -"out vec3 color;\n" -"vec3 decode_color(float color) {\n" -" int c = int(round(color));\n" -" int r = (c >> 16) & 0xFF;\n" -" int g = (c >> 8) & 0xFF;\n" -" int b = (c >> 0) & 0xFF;\n" -" float f = 1.0 / 255.0f;\n" -" return f * vec3(r, g, b);\n" -"}\n" -"float lighting(vec3 eye_position, vec3 eye_normal) {\n" -" float top_diffuse = light_top_diffuse * max(dot(eye_normal, light_top_dir), 0.0);\n" -" float front_diffuse = light_front_diffuse * max(dot(eye_normal, light_front_dir), 0.0);\n" -" float top_specular = light_top_specular * pow(max(dot(-normalize(eye_position), reflect(-light_top_dir, eye_normal)), 0.0), light_top_shininess);\n" -" return ambient + top_diffuse + front_diffuse + top_specular + emission;\n" -"}\n" -"ivec2 tex_coord(sampler2D sampler, int id) {\n" -" ivec2 tex_size = textureSize(sampler, 0);\n" -" return (tex_size.y == 1) ? ivec2(id, 0) : ivec2(id % tex_size.x, id / tex_size.x);\n" -"}\n" -"ivec2 tex_coord_u(usampler2D sampler, int id) {\n" -" ivec2 tex_size = textureSize(sampler, 0);\n" -" return (tex_size.y == 1) ? ivec2(id, 0) : ivec2(id % tex_size.x, id / tex_size.x);\n" -"}\n" -"void main() {\n" -" int id = int(texelFetch(segment_index_tex, tex_coord_u(segment_index_tex, gl_InstanceID), 0).r);\n" -" vec2 height_width = texelFetch(height_width_angle_tex, tex_coord(height_width_angle_tex, id), 0).xy;\n" -" vec3 offset = texelFetch(position_tex, tex_coord(position_tex, id), 0).xyz - vec3(0.0, 0.0, 0.5 * height_width.x);\n" -" height_width *= scaling_factor;\n" -" mat3 scale_matrix = mat3(\n" -" height_width.y, 0.0, 0.0,\n" -" 0.0, height_width.y, 0.0,\n" -" 0.0, 0.0, height_width.x);\n" -" vec3 eye_position = (view_matrix * vec4(scale_matrix * in_position + offset, 1.0)).xyz;\n" -" vec3 eye_normal = (view_matrix * vec4(in_normal, 0.0)).xyz;\n" -" vec3 color_base = decode_color(texelFetch(color_tex, tex_coord(color_tex, id), 0).r);\n" -" color = color_base * lighting(eye_position, eye_normal);\n" -" gl_Position = projection_matrix * vec4(eye_position, 1.0);\n" -"}\n"; +// static const char* Options_Vertex_Shader_ES = +// "#version 300 es\n" +// "precision lowp usampler2D;\n" +// "const vec3 light_top_dir = vec3(-0.4574957, 0.4574957, 0.7624929);\n" +// "const float light_top_diffuse = 0.6 * 0.8;\n" +// "const float light_top_specular = 0.6 * 0.125;\n" +// "const float light_top_shininess = 20.0;\n" +// "const vec3 light_front_dir = vec3(0.6985074, 0.1397015, 0.6985074);\n" +// "const float light_front_diffuse = 0.6 * 0.3;\n" +// "const float ambient = 0.3;\n" +// "const float emission = 0.25;\n" +// "const float scaling_factor = 1.5;\n" +// "uniform mat4 view_matrix;\n" +// "uniform mat4 projection_matrix;\n" +// "uniform sampler2D position_tex;\n" +// "uniform sampler2D height_width_angle_tex;\n" +// "uniform sampler2D color_tex;\n" +// "uniform usampler2D segment_index_tex;\n" +// "in vec3 in_position;\n" +// "in vec3 in_normal;\n" +// "out vec3 color;\n" +// "vec3 decode_color(float color) {\n" +// " int c = int(round(color));\n" +// " int r = (c >> 16) & 0xFF;\n" +// " int g = (c >> 8) & 0xFF;\n" +// " int b = (c >> 0) & 0xFF;\n" +// " float f = 1.0 / 255.0f;\n" +// " return f * vec3(r, g, b);\n" +// "}\n" +// "float lighting(vec3 eye_position, vec3 eye_normal) {\n" +// " float top_diffuse = light_top_diffuse * max(dot(eye_normal, light_top_dir), 0.0);\n" +// " float front_diffuse = light_front_diffuse * max(dot(eye_normal, light_front_dir), 0.0);\n" +// " float top_specular = light_top_specular * pow(max(dot(-normalize(eye_position), reflect(-light_top_dir, eye_normal)), 0.0), light_top_shininess);\n" +// " return ambient + top_diffuse + front_diffuse + top_specular + emission;\n" +// "}\n" +// "ivec2 tex_coord(sampler2D sampler, int id) {\n" +// " ivec2 tex_size = textureSize(sampler, 0);\n" +// " return (tex_size.y == 1) ? ivec2(id, 0) : ivec2(id % tex_size.x, id / tex_size.x);\n" +// "}\n" +// "ivec2 tex_coord_u(usampler2D sampler, int id) {\n" +// " ivec2 tex_size = textureSize(sampler, 0);\n" +// " return (tex_size.y == 1) ? ivec2(id, 0) : ivec2(id % tex_size.x, id / tex_size.x);\n" +// "}\n" +// "void main() {\n" +// " int id = int(texelFetch(segment_index_tex, tex_coord_u(segment_index_tex, gl_InstanceID), 0).r);\n" +// " vec2 height_width = texelFetch(height_width_angle_tex, tex_coord(height_width_angle_tex, id), 0).xy;\n" +// " vec3 offset = texelFetch(position_tex, tex_coord(position_tex, id), 0).xyz - vec3(0.0, 0.0, 0.5 * height_width.x);\n" +// " height_width *= scaling_factor;\n" +// " mat3 scale_matrix = mat3(\n" +// " height_width.y, 0.0, 0.0,\n" +// " 0.0, height_width.y, 0.0,\n" +// " 0.0, 0.0, height_width.x);\n" +// " vec3 eye_position = (view_matrix * vec4(scale_matrix * in_position + offset, 1.0)).xyz;\n" +// " vec3 eye_normal = (view_matrix * vec4(in_normal, 0.0)).xyz;\n" +// " vec3 color_base = decode_color(texelFetch(color_tex, tex_coord(color_tex, id), 0).r);\n" +// " color = color_base * lighting(eye_position, eye_normal);\n" +// " gl_Position = projection_matrix * vec4(eye_position, 1.0);\n" +// "}\n"; -static const char* Options_Fragment_Shader_ES = -"#version 300 es\n" -"precision highp float;\n" -"in vec3 color;\n" -"out vec4 fragment_color;\n" -"void main() {\n" -" fragment_color = vec4(color, 1.0);\n" -"}\n"; +// static const char* Options_Fragment_Shader_ES = +// "#version 300 es\n" +// "precision highp float;\n" +// "in vec3 color;\n" +// "out vec4 fragment_color;\n" +// "void main() {\n" +// " fragment_color = vec4(color, 1.0);\n" +// "}\n"; #if VGCODE_ENABLE_COG_AND_TOOL_MARKERS static const char* Cog_Marker_Vertex_Shader_ES = From 0bc8b257376a0d654482384edeb432b969e7a40d Mon Sep 17 00:00:00 2001 From: themanyone Date: Thu, 18 Sep 2025 02:24:45 -0800 Subject: [PATCH 15/16] shared.cpp: Use size_t instead of int/uint32_t to fix comparison warnings --- bundled_deps/admesh/admesh/shared.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bundled_deps/admesh/admesh/shared.cpp b/bundled_deps/admesh/admesh/shared.cpp index 00e22b9fc3c..4f3a857ebf9 100644 --- a/bundled_deps/admesh/admesh/shared.cpp +++ b/bundled_deps/admesh/admesh/shared.cpp @@ -90,7 +90,7 @@ void stl_generate_shared_vertices(stl_file *stl, indexed_triangle_set &its) fan_traversal_facet_visited[facet_in_fan_idx] = fan_traversal_stamp; // next_edge is an index of the starting vertex of the edge, not an index of the opposite vertex to the edge! - uint32_t next_facet = stl->neighbors_start[facet_in_fan_idx].neighbor[next_edge]; + int next_facet = stl->neighbors_start[facet_in_fan_idx].neighbor[next_edge]; if (next_facet == -1) { // No neighbor going in the current direction. if (traversal_reversed) { @@ -139,9 +139,9 @@ bool its_write_off(const indexed_triangle_set &its, const char *file) fprintf(fp, "OFF\n"); fprintf(fp, "%d %d 0\n", (int)its.vertices.size(), (int)its.indices.size()); - for (int i = 0; i < its.vertices.size(); ++ i) + for (size_t i = 0; i < its.vertices.size(); ++ i) fprintf(fp, "\t%f %f %f\n", its.vertices[i](0), its.vertices[i](1), its.vertices[i](2)); - for (uint32_t i = 0; i < its.indices.size(); ++ i) + for (size_t i = 0; i < its.indices.size(); ++ i) fprintf(fp, "\t3 %d %d %d\n", its.indices[i][0], its.indices[i][1], its.indices[i][2]); fclose(fp); return true; @@ -172,7 +172,7 @@ bool its_write_vrml(const indexed_triangle_set &its, const char *file) fprintf(fp, "\t\tDEF STLVertices Coordinate3 {\n"); fprintf(fp, "\t\t\tpoint [\n"); - int i = 0; + size_t i = 0; for (; i + 1 < its.vertices.size(); ++ i) fprintf(fp, "\t\t\t\t%f %f %f,\n", its.vertices[i](0), its.vertices[i](1), its.vertices[i](2)); fprintf(fp, "\t\t\t\t%f %f %f]\n", its.vertices[i](0), its.vertices[i](1), its.vertices[i](2)); From 3afea2e3085dad737611a09fad139dc59bdaffd6 Mon Sep 17 00:00:00 2001 From: themanyone Date: Thu, 18 Sep 2025 02:35:38 -0800 Subject: [PATCH 16/16] CutSurface.cpp:683:36: fix warnings: comparison of integer expressions of different signedness --- src/libslic3r/CutSurface.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/CutSurface.cpp b/src/libslic3r/CutSurface.cpp index 57dfb85608f..b2e1c1a3b47 100644 --- a/src/libslic3r/CutSurface.cpp +++ b/src/libslic3r/CutSurface.cpp @@ -680,9 +680,9 @@ indexed_triangle_set Slic3r::cut2model(const SurfaceCut &cut, assert(i.x() + back_offset < result.vertices.size()); assert(i.y() + back_offset < result.vertices.size()); assert(i.z() + back_offset < result.vertices.size()); - assert(i.x() >= 0 && i.x() < cut.vertices.size()); - assert(i.y() >= 0 && i.y() < cut.vertices.size()); - assert(i.z() >= 0 && i.z() < cut.vertices.size()); + assert(i.x() >= 0 && i.x() < static_cast(cut.vertices.size())); + assert(i.y() >= 0 && i.y() < static_cast(cut.vertices.size())); + assert(i.z() >= 0 && i.z() < static_cast(cut.vertices.size())); // Y and Z is swapped CCW triangles for back side result.indices.emplace_back(i.x() + back_offset, i.z() + back_offset,