summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-09-03 14:38:44 +0200
committerIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-09-06 17:41:53 +0200
commit63c1e7c4a105df0b61f0cd1f8193820cdf026ae3 (patch)
tree746d67661871271adf364c7f0e57e4f2eb4a1b43 /src
parent65a2cb6964f3d1178718203f05e9143bd400c80e (diff)
QUrl: Remove explicit casts to {const,} void*
Those casts are not needed when passing pointers to simple types to memcpy. Change-Id: I686265b0e152aa22e0195ff252c442ab1a122ba7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qurlrecode.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/corelib/io/qurlrecode.cpp b/src/corelib/io/qurlrecode.cpp
index fd5accb108..985e4b5c28 100644
--- a/src/corelib/io/qurlrecode.cpp
+++ b/src/corelib/io/qurlrecode.cpp
@@ -591,7 +591,7 @@ static qsizetype decode(QString &appendTo, QStringView in)
const int origSize = appendTo.size();
appendTo.resize(origSize + (end - begin));
QChar *output = appendTo.data() + origSize;
- memcpy(static_cast<void *>(output), static_cast<const void *>(begin), (input - begin) * sizeof(QChar));
+ memcpy(output, begin, (input - begin) * sizeof(QChar));
output += input - begin;
while (input != end) {
@@ -601,8 +601,7 @@ static qsizetype decode(QString &appendTo, QStringView in)
if (Q_UNLIKELY(end - input < 3 || !isHex(input[1]) || !isHex(input[2]))) {
// badly-encoded data
appendTo.resize(origSize + (end - begin));
- memcpy(static_cast<void *>(appendTo.begin() + origSize),
- static_cast<const void *>(begin), (end - begin) * sizeof(*end));
+ memcpy(appendTo.begin() + origSize, begin, (end - begin) * sizeof(*end));
return end - begin;
}