Fix Cast Code
Eliminate a cast and resulting cast-qual warning by using a temporary as the target of memcpy. llvm-svn: 172557
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user