fix some compiler warnings

This commit is contained in:
2022-04-15 13:43:32 +02:00
parent fa45072998
commit 03c2be7977
6 changed files with 10 additions and 14 deletions

View File

@ -26,8 +26,9 @@ void MultiFactorActor::setValue(uint8_t value)
{
performAction();
}
bool exausted = true;
for(size_t i = 0; i < getActors().size(); ++i) if(!getActors()[i]->isExausted()) exausted = false;
exausted = true;
for(size_t i = 0; i < getActors().size(); ++i) if(!getActors()[i]->isExausted())
exausted = false;
}
}

View File

@ -10,6 +10,6 @@ AlarmActions::AlarmActions(QApplication* a, Microcontroller* micro, QObject *par
void AlarmActions::syncoff()
{
qDebug()<<"syncoff";
QProcess::execute ( "syncoff" );
QProcess::execute ("syncoff", QStringList());
a_->exit(0);
}

View File

@ -53,6 +53,8 @@ static int nl80211Init(struct nl_sock* nl_sock, int* nl80211_id)
static int errorHandler(struct sockaddr_nl *nla, struct nlmsgerr *err, void *arg)
{
(void)nla;
(void)err;
printf("netlink error\n");
*reinterpret_cast<int*>(arg) = 0;
return NL_STOP;
@ -60,12 +62,14 @@ static int errorHandler(struct sockaddr_nl *nla, struct nlmsgerr *err, void *arg
static int finishHandler(struct nl_msg *msg, void *arg)
{
(void)msg;
*reinterpret_cast<int*>(arg) = 0;
return NL_SKIP;
}
static int ackHandler(struct nl_msg *msg, void *arg)
{
(void)msg;
*reinterpret_cast<int*>(arg) = 0;
return NL_STOP;
}

View File

@ -24,7 +24,7 @@ void PowerItem::setValue(uint8_t value)
void PowerItem::timeout()
{
qDebug()<<"shutdown timeout";
QProcess::startDetached("syncoff");
QProcess::startDetached("syncoff", QStringList());
}
void PowerItem::store(QJsonObject& json)

View File

@ -15,7 +15,7 @@ SpeakerSensorSource::~SpeakerSensorSource()
void SpeakerSensorSource::run()
{
abort();
arecord.start( "arecord --disable-softvol -r 8000 -D front -" );
arecord.start( "arecord", {"--disable-softvol", "-r", "8000", "-D", "front", "-"});
connect(&timer, SIGNAL(timeout()), this, SLOT(doTick()));
timer.setInterval(500);

View File

@ -28,15 +28,6 @@ void SensorListWidget::sensorsChanged(std::vector<Sensor> sensors)
clear();
setHorizontalHeaderItem(0, new QTableWidgetItem("Sensor"));
setHorizontalHeaderItem(1, new QTableWidgetItem("Value"));
size_t nonHiddenCount = sensors.size();
if(!showHidden_)
{
nonHiddenCount = 0;
for(size_t i = 0; i < sensors.size(); ++i)
{
if(!sensors[i].hidden) nonHiddenCount++;
}
}
size_t listLen = 0;
for(size_t i = 0; i < sensors.size(); ++i) if(showHidden_ || !sensors[i].hidden) ++listLen;
setRowCount(static_cast<int>(listLen));