OpenMP RTL cleanup: eliminated warnings with -Wcast-qual.

Changes are: replaced C-style casts with cons_cast and reinterpret_cast;
type of several counters changed to signed; type of parameters of 32-bit and
64-bit AND and OR intrinsics changes to unsigned; changed files formatted
using clang-format version 3.8.1.

Differential Revision: https://reviews.llvm.org/D34759


git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@307020 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrey Churbanov
2017-07-03 11:24:08 +00:00
parent 5e8afb8077
commit 1c31fdada0
22 changed files with 376 additions and 349 deletions
+8 -6
View File
@@ -1460,7 +1460,8 @@ static inline void __kmp_suspend_template(int th_gtid, C *flag) {
th->th.th_active = FALSE;
if (th->th.th_active_in_pool) {
th->th.th_active_in_pool = FALSE;
KMP_TEST_THEN_DEC32((kmp_int32 *)&__kmp_thread_pool_active_nth);
KMP_TEST_THEN_DEC32(
CCAST(kmp_int32 *, &__kmp_thread_pool_active_nth));
KMP_DEBUG_ASSERT(TCR_4(__kmp_thread_pool_active_nth) >= 0);
}
deactivated = TRUE;
@@ -1516,7 +1517,7 @@ static inline void __kmp_suspend_template(int th_gtid, C *flag) {
if (deactivated) {
th->th.th_active = TRUE;
if (TCR_4(th->th.th_in_pool)) {
KMP_TEST_THEN_INC32((kmp_int32 *)&__kmp_thread_pool_active_nth);
KMP_TEST_THEN_INC32(CCAST(kmp_int32 *, &__kmp_thread_pool_active_nth));
th->th.th_active_in_pool = TRUE;
}
}
@@ -1568,7 +1569,7 @@ static inline void __kmp_resume_template(int target_gtid, C *flag) {
KMP_CHECK_SYSFAIL("pthread_mutex_lock", status);
if (!flag) { // coming from __kmp_null_resume_wrapper
flag = (C *)th->th.th_sleep_loc;
flag = (C *)CCAST(void *, th->th.th_sleep_loc);
}
// First, check if the flag is null or its type has changed. If so, someone
@@ -1801,8 +1802,8 @@ static int __kmp_get_xproc(void) {
mach_msg_type_number_t num = HOST_BASIC_INFO_COUNT;
rc = host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)&info, &num);
if (rc == 0 && num == HOST_BASIC_INFO_COUNT) {
// Cannot use KA_TRACE() here because this code works before trace support is
// initialized.
// Cannot use KA_TRACE() here because this code works before trace support
// is initialized.
r = info.avail_cpus;
} else {
KMP_WARNING(CantGetNumAvailCPU);
@@ -2315,7 +2316,8 @@ finish: // Clean up and exit.
#endif // USE_LOAD_BALANCE
#if !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_MIC || ((KMP_OS_LINUX || KMP_OS_DARWIN) && KMP_ARCH_AARCH64) || KMP_ARCH_PPC64)
#if !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_MIC || \
((KMP_OS_LINUX || KMP_OS_DARWIN) && KMP_ARCH_AARCH64) || KMP_ARCH_PPC64)
// we really only need the case with 1 argument, because CLANG always build
// a struct of pointers to shared variables referenced in the outlined function