aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBensuperpc <bensuperpc@gmail.com>2022-10-22 13:04:48 +0200
committerBensuperpc <bensuperpc@gmail.com>2022-10-22 13:04:48 +0200
commit56ae4e5b6ad984d4c9569cb024d807bd695555a6 (patch)
tree6c57be7ca586d98f98e7be40fc9c0343eba2696c
parent7a8c9637225f457d4648a00ff7d8031acd403730 (diff)
downloadPrismLauncher-56ae4e5b6ad984d4c9569cb024d807bd695555a6.tar.gz
PrismLauncher-56ae4e5b6ad984d4c9569cb024d807bd695555a6.tar.bz2
PrismLauncher-56ae4e5b6ad984d4c9569cb024d807bd695555a6.zip
Change old style cast to C++ cast
Change old style cast to C++ cast Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
-rw-r--r--launcher/GZip.cpp4
-rw-r--r--launcher/HoeDown.h2
-rw-r--r--launcher/tasks/Task.cpp2
-rw-r--r--libraries/LocalPeer/src/LocalPeer.cpp2
-rw-r--r--libraries/katabasis/src/DeviceFlow.cpp2
-rw-r--r--libraries/murmur2/src/MurmurHash2.cpp6
6 files changed, 9 insertions, 9 deletions
diff --git a/launcher/GZip.cpp b/launcher/GZip.cpp
index 067104cf..e36dc8a4 100644
--- a/launcher/GZip.cpp
+++ b/launcher/GZip.cpp
@@ -72,7 +72,7 @@ bool GZip::unzip(const QByteArray &compressedBytes, QByteArray &uncompressedByte
uncompLength *= 2;
}
- strm.next_out = (Bytef *)(uncompressedBytes.data() + strm.total_out);
+ strm.next_out = reinterpret_cast<Bytef *>((uncompressedBytes.data() + strm.total_out));
strm.avail_out = uncompLength - strm.total_out;
// Inflate another chunk.
@@ -129,7 +129,7 @@ bool GZip::zip(const QByteArray &uncompressedBytes, QByteArray &compressedBytes)
{
compressedBytes.resize(compressedBytes.size() * 2);
}
- zs.next_out = (Bytef *) (compressedBytes.data() + offset);
+ zs.next_out = reinterpret_cast<Bytef*>((compressedBytes.data() + offset));
temp = zs.avail_out = compressedBytes.size() - offset;
ret = deflate(&zs, Z_FINISH);
offset += temp - zs.avail_out;
diff --git a/launcher/HoeDown.h b/launcher/HoeDown.h
index b9e06ffb..cb62de6c 100644
--- a/launcher/HoeDown.h
+++ b/launcher/HoeDown.h
@@ -42,7 +42,7 @@ public:
}
void put(QByteArray input)
{
- hoedown_buffer_put(buf, (uint8_t *) input.data(), input.size());
+ hoedown_buffer_put(buf, reinterpret_cast<uint8_t *>(input.data()), input.size());
}
const uint8_t * data() const
{
diff --git a/launcher/tasks/Task.cpp b/launcher/tasks/Task.cpp
index b4babdd4..9ea1bb26 100644
--- a/launcher/tasks/Task.cpp
+++ b/launcher/tasks/Task.cpp
@@ -153,7 +153,7 @@ QString Task::describe()
auto name = objectName();
if(name.isEmpty())
{
- out << QString("0x%1").arg((quintptr)this, 0, 16);
+ out << QString("0x%1").arg(reinterpret_cast<quintptr>(this), 0, 16);
}
else
{
diff --git a/libraries/LocalPeer/src/LocalPeer.cpp b/libraries/LocalPeer/src/LocalPeer.cpp
index 3c3d8b4c..b7149c40 100644
--- a/libraries/LocalPeer/src/LocalPeer.cpp
+++ b/libraries/LocalPeer/src/LocalPeer.cpp
@@ -210,7 +210,7 @@ void LocalPeer::receiveConnection()
return;
}
- while (socket->bytesAvailable() < (int)sizeof(quint32))
+ while (socket->bytesAvailable() < static_cast<int>(sizeof(quint32)))
{
socket->waitForReadyRead();
}
diff --git a/libraries/katabasis/src/DeviceFlow.cpp b/libraries/katabasis/src/DeviceFlow.cpp
index ba1d121d..f78fd620 100644
--- a/libraries/katabasis/src/DeviceFlow.cpp
+++ b/libraries/katabasis/src/DeviceFlow.cpp
@@ -445,7 +445,7 @@ void DeviceFlow::onRefreshError(QNetworkReply::NetworkError error, QNetworkReply
if(refreshReply) {
refreshReply->deleteLater();
}
- qDebug() << "DeviceFlow::onRefreshFinished: Error" << (int)error << " - " << errorString;
+ qDebug() << "DeviceFlow::onRefreshFinished: Error" << static_cast<int>(error) << " - " << errorString;
}
}
diff --git a/libraries/murmur2/src/MurmurHash2.cpp b/libraries/murmur2/src/MurmurHash2.cpp
index b625efb1..c13608f0 100644
--- a/libraries/murmur2/src/MurmurHash2.cpp
+++ b/libraries/murmur2/src/MurmurHash2.cpp
@@ -55,12 +55,12 @@ uint32_t MurmurHash2(std::ifstream&& file_stream, std::size_t buffer_size, std::
// Mix 4 bytes at a time into the hash
if (index == 0)
- FourBytes_MurmurHash2((unsigned char*)&data, info);
+ FourBytes_MurmurHash2(reinterpret_cast<unsigned char*>(&data), info);
}
} while (!file_stream.eof());
// Do one last bit shuffle in the hash
- FourBytes_MurmurHash2((unsigned char*)&data, info);
+ FourBytes_MurmurHash2(reinterpret_cast<unsigned char*>(&data), info);
delete[] buffer;
@@ -72,7 +72,7 @@ void FourBytes_MurmurHash2(const unsigned char* data, IncrementalHashInfo& prev)
{
if (prev.len >= 4) {
// Not the final mix
- uint32_t k = *(uint32_t*)data;
+ uint32_t k = *reinterpret_cast<const uint32_t*>(data);
k *= m;
k ^= k >> r;