From c196e559b22cd36f71b607b1b38a66a4b3cef294 Mon Sep 17 00:00:00 2001 From: Julio Angulo Date: Tue, 28 May 2024 16:00:21 +0200 Subject: [PATCH] Fixed some compilation warnings - unitialized variable - unused variables - for sentence incomplete Signed-off-by: Julio Angulo --- qdlt/qdltargument.cpp | 6 ++---- qdlt/qdltmsg.cpp | 17 ----------------- src/dltexporter.cpp | 2 +- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/qdlt/qdltargument.cpp b/qdlt/qdltargument.cpp index 6fcf501f..445ac4fb 100644 --- a/qdlt/qdltargument.cpp +++ b/qdlt/qdltargument.cpp @@ -507,8 +507,7 @@ QString QDltArgument::toString(bool binary) const if(endianness == DltEndiannessLittleEndian) text += QString("%1").arg((double)(*(double*)(data.constData()))); else { - unsigned int tmp; - tmp = DLT_SWAP_64((unsigned long long)(*(unsigned long long*)(data.constData()))); + unsigned int tmp = DLT_SWAP_64((unsigned long long)(*(unsigned long long*)(data.constData()))); void *buf = (void *) &tmp; text += QString("%1").arg((double)(*((double*)buf))); } @@ -616,8 +615,7 @@ QVariant QDltArgument::getValue() const if(endianness == DltEndiannessLittleEndian) return QVariant((double)(*(double*)(data.constData()))); else { - unsigned int tmp; - tmp = DLT_SWAP_64((unsigned long long)(*(unsigned long long*)(data.constData()))); + unsigned int tmp = DLT_SWAP_64((unsigned long long)(*(unsigned long long*)(data.constData()))); void *buf = (void*) &tmp; return QVariant((double)(*((double*)buf))); } diff --git a/qdlt/qdltmsg.cpp b/qdlt/qdltmsg.cpp index 26289f17..f34e1fb4 100644 --- a/qdlt/qdltmsg.cpp +++ b/qdlt/qdltmsg.cpp @@ -154,11 +154,7 @@ QString QDltMsg::getGmTimeWithOffsetString(qlonglong offset, bool dst) quint32 QDltMsg::checkMsgSize(const char *data,quint32 size,bool supportDLTv2) { int sizeStorageHeader = 0; - quint32 storageHeaderTimestampNanoseconds = 0; - quint64 storageHeaderTimestampSeconds = 0; QString storageHeaderEcuId; - bool withStorageHeader=false; - const DltStorageHeader *storageheader = 0; /* empty message */ clear(); @@ -171,7 +167,6 @@ quint32 QDltMsg::checkMsgSize(const char *data,quint32 size,bool supportDLTv2) } if(data[0]=='D' && data[1]=='L' && data[2]=='T') { - withStorageHeader = true; quint8 storageHeaderVersion = *((quint8*) (data + 3)); if(storageHeaderVersion==1) { @@ -181,12 +176,6 @@ quint32 QDltMsg::checkMsgSize(const char *data,quint32 size,bool supportDLTv2) // length error return 0; } - - if(withStorageHeader) - { - storageheader = (DltStorageHeader*) data; - } - } else if(storageHeaderVersion==2) { @@ -195,12 +184,6 @@ quint32 QDltMsg::checkMsgSize(const char *data,quint32 size,bool supportDLTv2) // length error return 0; } - storageHeaderTimestampNanoseconds = *((quint32*) (data + 4)); // not in big endian format - storageHeaderTimestampSeconds = (((quint64)(*((quint8*) (data + 12))))<<32)| - (((quint64)(*((quint8*) (data + 11))))<<24)| - (((quint64)(*((quint8*) (data + 10))))<<16)| - (((quint64)(*((quint8*) (data + 9))))<<8)| - (((quint64)(*((quint8*) (data + 8))))); quint8 ecuIdLength = *((quint8*) (data + 13)); if(size < (quint32)(14+ecuIdLength)) { return 0; // length error diff --git a/src/dltexporter.cpp b/src/dltexporter.cpp index a178a4a9..54e2b63e 100644 --- a/src/dltexporter.cpp +++ b/src/dltexporter.cpp @@ -403,7 +403,7 @@ void DltExporter::exportMessages(QDltFile *from, QFile *to, QDltPluginManager *p fileprogress.show(); } - for(starting;starting