summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fs/files.cpp2
-rw-r--r--src/fs/virtfs/virtfsdir.cpp6
-rw-r--r--src/fs/virtfs/virtfsziprwops.cpp4
-rw-r--r--src/render/nacl/naclgles.cpp2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/fs/files.cpp b/src/fs/files.cpp
index fa9fe2de3..dbbf248d2 100644
--- a/src/fs/files.cpp
+++ b/src/fs/files.cpp
@@ -91,7 +91,7 @@ void Files::copyVirtFsFile(const std::string &restrict inFile,
const std::string &restrict outFile)
{
int size = 0;
- char *const buf = VirtFs::loadFile(inFile, size);
+ const char *const buf = VirtFs::loadFile(inFile, size);
FILE *const file = fopen(outFile.c_str(), "w");
fwrite(buf, 1, size, file);
fclose(file);
diff --git a/src/fs/virtfs/virtfsdir.cpp b/src/fs/virtfs/virtfsdir.cpp
index c3c2cad73..7f693b8ae 100644
--- a/src/fs/virtfs/virtfsdir.cpp
+++ b/src/fs/virtfs/virtfsdir.cpp
@@ -455,7 +455,7 @@ namespace VirtFsDir
const std::string &restrict filename,
int &restrict fileSize)
{
- VirtDirEntry *const dirEntry = static_cast<VirtDirEntry*>(entry);
+ const VirtDirEntry *const dirEntry = static_cast<VirtDirEntry*>(entry);
const std::string path = entry->root + filename;
if (Files::existsLocal(path) == false)
return nullptr;
@@ -493,9 +493,9 @@ namespace VirtFsDir
buffer[fileSize - 1] = 0;
#ifdef USE_FILE_FOPEN
- int cnt = fread(buffer, 1, fileSize, fd);
+ const int cnt = fread(buffer, 1, fileSize, fd);
#else // USE_FILE_FOPEN
- int cnt = ::read(fd, buffer, fileSize);
+ const int cnt = ::read(fd, buffer, fileSize);
#endif // USE_FILE_FOPEN
if (cnt <= 0)
diff --git a/src/fs/virtfs/virtfsziprwops.cpp b/src/fs/virtfs/virtfsziprwops.cpp
index 24162e129..098b409e3 100644
--- a/src/fs/virtfs/virtfsziprwops.cpp
+++ b/src/fs/virtfs/virtfsziprwops.cpp
@@ -137,10 +137,10 @@ namespace VirtFsZip
#ifdef USE_SDL2
RWOPSINT rwops_size(SDL_RWops *const rw)
{
- VirtFile *const handle = static_cast<VirtFile *const>(
- rw->hidden.unknown.data1);
if (!rw)
return 0;
+ VirtFile *const handle = static_cast<VirtFile *const>(
+ rw->hidden.unknown.data1);
return handle->mSize;
}
#endif // USE_SDL2
diff --git a/src/render/nacl/naclgles.cpp b/src/render/nacl/naclgles.cpp
index 6a971e8c7..18e71155d 100644
--- a/src/render/nacl/naclgles.cpp
+++ b/src/render/nacl/naclgles.cpp
@@ -48,7 +48,7 @@ void NaclGles::initGles()
gles2Context = glGetCurrentContextPPAPI();
logger->log("InitGles: %p, %d",
- static_cast<const void*>(gles2Interface),
+ reinterpret_cast<const void*>(gles2Interface),
gles2Context);
}