fix Warning

This commit is contained in:
berrux-dev committed 2026-10-03 09:20:13 +02:00
1 parent 593c221d23
commit 8345470273
316 files changed
+1246 -929

No files matched your search

@@ -25,6 +25,9 @@ QtSingleApplication::QtSingleApplication(int &argc, char **argv, bool GUIenabled
: QCoreApplication(argc, argv)
#endif
{
#ifndef QT6_GUI_AVAILABLE
Q_UNUSED(GUIenabled);
#endif
sysInit();
}
@@ -22,8 +22,10 @@ namespace NGL
{
Compress::Compress(QObject* parent)
: QObject(parent), m_u2_memFiles(), m_aborted(0),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("nglcompress"))
: QObject(parent)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("nglcompress"))
, m_u2_memFiles()
, m_aborted(0)
{
DEBUG_LOG(m_logger) << "c_tor";
@@ -119,7 +119,9 @@ bool TarFilter::Private::fi2tph(const FileInformations &infos)
constexpr int octalMax = 01000000;
while (checksum > octalMax)
checksum -= octalMax;
sprintf(hdr.chksum, "%06o", checksum);
// checksum is bounded to < octalMax (<= 6 octal digits) and fits the 8-byte chksum field;
// keep the modulo so GCC's -Wformat-truncation analysis sees the bound (avoids a false positive).
snprintf(hdr.chksum, sizeof(hdr.chksum), "%.6o", checksum % octalMax);
if (!device->write((const char *)&hdr, sizeof(hdr)))
{
@@ -12,18 +12,18 @@
#include <QtWidgets/QMenuBar>
NGLMainWindow::NGLMainWindow(QWidget *parent)
: m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
, QMainWindow(parent)
: QMainWindow(parent)
, m_helpProcess(nullptr)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
, m_versionView(nullptr)
, m_menuBar(new QMenuBar(this))
{
m_menu[QLatin1String("File")] = m_menuBar->addMenu(tr("File"));
m_fileActionBefore = m_menu[QLatin1String("File")]->addSeparator();
m_menu[QLatin1String("File")]->addAction(QIcon(QLatin1String(":/icons/16x16/application-exit.png")), tr("Quit"), this, &NGLMainWindow::onExit, QKeySequence(tr("Ctrl+q")));
m_menu[QLatin1String("File")]->addAction(QIcon(QLatin1String(":/icons/16x16/application-exit.png")), tr("Quit"), QKeySequence(tr("Ctrl+q")), this, &NGLMainWindow::onExit);
m_menu[QLatin1String("Help")] = m_menuBar->addMenu(tr("Help"));
m_menu[QLatin1String("Help")]->addAction(QIcon(QLatin1String(":/icons/16x16/help-contents.png")), tr("Help"), this, &NGLMainWindow::onHelpIndex, QKeySequence(tr("F1")));
m_menu[QLatin1String("Help")]->addAction(QIcon(QLatin1String(":/icons/16x16/help-contents.png")), tr("Help"), QKeySequence(tr("F1")), this, &NGLMainWindow::onHelpIndex);
m_menu[QLatin1String("Help")]->addSeparator();
m_menu[QLatin1String("Help")]->addAction(QIcon(QLatin1String(":/icons/16x16/help-about.png")),
tr("About"), this, &NGLMainWindow::onHelpAbout);