From 269cedd36e9d79169c4316afbf63c15da777ff62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Thu, 17 Dec 2020 20:14:40 +0100 Subject: [PATCH] Fix Warnings by g++ 10.2 (#2523) --- src/common/Decompiler.cpp | 2 +- src/widgets/ExportsWidget.cpp | 5 ++++- src/widgets/GraphGridLayout.cpp | 2 +- src/widgets/ImportsWidget.cpp | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/common/Decompiler.cpp b/src/common/Decompiler.cpp index 9de1b9c8..7f6cf72e 100644 --- a/src/common/Decompiler.cpp +++ b/src/common/Decompiler.cpp @@ -57,7 +57,7 @@ void R2DecDecompiler::decompileAt(RVA addr) if (lineObject.isEmpty()) { continue; } - RzCodeAnnotation annotationi = { 0 }; + RzCodeAnnotation annotationi = {}; annotationi.start = codeString.length(); codeString.append(lineObject["str"].toString() + "\n"); annotationi.end = codeString.length(); diff --git a/src/widgets/ExportsWidget.cpp b/src/widgets/ExportsWidget.cpp index 1a06e910..1859b331 100644 --- a/src/widgets/ExportsWidget.cpp +++ b/src/widgets/ExportsWidget.cpp @@ -117,10 +117,13 @@ bool ExportsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &rig return leftExp.vaddr < rightExp.vaddr; // fallthrough case ExportsModel::NameColumn: - return leftExp.name < rightExp.name; + if (leftExp.name != rightExp.name) + return leftExp.name < rightExp.name; + // fallthrough case ExportsModel::TypeColumn: if (leftExp.type != rightExp.type) return leftExp.type < rightExp.type; + // fallthrough case ExportsModel::CommentColumn: return Core()->getCommentAt(leftExp.vaddr) < Core()->getCommentAt(rightExp.vaddr); default: diff --git a/src/widgets/GraphGridLayout.cpp b/src/widgets/GraphGridLayout.cpp index b762fb20..312dd183 100644 --- a/src/widgets/GraphGridLayout.cpp +++ b/src/widgets/GraphGridLayout.cpp @@ -1336,7 +1336,7 @@ static void optimizeLinearProgramPass( int g = queue.top().second; int size = queue.top().first; queue.pop(); - if (size != edgeCount[g] || processed[g]) { + if ((size_t)size != edgeCount[g] || processed[g]) { continue; } int direction = objectiveFunction[g]; diff --git a/src/widgets/ImportsWidget.cpp b/src/widgets/ImportsWidget.cpp index ca83043e..9f20e1b1 100644 --- a/src/widgets/ImportsWidget.cpp +++ b/src/widgets/ImportsWidget.cpp @@ -143,7 +143,7 @@ bool ImportsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &rig case ImportsModel::LibraryColumn: if (leftImport.libname != rightImport.libname) return leftImport.libname < rightImport.libname; - // Fallthrough. Sort by Library and then by import name + // fallthrough case ImportsModel::NameColumn: return leftImport.name < rightImport.name; case ImportsModel::CommentColumn: