aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/kmp_environment.h
diff options
context:
space:
mode:
authorJonas Hahnfeld <hahnjo@hahnjo.de>2017-11-09 15:52:25 +0000
committerJonas Hahnfeld <hahnjo@hahnjo.de>2017-11-09 15:52:25 +0000
commit11bae5e490bd5c074615e1bb8e96382119e885c2 (patch)
tree9c0f9d6fede68946a311988a5615586f75ed6ceb /runtime/src/kmp_environment.h
parentf0158dae294aaca4673e6a053e5897c14ffe7ce1 (diff)
Remove const from variables with dynamic memory
Allocated memory is typically not 'const' if it needs to be freed. This patch removes around 50 wrong const attributes, modifies the corresponding functions and finally gets rid of some const_casts. These have especially been strange for __kmp_str_fname_free() that added a 'const' to call __kmp_str_free() which removed it again. Two minor cleanups that I performed in this process: * __kmp_tool_libraries now lives in kmp_settings.cpp as it is used nowhere else. * __kmp_msg_empty was removed as it was never used and Clang now complained that it was assigned a string literal that is 'const char *'. Differential Revision: https://reviews.llvm.org/D39755 git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@317797 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/src/kmp_environment.h')
-rw-r--r--runtime/src/kmp_environment.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/src/kmp_environment.h b/runtime/src/kmp_environment.h
index e07c1bd..474aa34 100644
--- a/runtime/src/kmp_environment.h
+++ b/runtime/src/kmp_environment.h
@@ -52,14 +52,14 @@ __kmp_env_block_free( & block );
*/
struct __kmp_env_var {
- char const *name;
- char const *value;
+ char *name;
+ char *value;
};
typedef struct __kmp_env_var kmp_env_var_t;
struct __kmp_env_blk {
- char const *bulk;
- kmp_env_var_t const *vars;
+ char *bulk;
+ kmp_env_var_t *vars;
int count;
};
typedef struct __kmp_env_blk kmp_env_blk_t;