Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some compilation warnings #474

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions qdlt/qdltargument.cpp
Original file line number Diff line number Diff line change
@@ -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)));
}
17 changes: 0 additions & 17 deletions qdlt/qdltmsg.cpp
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/dltexporter.cpp
Original file line number Diff line number Diff line change
@@ -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

Loading