Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly use signed char in meshgenerator to avoid narrowing error on ARM #1842

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading