Skip to content
Snippets Groups Projects
Commit bb689179 authored by Andrea Zoli's avatar Andrea Zoli
Browse files

Fix 32bit compilation warnings.

parent ef5daf3f
No related branches found
No related tags found
No related merge requests found
...@@ -222,7 +222,7 @@ long File::getpos() ...@@ -222,7 +222,7 @@ long File::getpos()
bool File::memBookmarkPos() bool File::memBookmarkPos()
{ {
if((bookmarkPos = ftell(fp)) != (dword) -1) if((bookmarkPos = ftell(fp)) != -1)
return true; return true;
else else
return false; return false;
......
...@@ -514,7 +514,11 @@ double PartOfPacket::getFieldValue_64f(word index) ...@@ -514,7 +514,11 @@ double PartOfPacket::getFieldValue_64f(word index)
/// 64 bit double precision /// 64 bit double precision
double d; double d;
} u; } u;
#ifdef __x86_64__
u.i = (unsigned long) ( (unsigned long) getFieldValue(index) << (48)) | ( (unsigned long) getFieldValue(index + 1) << (32)) | ( (unsigned long) getFieldValue(index + 2) << (16)) | ( (unsigned long) getFieldValue(index + 3) ); u.i = (unsigned long) ( (unsigned long) getFieldValue(index) << (48)) | ( (unsigned long) getFieldValue(index + 1) << (32)) | ( (unsigned long) getFieldValue(index + 2) << (16)) | ( (unsigned long) getFieldValue(index + 3) );
#endif
return u.d; return u.d;
} }
...@@ -542,6 +546,7 @@ void PartOfPacket::setFieldValue_64f(word index, double value) ...@@ -542,6 +546,7 @@ void PartOfPacket::setFieldValue_64f(word index, double value)
throw new PacketException("The getFieldValue_64f() does not work in a 32 bit operating system"); throw new PacketException("The getFieldValue_64f() does not work in a 32 bit operating system");
} }
#if __x86_64__
union u_tag union u_tag
{ {
/// 64 bit for 64 bit os) /// 64 bit for 64 bit os)
...@@ -560,6 +565,7 @@ void PartOfPacket::setFieldValue_64f(word index, double value) ...@@ -560,6 +565,7 @@ void PartOfPacket::setFieldValue_64f(word index, double value)
setFieldValue(index + 2, w); setFieldValue(index + 2, w);
w = (word)(0xFFFF & u.i); w = (word)(0xFFFF & u.i);
setFieldValue(index + 3, w); setFieldValue(index + 3, w);
#endif
} }
signed long PartOfPacket::getFieldValue_32i(word index) signed long PartOfPacket::getFieldValue_32i(word index)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment