Browse files

PSP: Fix strict aliasing violation

Casting through pointer to void just to truncate a value to uint32
is incorrect.
  • Loading branch information...
csnover authored and ccawley2011 committed Oct 28, 2017
1 parent e77e81c commit 85f878cab626d75a0b6003f0b8d61358f5307d95
Showing with 1 addition and 1 deletion.
  1. +1 −1 backends/fs/psp/psp-stream.cpp
@@ -99,7 +99,7 @@ SceUID PspIoStream::open() {
// Get the file size. This way is much faster than going to the end of the file and back
SceIoStat stat;
sceIoGetstat(_path.c_str(), &stat);
_fileSize = *((uint32 *)(void *)&stat.st_size); // 4GB file (32 bits) is big enough for us
_fileSize = stat.st_size; // 4GB file (32 bits) is big enough for us

PSP_DEBUG_PRINT("%s filesize[%d]\n", _path.c_str(), _fileSize);

0 comments on commit 85f878c

Please sign in to comment.