Skip to content

Commit

Permalink
Merge pull request #1842 from matterhorn103/fix-wnarrowing
Browse files Browse the repository at this point in the history
Explicitly use signed char in meshgenerator to avoid narrowing error on ARM
  • Loading branch information
ghutchis authored Dec 5, 2024
2 parents db065e2 + 5a67588 commit aa1b056
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions avogadro/qtgui/meshgenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{

Expand Down Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion avogadro/qtgui/meshgenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
};

Expand Down

0 comments on commit aa1b056

Please sign in to comment.