From bb59a420f5fd5018aec65c2e6099686752b6bf1b Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Thu, 5 Dec 2024 15:18:35 +0100 Subject: [PATCH 1/2] Explicitly use signed char in meshgenerator to avoid narrowing error on ARM Signed-off-by: Matthew J. Milner --- avogadro/qtgui/meshgenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avogadro/qtgui/meshgenerator.cpp b/avogadro/qtgui/meshgenerator.cpp index 42628b4766..43587d695c 100644 --- a/avogadro/qtgui/meshgenerator.cpp +++ b/avogadro/qtgui/meshgenerator.cpp @@ -925,7 +925,7 @@ const bool MeshGenerator::m_isCut[256][12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} }; -const char MeshGenerator::m_caseTriangles[256][16] +const signed char MeshGenerator::m_caseTriangles[256][16] { {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, From 5a67588dcecaa940ca2b044e73aee4c24754eff5 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Thu, 5 Dec 2024 17:04:01 +0100 Subject: [PATCH 2/2] Adjust types Signed-off-by: Matthew J. Milner --- avogadro/qtgui/meshgenerator.cpp | 2 +- avogadro/qtgui/meshgenerator.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/avogadro/qtgui/meshgenerator.cpp b/avogadro/qtgui/meshgenerator.cpp index 43587d695c..e829e60c3b 100644 --- a/avogadro/qtgui/meshgenerator.cpp +++ b/avogadro/qtgui/meshgenerator.cpp @@ -454,7 +454,7 @@ void MeshGenerator::FlyingEdgesAlgorithmPass4() } // Add triangles - const char* caseTri = m_caseTriangles[caseId]; // size 16 + const signed char* caseTri = m_caseTriangles[caseId]; // size 16 for(int idx = 0; caseTri[idx] != -1; idx += 3) { diff --git a/avogadro/qtgui/meshgenerator.h b/avogadro/qtgui/meshgenerator.h index 99dd7298fc..637de9c5ec 100644 --- a/avogadro/qtgui/meshgenerator.h +++ b/avogadro/qtgui/meshgenerator.h @@ -252,7 +252,7 @@ class AVOGADROQTGUI_EXPORT MeshGenerator : public QThread */ static const unsigned char m_numTris[256]; static const bool m_isCut[256][12]; - static const char m_caseTriangles[256][16]; + static const signed char m_caseTriangles[256][16]; static const unsigned char m_edgeVertices[12][2]; };