summaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-03-29 14:59:56 +0300
committerAndrei Karas <akaras@inbox.ru>2017-03-29 15:03:03 +0300
commit5552b6f960a562522c36992aeca6dd2e22e9b111 (patch)
treed07eb128e873577a9c763ee635a56d9643b9e2f6 /src/fs
parent97d9ed131ae4fad7d54274cf5b74cf587b391bad (diff)
downloadmanaplus-5552b6f960a562522c36992aeca6dd2e22e9b111.tar.gz
manaplus-5552b6f960a562522c36992aeca6dd2e22e9b111.tar.bz2
manaplus-5552b6f960a562522c36992aeca6dd2e22e9b111.tar.xz
manaplus-5552b6f960a562522c36992aeca6dd2e22e9b111.zip
Add missing const in zip file buffer.
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/virtfs/virtfileprivate.cpp2
-rw-r--r--src/fs/virtfs/virtfileprivate.h4
-rw-r--r--src/fs/virtfs/virtfszip.cpp4
-rw-r--r--src/fs/virtfs/zip.cpp2
-rw-r--r--src/fs/virtfs/zip.h2
5 files changed, 7 insertions, 7 deletions
diff --git a/src/fs/virtfs/virtfileprivate.cpp b/src/fs/virtfs/virtfileprivate.cpp
index 57f06e986..62efdb434 100644
--- a/src/fs/virtfs/virtfileprivate.cpp
+++ b/src/fs/virtfs/virtfileprivate.cpp
@@ -38,7 +38,7 @@ VirtFilePrivate::VirtFilePrivate(FILEHTYPE fd) :
{
}
-VirtFilePrivate::VirtFilePrivate(uint8_t *restrict const buf,
+VirtFilePrivate::VirtFilePrivate(const uint8_t *restrict const buf,
const size_t sz) :
mBuf(buf),
mPos(0U),
diff --git a/src/fs/virtfs/virtfileprivate.h b/src/fs/virtfs/virtfileprivate.h
index d96cb5781..735a0209f 100644
--- a/src/fs/virtfs/virtfileprivate.h
+++ b/src/fs/virtfs/virtfileprivate.h
@@ -31,7 +31,7 @@ struct VirtFilePrivate final
explicit VirtFilePrivate(FILEHTYPE fd);
- VirtFilePrivate(uint8_t *restrict const buf,
+ VirtFilePrivate(const uint8_t *restrict const buf,
const size_t sz);
A_DELETE_COPY(VirtFilePrivate)
@@ -39,7 +39,7 @@ struct VirtFilePrivate final
~VirtFilePrivate();
// zipfs fields
- uint8_t *mBuf;
+ const uint8_t *mBuf;
// zipfs fields
size_t mPos;
diff --git a/src/fs/virtfs/virtfszip.cpp b/src/fs/virtfs/virtfszip.cpp
index 687245f3a..8490cb981 100644
--- a/src/fs/virtfs/virtfszip.cpp
+++ b/src/fs/virtfs/virtfszip.cpp
@@ -220,7 +220,7 @@ namespace VirtFsZip
const ZipLocalHeader *restrict const header = *it2;
if (header->fileName == filename)
{
- uint8_t *restrict const buf = Zip::readFile(header);
+ const uint8_t *restrict const buf = Zip::readFile(header);
if (buf == nullptr)
return nullptr;
VirtFile *restrict const file = new VirtFile(&funcs);
@@ -350,7 +350,7 @@ namespace VirtFsZip
const ZipLocalHeader *restrict const header = *it2;
if (header->fileName == filename)
{
- uint8_t *restrict const buf = Zip::readFile(header);
+ const uint8_t *restrict const buf = Zip::readFile(header);
if (buf == nullptr)
return nullptr;
diff --git a/src/fs/virtfs/zip.cpp b/src/fs/virtfs/zip.cpp
index 330850aee..4ff58d584 100644
--- a/src/fs/virtfs/zip.cpp
+++ b/src/fs/virtfs/zip.cpp
@@ -268,7 +268,7 @@ namespace Zip
return buf;
}
- uint8_t *readFile(const ZipLocalHeader *restrict const header)
+ const uint8_t *readFile(const ZipLocalHeader *restrict const header)
{
if (header == nullptr)
{
diff --git a/src/fs/virtfs/zip.h b/src/fs/virtfs/zip.h
index 89e04408f..d2d90b28e 100644
--- a/src/fs/virtfs/zip.h
+++ b/src/fs/virtfs/zip.h
@@ -35,7 +35,7 @@ namespace Zip
void reportZlibError(const std::string &text,
const int err);
uint8_t *readCompressedFile(const ZipLocalHeader *restrict const header);
- uint8_t *readFile(const ZipLocalHeader *restrict const header);
+ const uint8_t *readFile(const ZipLocalHeader *restrict const header);
} // namespace Zip
#endif // UTILS_ZIP_H