Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
Qt6 QTranslator::load() uses [[nodiscard]] which currently leads to
compiler warnings. This is fixed using static_cast<void>.

Signed-off-by: ThomasZecha <[email protected]>
  • Loading branch information
ThomasZecha committed Jan 7, 2025
1 parent ac24a25 commit 0d97f03
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion qucs-activefilter/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int main(int argc, char *argv[])
QString Lang = QucsSettings.Language;
if(Lang.isEmpty())
Lang = QString(QLocale::system().name());
tor.load( QStringLiteral("qucs_") + Lang, LangDir);
static_cast<void>(tor.load( QStringLiteral("qucs_") + Lang, LangDir));
a.installTranslator( &tor );

QucsActiveFilter *w = new QucsActiveFilter();
Expand Down
2 changes: 1 addition & 1 deletion qucs-attenuator/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ int main( int argc, char ** argv )
QString lang = QucsSettings.Language;
if(lang.isEmpty())
lang = QString(QLocale::system().name());
tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir);
static_cast<void>(tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir));
a.installTranslator( &tor );

QucsAttenuator *qucs = new QucsAttenuator();
Expand Down
2 changes: 1 addition & 1 deletion qucs-filter/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ int main(int argc, char *argv[])
QString lang = QucsSettings.Language;
if(lang.isEmpty())
lang = QString(QLocale::system().name());
tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir);
static_cast<void>(tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir));
a.installTranslator( &tor );

QucsFilter *qucs = new QucsFilter();
Expand Down
2 changes: 1 addition & 1 deletion qucs-powercombining/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int main(int argc, char *argv[])
QString lang = QucsSettings.Language;
if(lang.isEmpty())
lang = QString(QLocale::system().name());
tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir);
static_cast<void>(tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir));
app.installTranslator( &tor );

QucsPowerCombiningTool *PowerCombiningTool = new QucsPowerCombiningTool();
Expand Down
2 changes: 1 addition & 1 deletion qucs-s-spar-viewer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ int main( int argc, char ** argv )
QString lang = QucsSettings.Language;
if(lang.isEmpty())
lang = QString(QLocale::system().name());
tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir);
static_cast<void>(tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir));
a.installTranslator( &tor );

Qucs_S_SPAR_Viewer *qucs = new Qucs_S_SPAR_Viewer();
Expand Down
2 changes: 1 addition & 1 deletion qucs-transcalc/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ int main(int argc, char *argv[])
QString lang = QucsSettings.Language;
if(lang.isEmpty())
lang = QString(QLocale::system().name());
tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir);
static_cast<void>(tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir));
a.installTranslator( &tor );

QucsTranscalc *qucs = new QucsTranscalc();
Expand Down
2 changes: 1 addition & 1 deletion qucs/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ int main(int argc, char *argv[])
lang = loc.name();
// lang = QTextCodec::locale();
}
tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir);
static_cast<void>(tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir));
QApplication::installTranslator( &tor );

// This seems to be necessary on a few system to make strtod()
Expand Down

0 comments on commit 0d97f03

Please sign in to comment.