From 2f740d5b8e8f52314892fb1f3b8f0818c2e97995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Wed, 3 Feb 2021 22:56:30 +0100 Subject: [PATCH] Code cleanup --- src/map/IMG/huffmanbuffer.cpp | 2 +- src/map/IMG/lblfile.cpp | 2 +- src/map/IMG/subfile.cpp | 2 +- src/map/IMG/subfile.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/map/IMG/huffmanbuffer.cpp b/src/map/IMG/huffmanbuffer.cpp index a53c687b..5568a2bf 100644 --- a/src/map/IMG/huffmanbuffer.cpp +++ b/src/map/IMG/huffmanbuffer.cpp @@ -16,5 +16,5 @@ bool HuffmanBuffer::load(const RGNFile *rgn, SubFile::Handle &rgnHdl) }; resize(recordSize); - return rgn->read(rgnHdl, (quint8*)data(), recordSize); + return rgn->read(rgnHdl, data(), recordSize); } diff --git a/src/map/IMG/lblfile.cpp b/src/map/IMG/lblfile.cpp index 0555aa3d..98a7f3d1 100644 --- a/src/map/IMG/lblfile.cpp +++ b/src/map/IMG/lblfile.cpp @@ -338,7 +338,7 @@ QImage LBLFile::readImage(Handle &hdl, quint32 id) const return QImage(); QByteArray ba; ba.resize(_rasters.at(id).size); - if (!read(hdl, (quint8*)ba.data(), _rasters.at(id).size)) + if (!read(hdl, ba.data(), _rasters.at(id).size)) return QImage(); return QImage::fromData(ba); diff --git a/src/map/IMG/subfile.cpp b/src/map/IMG/subfile.cpp index 61131f2c..177dea66 100644 --- a/src/map/IMG/subfile.cpp +++ b/src/map/IMG/subfile.cpp @@ -116,7 +116,7 @@ bool SubFile::readVBitfield32(Handle &hdl, quint32 &bitfield) const return true; } -bool SubFile::read(Handle &handle, quint8 *buff, quint32 size) const +bool SubFile::read(Handle &handle, char *buff, quint32 size) const { while (size) { quint32 remaining = handle._data.size() - handle._blockPos; diff --git a/src/map/IMG/subfile.h b/src/map/IMG/subfile.h index cc86ba63..0b67cf88 100644 --- a/src/map/IMG/subfile.h +++ b/src/map/IMG/subfile.h @@ -60,7 +60,7 @@ public: bool seek(Handle &handle, quint32 pos) const; quint32 pos(Handle &handle) const {return handle._pos;} - bool read(Handle &handle, quint8 *buff, quint32 size) const; + bool read(Handle &handle, char *buff, quint32 size) const; bool readByte(Handle &handle, quint8 *val) const {