Permalink
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 sev- committed Oct 28, 2017
1 parent 452e979 commit 042650157a7d3fb02e0e436cd43665b5b1e67a75
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 0426501

Please sign in to comment.