1
0
Fork 0
mirror of https://github.com/EdgeTX/edgetx.git synced 2025-07-24 00:35:14 +03:00

[companion] Fix a few reasonable warnings brought up by MSVC /W3. (#4206)

This commit is contained in:
Max Paperno 2017-01-07 02:33:57 -05:00 committed by Bertrand Songis
parent 51f186597c
commit 52b68c9ea2
5 changed files with 9 additions and 11 deletions

View file

@ -864,7 +864,7 @@ void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx)
} }
dialog->exec(); dialog->exec();
delete dialog; dialog->deleteLater();
delete simuData; delete simuData;
#if defined(WIN32) && defined(WIN_USE_CONSOLE_STDIO) #if defined(WIN32) && defined(WIN_USE_CONSOLE_STDIO)
FreeConsole(); FreeConsole();
@ -941,10 +941,9 @@ QString index2version(int index)
} }
} }
int qunlink(const QString & fileName) bool qunlink(const QString & fileName)
{ {
QByteArray ba = fileName.toLatin1(); return QFile::remove(fileName);
return unlink(ba.constData());
} }
QString generateProcessUniqueTempFileName(const QString & fileName) QString generateProcessUniqueTempFileName(const QString & fileName)

View file

@ -187,7 +187,7 @@ class QTimeS : public QTime
int seconds() const { return hour()*3600 + minute()*60 + second(); }; int seconds() const { return hour()*3600 + minute()*60 + second(); };
}; };
int qunlink(const QString & fileName); bool qunlink(const QString & fileName);
QString generateProcessUniqueTempFileName(const QString & fileName); QString generateProcessUniqueTempFileName(const QString & fileName);
bool isTempFileName(const QString & fileName); bool isTempFileName(const QString & fileName);

View file

@ -78,7 +78,7 @@ void MixesPanel::update()
QString str = ""; QString str = "";
while (curDest < mix.destCh-1) { while (curDest < mix.destCh-1) {
curDest++; curDest++;
AddMixerLine(-curDest); AddMixerLine(-int(curDest));
} }
if (AddMixerLine(i)) { if (AddMixerLine(i)) {
curDest++; curDest++;
@ -87,7 +87,7 @@ void MixesPanel::update()
while (curDest < outputs) { while (curDest < outputs) {
curDest++; curDest++;
AddMixerLine(-curDest); AddMixerLine(-int(curDest));
} }
} }

View file

@ -950,7 +950,7 @@ void SetupPanel::startupSwitchEdited(int value)
} }
else { else {
shift = index+1; shift = index+1;
mask = 0x01ul << shift; mask = 0x01ull << shift;
} }
} }

View file

@ -93,13 +93,12 @@ void FlashProcess::onStarted()
progress->addSeparator(); progress->addSeparator();
} }
# if !__GNUC__ #if !__GNUC__
bool killProcessByName(const char *szProcessToKill) bool killProcessByName(const char *szProcessToKill)
{ {
HANDLE hProcessSnap; HANDLE hProcessSnap;
HANDLE hProcess; HANDLE hProcess;
PROCESSENTRY32 pe32; PROCESSENTRY32 pe32;
DWORD dwPriorityClass;
hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); // Takes a snapshot of all the processes hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); // Takes a snapshot of all the processes
@ -129,7 +128,7 @@ bool killProcessByName(const char *szProcessToKill)
void FlashProcess::onKillTimerElapsed() void FlashProcess::onKillTimerElapsed()
{ {
# if !__GNUC__ #if !__GNUC__
// trick to accelerate SAM-BA startup // trick to accelerate SAM-BA startup
killProcessByName("tasklist.exe"); killProcessByName("tasklist.exe");
#endif #endif