diff options
author | Andrey Churbanov <Andrey.Churbanov@intel.com> | 2017-07-17 09:03:14 +0000 |
---|---|---|
committer | Andrey Churbanov <Andrey.Churbanov@intel.com> | 2017-07-17 09:03:14 +0000 |
commit | b88a01f4ef232f4ae4d213edf646f0fa8d0bccb8 (patch) | |
tree | 3e9bc651ad2c3e30e545dcf4ec7ee5da8593a276 /runtime/src/kmp_affinity.cpp | |
parent | 53e0c92a883860015a34e9c647daae0abb1b102f (diff) |
OpenMP RTL cleanup: eliminated warnings with -Wcast-qual, patch 2.
Changes are: got all atomics to accept volatile pointers that allowed
to simplify many type conversions. Windows specific code fixed correspondingly.
Differential Revision: https://reviews.llvm.org/D35417
git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@308164 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/src/kmp_affinity.cpp')
-rw-r--r-- | runtime/src/kmp_affinity.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/runtime/src/kmp_affinity.cpp b/runtime/src/kmp_affinity.cpp index 5460bd9..80368fd 100644 --- a/runtime/src/kmp_affinity.cpp +++ b/runtime/src/kmp_affinity.cpp @@ -1691,8 +1691,8 @@ static int __kmp_affinity_cmp_ProcCpuInfo_os_id(const void *a, const void *b) { static int __kmp_affinity_cmp_ProcCpuInfo_phys_id(const void *a, const void *b) { unsigned i; - const unsigned *aa = *(RCAST(unsigned **, CCAST(void *, a))); - const unsigned *bb = *(RCAST(unsigned **, CCAST(void *, b))); + const unsigned *aa = *(unsigned *const *)a; + const unsigned *bb = *(unsigned *const *)b; for (i = maxIndex;; i--) { if (aa[i] < bb[i]) return -1; @@ -1732,7 +1732,7 @@ static int __kmp_affinity_create_cpuinfo_map(AddrUnsPair **address2os, // FIXME - this will match "node_<n> <garbage>" unsigned level; - if (KMP_SSCANF(buf, "node_%d id", &level) == 1) { + if (KMP_SSCANF(buf, "node_%u id", &level) == 1) { if (nodeIdIndex + level >= maxIndex) { maxIndex = nodeIdIndex + level; } @@ -3786,10 +3786,8 @@ static int __kmp_aff_depth = 0; return; static int __kmp_affinity_cmp_Address_child_num(const void *a, const void *b) { - const Address *aa = - (const Address *)&(((AddrUnsPair *)CCAST(void *, a))->first); - const Address *bb = - (const Address *)&(((AddrUnsPair *)CCAST(void *, b))->first); + const Address *aa = &(((const AddrUnsPair *)a)->first); + const Address *bb = &(((const AddrUnsPair *)b)->first); unsigned depth = aa->depth; unsigned i; KMP_DEBUG_ASSERT(depth == bb->depth); |