summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2013-01-15 22:09:39 +0000
committerDavid Greene <greened@obbligato.org>2013-01-15 22:09:39 +0000
commita6394d0440382ed03a5ce89f6a5655bbca845ceb (patch)
tree1443a0d5e85d8155697fbd04a6127a99c6a11bf5 /clang/lib
parent47811e4bd8e33a3d194b7de9d097026fb480e67c (diff)
downloadbcm5719-llvm-a6394d0440382ed03a5ce89f6a5655bbca845ceb.tar.gz
bcm5719-llvm-a6394d0440382ed03a5ce89f6a5655bbca845ceb.zip
Fix Cast Code
Eliminate a cast and resulting cast-qual warning by using a temporary as the target of memcpy. llvm-svn: 172557
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/DeclSpec.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp
index a81c0093bb7..fa63c2af38f 100644
--- a/clang/lib/Sema/DeclSpec.cpp
+++ b/clang/lib/Sema/DeclSpec.cpp
@@ -772,9 +772,10 @@ void DeclSpec::setProtocolQualifiers(Decl * const *Protos,
SourceLocation *ProtoLocs,
SourceLocation LAngleLoc) {
if (NP == 0) return;
- ProtocolQualifiers = new Decl*[NP];
+ Decl **ProtoQuals = new Decl*[NP];
+ memcpy(ProtoQuals, Protos, sizeof(Decl*)*NP);
+ ProtocolQualifiers = ProtoQuals;
ProtocolLocs = new SourceLocation[NP];
- memcpy((void*)ProtocolQualifiers, Protos, sizeof(Decl*)*NP);
memcpy(ProtocolLocs, ProtoLocs, sizeof(SourceLocation)*NP);
NumProtocolQualifiers = NP;
ProtocolLAngleLoc = LAngleLoc;
OpenPOWER on IntegriCloud