Skip to content

Commit

Permalink
Fixed some compilation warnings (#474)
Browse files Browse the repository at this point in the history
- unitialized variable
- unused variables
- for sentence incomplete

Signed-off-by: Julio Angulo <[email protected]>
  • Loading branch information
joas77 authored Jun 4, 2024
1 parent 658bd2e commit cfb7519
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
6 changes: 2 additions & 4 deletions qdlt/qdltargument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}
Expand Down Expand Up @@ -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)));
}
Expand Down
17 changes: 0 additions & 17 deletions qdlt/qdltmsg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/dltexporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ void DltExporter::exportMessages(QDltFile *from, QFile *to, QDltPluginManager *p
fileprogress.show();
}

for(starting;starting<stoping;starting++)
for(;starting<stoping;starting++)
{
// Update progress dialog every 1000 lines

Expand Down

0 comments on commit cfb7519

Please sign in to comment.