Skip to content

Commit

Permalink
Fix -Wunused-function GCC warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
HuguesDelorme committed Dec 6, 2023
1 parent 763c890 commit b1f5c09
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/command_system_information.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ QString toUnicodeHexa(const QChar& ch)
}

// Helper function returning unicode representation of a QString object in the form "U+NNNNU+PPPP..."
QString toUnicodeHexa(const QString& str)
[[maybe_unused]] QString toUnicodeHexa(const QString& str)
{
QString strHexa;
QTextStream ostr(&strHexa);
Expand Down
4 changes: 2 additions & 2 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ static std::string_view qtTranslate(const TextId& text, int n)
}

// Helper to query the OpenGL version string
static std::string queryGlVersionString()
[[maybe_unused]] static std::string queryGlVersionString()
{
QOpenGLContext glContext;
if (!glContext.create())
Expand All @@ -372,7 +372,7 @@ static std::string queryGlVersionString()

// Helper to parse a string containing a semantic version eg "4.6.5 CodeNamed"
// Note: only major and minor versions are detected
static QVersionNumber parseSemanticVersionString(std::string_view strVersion)
[[maybe_unused]] static QVersionNumber parseSemanticVersionString(std::string_view strVersion)
{
if (strVersion.empty())
return {};
Expand Down
5 changes: 3 additions & 2 deletions src/base/mesh_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ namespace MeshUtils {

namespace {

TColStd_Array1OfReal createArray1OfReal(int count)
// Helper function to create TColStd_Array1OfReal
[[maybe_unused]] TColStd_Array1OfReal createArray1OfReal(int count)
{
if (count > 0)
return TColStd_Array1OfReal(1 , count);
return TColStd_Array1OfReal(1, count);
else
return TColStd_Array1OfReal();
}
Expand Down
2 changes: 1 addition & 1 deletion src/io_assimp/io_assimp_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ bool hasScaleFactor(const aiVector3D& scaling)
);
}

bool hasScaleFactor(const aiMatrix4x4& trsf)
[[maybe_unused]] bool hasScaleFactor(const aiMatrix4x4& trsf)
{
const aiVector3D scaling = aiMatrixScaling(trsf);
return hasScaleFactor(scaling);
Expand Down

0 comments on commit b1f5c09

Please sign in to comment.