summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCELFObjectTargetWriter.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-09-22 14:09:50 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-09-22 14:09:50 +0000
commit8817cca5ce782c187605ee08e1a7363aa5470534 (patch)
treea70f68125c16f17261abf4865bb60f46a053b51e /llvm/lib/MC/MCELFObjectTargetWriter.cpp
parent402f807d9d0238cf7c7dd98bea52be221637d580 (diff)
downloadbcm5719-llvm-8817cca5ce782c187605ee08e1a7363aa5470534.tar.gz
bcm5719-llvm-8817cca5ce782c187605ee08e1a7363aa5470534.zip
Provide basic type safety for array_pod_sort comparators.
This makes using array_pod_sort significantly safer. The implementation relies on function pointer casting but that should be safe as we're dealing with void* here. llvm-svn: 191175
Diffstat (limited to 'llvm/lib/MC/MCELFObjectTargetWriter.cpp')
-rw-r--r--llvm/lib/MC/MCELFObjectTargetWriter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCELFObjectTargetWriter.cpp b/llvm/lib/MC/MCELFObjectTargetWriter.cpp
index ec7397d748f..0c39e4a17ef 100644
--- a/llvm/lib/MC/MCELFObjectTargetWriter.cpp
+++ b/llvm/lib/MC/MCELFObjectTargetWriter.cpp
@@ -42,9 +42,9 @@ const MCSymbol *MCELFObjectTargetWriter::undefinedExplicitRelSym(const MCValue &
// ELF doesn't require relocations to be in any order. We sort by the r_offset,
// just to match gnu as for easier comparison. The use type and index is an
// arbitrary way of making the sort deterministic.
-static int cmpRel(const void *AP, const void *BP) {
- const ELFRelocationEntry &A = *(const ELFRelocationEntry *)AP;
- const ELFRelocationEntry &B = *(const ELFRelocationEntry *)BP;
+static int cmpRel(const ELFRelocationEntry *AP, const ELFRelocationEntry *BP) {
+ const ELFRelocationEntry &A = *AP;
+ const ELFRelocationEntry &B = *BP;
if (A.r_offset != B.r_offset)
return B.r_offset - A.r_offset;
if (B.Type != A.Type)
OpenPOWER on IntegriCloud