forked from GerhardHoffmann/DCLibraries
Fix Q_ASSERTS
This commit is contained in:
parent
5599c56114
commit
352b550190
@ -59,8 +59,10 @@ hwapi::hwapi(QWidget *parent) : QObject(parent)
|
|||||||
qCritical() << "Creating/attaching shared memory failed";
|
qCritical() << "Creating/attaching shared memory failed";
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_ASSERT_X(sizeof(SharedMem) != m_sharedMem->size(),
|
Q_ASSERT_X(sizeof(SharedMem) == m_sharedMem->size(), "check shm-sizes",
|
||||||
"compare sizes", "sizes different");
|
QString("sizes different %1 != %2")
|
||||||
|
.arg(sizeof(SharedMem))
|
||||||
|
.arg(m_sharedMem->size()).toStdString().c_str());
|
||||||
|
|
||||||
//if (shdMem_firstUse()) // für Master raus
|
//if (shdMem_firstUse()) // für Master raus
|
||||||
// {
|
// {
|
||||||
@ -3351,7 +3353,6 @@ void hwapi::sys_restoreDeviceParameter(struct T_devices *deviceSettings) const
|
|||||||
*start = buf[nn];
|
*start = buf[nn];
|
||||||
start++;
|
start++;
|
||||||
} while(++nn<LL);
|
} while(++nn<LL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hwapi::sys_areDCdataValid(void) const
|
bool hwapi::sys_areDCdataValid(void) const
|
||||||
@ -4442,8 +4443,8 @@ bool hwapi::dcDownloadRequest(QString const &dcFileToDownload) const {
|
|||||||
bool hwapi::dcDownloadRequested() const {
|
bool hwapi::dcDownloadRequested() const {
|
||||||
SharedMem *data = SharedMem::getData();
|
SharedMem *data = SharedMem::getData();
|
||||||
Q_ASSERT_X(data != nullptr, "check", "pointer invalid");
|
Q_ASSERT_X(data != nullptr, "check", "pointer invalid");
|
||||||
Q_ASSERT_X((void *)data != m_sharedMem->data(), "compare pointers", "pointers different");
|
Q_ASSERT_X((void *)data == m_sharedMem->data(), "compare pointers", "pointers different");
|
||||||
Q_ASSERT_X(sizeof(*data) != m_sharedMem->size(), "compare sizes", "sizes different");
|
Q_ASSERT_X(sizeof(*data) == m_sharedMem->size(), "compare sizes", "sizes different");
|
||||||
|
|
||||||
// called by download-thread
|
// called by download-thread
|
||||||
// 1: true at entry: reset atomically to false
|
// 1: true at entry: reset atomically to false
|
||||||
|
Loading…
Reference in New Issue
Block a user