mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-27 06:53:01 +00:00
strict-aliasing........
This commit is contained in:
parent
be79f80770
commit
cb11d3f268
1 changed files with 6 additions and 2 deletions
|
@ -136,7 +136,9 @@ float SafeReader::readF() {
|
||||||
memcpy(&ret,&buf[curSeek],4);
|
memcpy(&ret,&buf[curSeek],4);
|
||||||
curSeek+=4;
|
curSeek+=4;
|
||||||
ret=((ret>>24)|((ret&0xff0000)>>8)|((ret&0xff00)<<8)|((ret&0xff)<<24));
|
ret=((ret>>24)|((ret&0xff0000)>>8)|((ret&0xff00)<<8)|((ret&0xff)<<24));
|
||||||
return *((float*)(&ret));
|
float realRet;
|
||||||
|
memcpy(&realRet,&ret,4);
|
||||||
|
return realRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
double SafeReader::readD() {
|
double SafeReader::readD() {
|
||||||
|
@ -153,7 +155,9 @@ double SafeReader::readD() {
|
||||||
retB[5]=ret[2];
|
retB[5]=ret[2];
|
||||||
retB[6]=ret[1];
|
retB[6]=ret[1];
|
||||||
retB[7]=ret[0];
|
retB[7]=ret[0];
|
||||||
return *((double*)retB);
|
double realRet;
|
||||||
|
memcpy(&realRet,retB,8);
|
||||||
|
return realRet;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
short SafeReader::readS() {
|
short SafeReader::readS() {
|
||||||
|
|
Loading…
Reference in a new issue