diff options
author | Jonas Hahnfeld <hahnjo@hahnjo.de> | 2017-11-09 15:52:29 +0000 |
---|---|---|
committer | Jonas Hahnfeld <hahnjo@hahnjo.de> | 2017-11-09 15:52:29 +0000 |
commit | e9b7c0a39280e66926c8f89c78b9db048aaff6bb (patch) | |
tree | 32dc785a60666f2d6b278996d5c4b25acab18776 | |
parent | aeb40adabf18d517fa27085d3e39cb2b93eb7648 (diff) | |
download | bcm5719-llvm-e9b7c0a39280e66926c8f89c78b9db048aaff6bb.tar.gz bcm5719-llvm-e9b7c0a39280e66926c8f89c78b9db048aaff6bb.zip |
Add const to some variables to avoid const_casts
In these places the const attribute seems correct and doesn't
need any other change, so let's do it.
Differential Revision: https://reviews.llvm.org/D39756
llvm-svn: 317798
-rw-r--r-- | openmp/runtime/src/kmp_settings.cpp | 8 | ||||
-rw-r--r-- | openmp/runtime/src/kmp_utility.cpp | 5 |
2 files changed, 6 insertions, 7 deletions
diff --git a/openmp/runtime/src/kmp_settings.cpp b/openmp/runtime/src/kmp_settings.cpp index 66afa09fd8e..60f5da7b13d 100644 --- a/openmp/runtime/src/kmp_settings.cpp +++ b/openmp/runtime/src/kmp_settings.cpp @@ -3298,15 +3298,15 @@ static void __kmp_stg_parse_schedule(char const *name, char const *value, if (length > INT_MAX) { KMP_WARNING(LongValue, name); } else { - char *semicolon; + const char *semicolon; if (value[length - 1] == '"' || value[length - 1] == '\'') KMP_WARNING(UnbalancedQuotes, name); do { char sentinel; - semicolon = CCAST(char *, strchr(value, ';')); + semicolon = strchr(value, ';'); if (*value && semicolon != value) { - char *comma = CCAST(char *, strchr(value, ',')); + const char *comma = strchr(value, ','); if (comma) { ++comma; @@ -3371,7 +3371,7 @@ static void __kmp_stg_parse_omp_schedule(char const *name, char const *value, if (value) { length = KMP_STRLEN(value); if (length) { - char *comma = CCAST(char *, strchr(value, ',')); + const char *comma = strchr(value, ','); if (value[length - 1] == '"' || value[length - 1] == '\'') KMP_WARNING(UnbalancedQuotes, name); /* get the specified scheduling style */ diff --git a/openmp/runtime/src/kmp_utility.cpp b/openmp/runtime/src/kmp_utility.cpp index f41c8993d1a..06090e624c7 100644 --- a/openmp/runtime/src/kmp_utility.cpp +++ b/openmp/runtime/src/kmp_utility.cpp @@ -96,14 +96,13 @@ static kmp_uint64 __kmp_parse_frequency( // R: Frequency in Hz. ) { double value = 0.0; - char const *unit = NULL; + char *unit = NULL; kmp_uint64 result = 0; /* Zero is a better unknown value than all ones. */ if (frequency == NULL) { return result; } - value = strtod(frequency, - CCAST(char **, &unit)); // strtod() does not like "const" + value = strtod(frequency, &unit); if (0 < value && value <= DBL_MAX) { // Good value (not overflow, underflow, etc). if (strcmp(unit, "MHz") == 0) { |