Index: openmp/trunk/runtime/src/kmp.h =================================================================== --- openmp/trunk/runtime/src/kmp.h +++ openmp/trunk/runtime/src/kmp.h @@ -744,7 +744,7 @@ extern void __kmp_affinity_bind_thread(int which); extern kmp_affin_mask_t *__kmp_affin_fullMask; -extern char const *__kmp_cpuinfo_file; +extern char *__kmp_cpuinfo_file; #endif /* KMP_AFFINITY_SUPPORTED */ @@ -802,10 +802,6 @@ extern int __kmp_hws_requested; extern int __kmp_hws_abs_flag; // absolute or per-item number requested -#if OMP_50_ENABLED && LIBOMP_OMPT_SUPPORT -extern char const *__kmp_tool_libraries; -#endif // OMP_50_ENABLED && LIBOMP_OMPT_SUPPORT - /* ------------------------------------------------------------------------ */ #define KMP_PAD(type, sz) \ Index: openmp/trunk/runtime/src/kmp_dispatch.cpp =================================================================== --- openmp/trunk/runtime/src/kmp_dispatch.cpp +++ openmp/trunk/runtime/src/kmp_dispatch.cpp @@ -368,7 +368,7 @@ KMP_MB(); #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_deo: T#%%d before wait: " "ordered_iter:%%%s lower:%%%s\n", @@ -383,7 +383,7 @@ KMP_MB(); /* is this necessary? */ #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_deo: T#%%d after wait: " "ordered_iter:%%%s lower:%%%s\n", @@ -548,7 +548,7 @@ #endif #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_init: T#%%d called: schedule:%%d " "chunk:%%%s lb:%%%s ub:%%%s st:%%%s\n", @@ -638,7 +638,7 @@ #endif #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format( "__kmp_dispatch_init: T#%%d new: schedule:%%d chunk:%%%s\n", @@ -661,7 +661,7 @@ schedule = __kmp_auto; #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_init: kmp_sch_auto: T#%%d new: " "schedule:%%d chunk:%%%s\n", @@ -697,7 +697,7 @@ #endif #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_init: T#%%d new: schedule:%%d" " chunk:%%%s\n", @@ -1196,7 +1196,7 @@ #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format( "__kmp_dispatch_init: T#%%d returning: schedule:%%d ordered:%%%s " @@ -1276,7 +1276,7 @@ #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_finish: T#%%d before wait: " "ordered_iteration:%%%s lower:%%%s\n", @@ -1291,7 +1291,7 @@ KMP_MB(); /* is this necessary? */ #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_finish: T#%%d after wait: " "ordered_iteration:%%%s lower:%%%s\n", @@ -1344,7 +1344,7 @@ #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format( "__kmp_dispatch_finish_chunk: T#%%d before wait: " @@ -1366,7 +1366,7 @@ //!!!!! TODO check if the inc should be unsigned, or signed??? #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format( "__kmp_dispatch_finish_chunk: T#%%d after wait: " @@ -1435,7 +1435,7 @@ KMP_DEBUG_ASSERT(p_lb && p_ub && p_st); // AC: these cannot be NULL #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_next: T#%%d called p_lb:%%%s " "p_ub:%%%s p_st:%%%s p_last: %%p\n", @@ -1517,7 +1517,7 @@ pr->u.p.ordered_upper = limit; #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_next: T#%%d " "ordered_lower:%%%s ordered_upper:%%%s\n", @@ -1543,7 +1543,7 @@ } // if #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format( "__kmp_dispatch_next: T#%%d serialized case: p_lb:%%%s " @@ -1810,7 +1810,7 @@ pr->u.p.ordered_upper = limit; #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_next: T#%%d " "ordered_lower:%%%s ordered_upper:%%%s\n", @@ -1843,7 +1843,7 @@ if (pr->ordered) { #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_next: T#%%d " "ordered_lower:%%%s ordered_upper:%%%s\n", @@ -1895,7 +1895,7 @@ pr->u.p.ordered_upper = limit; #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_next: T#%%d " "ordered_lower:%%%s ordered_upper:%%%s\n", @@ -1949,7 +1949,7 @@ pr->u.p.ordered_upper = limit; #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_next: T#%%d " "ordered_lower:%%%s ordered_upper:%%%s\n", @@ -2022,7 +2022,7 @@ pr->u.p.ordered_upper = limit; #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_next: T#%%d " "ordered_lower:%%%s ordered_upper:%%%s\n", @@ -2106,7 +2106,7 @@ pr->u.p.ordered_upper = limit; #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_next: T#%%d " "ordered_lower:%%%s ordered_upper:%%%s\n", @@ -2214,7 +2214,7 @@ pr->u.p.ordered_upper = limit; #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_next: T#%%d " "ordered_lower:%%%s ordered_upper:%%%s\n", @@ -2276,7 +2276,7 @@ pr->u.p.ordered_upper = limit; #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_dispatch_next: T#%%d " "ordered_lower:%%%s ordered_upper:%%%s\n", @@ -2306,7 +2306,7 @@ num_done = test_then_inc((volatile ST *)&sh->u.s.num_done); #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format( "__kmp_dispatch_next: T#%%d increment num_done:%%%s\n", @@ -2375,7 +2375,7 @@ #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format( "__kmp_dispatch_next: T#%%d normal case: " @@ -2408,7 +2408,7 @@ KE_TRACE(10, ("__kmpc_dist_get_bounds called (%d)\n", gtid)); #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmpc_dist_get_bounds: T#%%d liter=%%d " "iter=(%%%s, %%%s, %%%s) signed?<%s>\n", Index: openmp/trunk/runtime/src/kmp_environment.h =================================================================== --- openmp/trunk/runtime/src/kmp_environment.h +++ openmp/trunk/runtime/src/kmp_environment.h @@ -52,14 +52,14 @@ */ 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; Index: openmp/trunk/runtime/src/kmp_error.cpp =================================================================== --- openmp/trunk/runtime/src/kmp_error.cpp +++ openmp/trunk/runtime/src/kmp_error.cpp @@ -75,7 +75,7 @@ } // NOTE: Function returns allocated memory, caller must free it! -static char const *__kmp_pragma(int ct, ident_t const *ident) { +static char *__kmp_pragma(int ct, ident_t const *ident) { char const *cons = NULL; // Construct name. char *file = NULL; // File name. char *func = NULL; // Function (routine) name. @@ -110,9 +110,9 @@ enum cons_type ct, // Construct type. ident_t const *ident // Construct ident. ) { - char const *construct = __kmp_pragma(ct, ident); + char *construct = __kmp_pragma(ct, ident); __kmp_fatal(__kmp_msg_format(id, construct), __kmp_msg_null); - KMP_INTERNAL_FREE(CCAST(char *, construct)); + KMP_INTERNAL_FREE(construct); } void __kmp_error_construct2(kmp_i18n_id_t id, // Message identifier. @@ -120,11 +120,11 @@ ident_t const *ident, // First construct ident. struct cons_data const *cons // Second construct. ) { - char const *construct1 = __kmp_pragma(ct, ident); - char const *construct2 = __kmp_pragma(cons->type, cons->ident); + char *construct1 = __kmp_pragma(ct, ident); + char *construct2 = __kmp_pragma(cons->type, cons->ident); __kmp_fatal(__kmp_msg_format(id, construct1, construct2), __kmp_msg_null); - KMP_INTERNAL_FREE(CCAST(char *, construct1)); - KMP_INTERNAL_FREE(CCAST(char *, construct2)); + KMP_INTERNAL_FREE(construct1); + KMP_INTERNAL_FREE(construct2); } struct cons_header *__kmp_allocate_cons_stack(int gtid) { Index: openmp/trunk/runtime/src/kmp_global.cpp =================================================================== --- openmp/trunk/runtime/src/kmp_global.cpp +++ openmp/trunk/runtime/src/kmp_global.cpp @@ -271,7 +271,7 @@ kmp_affin_mask_t *__kmp_affinity_masks = NULL; unsigned __kmp_affinity_num_masks = 0; -char const *__kmp_cpuinfo_file = NULL; +char *__kmp_cpuinfo_file = NULL; #endif /* KMP_AFFINITY_SUPPORTED */ @@ -298,10 +298,6 @@ kmp_uint64 __kmp_taskloop_min_tasks = 0; #endif -#if OMP_50_ENABLED && OMPT_SUPPORT -char const *__kmp_tool_libraries = NULL; -#endif - /* This check ensures that the compiler is passing the correct data type for the flags formal parameter of the function kmpc_omp_task_alloc(). If the type is not a 4-byte type, then give an error message about a non-positive length Index: openmp/trunk/runtime/src/kmp_i18n.h =================================================================== --- openmp/trunk/runtime/src/kmp_i18n.h +++ openmp/trunk/runtime/src/kmp_i18n.h @@ -103,16 +103,13 @@ struct kmp_msg { kmp_msg_type_t type; int num; - char const *str; + char *str; int len; }; // struct kmp_message typedef struct kmp_msg kmp_msg_t; -// Two special messages. -extern kmp_msg_t __kmp_msg_empty; // Can be used in place where message is -// required syntactically. -extern kmp_msg_t - __kmp_msg_null; // Denotes the end of variadic list of arguments. +// Special message to denote the end of variadic list of arguments. +extern kmp_msg_t __kmp_msg_null; // Helper functions. Creates messages either from message catalog or from // system. Note: these functions allocate memory. You should pass created Index: openmp/trunk/runtime/src/kmp_i18n.cpp =================================================================== --- openmp/trunk/runtime/src/kmp_i18n.cpp +++ openmp/trunk/runtime/src/kmp_i18n.cpp @@ -34,7 +34,6 @@ #define get_section(id) ((id) >> 16) #define get_number(id) ((id)&0xFFFF) -kmp_msg_t __kmp_msg_empty = {kmp_mt_dummy, 0, "", 0}; kmp_msg_t __kmp_msg_null = {kmp_mt_dummy, 0, NULL, 0}; static char const *no_message_available = "(No message available)"; @@ -821,9 +820,6 @@ if (message.type == kmp_mt_dummy && message.str == NULL) { break; } - if (message.type == kmp_mt_dummy && message.str == __kmp_msg_empty.str) { - continue; - } switch (message.type) { case kmp_mt_hint: { format = kmp_i18n_fmt_Hint; Index: openmp/trunk/runtime/src/kmp_itt.inl =================================================================== --- openmp/trunk/runtime/src/kmp_itt.inl +++ openmp/trunk/runtime/src/kmp_itt.inl @@ -115,7 +115,7 @@ // Transform compiler-generated region location into the format // that the tools more or less standardized on: // "$omp$parallel@[file:][:]" - const char *buff = NULL; + char *buff = NULL; kmp_str_loc_t str_loc = __kmp_str_loc_init(loc->psource, 1); buff = __kmp_str_format("%s$omp$parallel:%d@%s:%d:%d", str_loc.func, team_size, str_loc.file, str_loc.line, @@ -135,7 +135,7 @@ &__kmp_barrier_domain_count); // revert the count return; // loc->reserved_2 is still 0 } - const char *buff = NULL; + char *buff = NULL; buff = __kmp_str_format("%s$omp$barrier@%s:%d", str_loc.func, str_loc.file, str_loc.col); __itt_suppress_push(__itt_suppress_memory_errors); @@ -155,7 +155,7 @@ unsigned int frm = (loc->reserved_2 & 0x0000FFFF) - 1; if ((frm < KMP_MAX_FRAME_DOMAINS) && (__kmp_itt_region_team_size[frm] != team_size)) { - const char *buff = NULL; + char *buff = NULL; kmp_str_loc_t str_loc = __kmp_str_loc_init(loc->psource, 1); buff = __kmp_str_format("%s$omp$parallel:%d@%s:%d:%d", str_loc.func, team_size, str_loc.file, str_loc.line, @@ -212,7 +212,7 @@ // Transform compiler-generated region location into the format // that the tools more or less standardized on: // "$omp$parallel:team_size@[file:][:]" - const char *buff = NULL; + char *buff = NULL; kmp_str_loc_t str_loc = __kmp_str_loc_init(loc->psource, 1); buff = __kmp_str_format("%s$omp$parallel:%d@%s:%d:%d", str_loc.func, team_size, str_loc.file, str_loc.line, @@ -233,7 +233,7 @@ unsigned int frm = (loc->reserved_2 & 0x0000FFFF) - 1; if ((frm < KMP_MAX_FRAME_DOMAINS) && (__kmp_itt_region_team_size[frm] != team_size)) { - const char *buff = NULL; + char *buff = NULL; kmp_str_loc_t str_loc = __kmp_str_loc_init(loc->psource, 1); buff = __kmp_str_format("%s$omp$parallel:%d@%s:%d:%d", str_loc.func, team_size, str_loc.file, str_loc.line, @@ -275,7 +275,7 @@ // "$omp$frame@[file:][:]" kmp_str_loc_t str_loc = __kmp_str_loc_init(loc->psource, 1); if (imbalance) { - const char *buff_imb = NULL; + char *buff_imb = NULL; buff_imb = __kmp_str_format("%s$omp$barrier-imbalance:%d@%s:%d", str_loc.func, team_size, str_loc.file, str_loc.col); @@ -286,7 +286,7 @@ end); __kmp_str_free(&buff_imb); } else { - const char *buff = NULL; + char *buff = NULL; buff = __kmp_str_format("%s$omp$barrier@%s:%d", str_loc.func, str_loc.file, str_loc.col); __itt_suppress_push(__itt_suppress_memory_errors); Index: openmp/trunk/runtime/src/kmp_sched.cpp =================================================================== --- openmp/trunk/runtime/src/kmp_sched.cpp +++ openmp/trunk/runtime/src/kmp_sched.cpp @@ -93,7 +93,7 @@ KE_TRACE(10, ("__kmpc_for_static_init called (%d)\n", global_tid)); #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format( "__kmpc_for_static_init: T#%%d sched=%%d liter=%%d iter=(%%%s," @@ -125,7 +125,7 @@ // ON A ZERO-TRIP LOOP (lower=1, upper=0,stride=1) - JPH June 23, 2009. #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmpc_for_static_init:(ZERO TRIP) liter=%%d " "lower=%%%s upper=%%%s stride = %%%s " @@ -179,7 +179,7 @@ #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmpc_for_static_init: (serial) liter=%%d " "lower=%%%s upper=%%%s stride = %%%s\n", @@ -208,7 +208,7 @@ (incr > 0) ? (*pupper - *plower + 1) : (-(*plower - *pupper + 1)); #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmpc_for_static_init: (serial) liter=%%d " "lower=%%%s upper=%%%s stride = %%%s\n", @@ -365,7 +365,7 @@ #endif #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmpc_for_static_init: liter=%%d lower=%%%s " "upper=%%%s stride = %%%s signed?<%s>\n", @@ -410,7 +410,7 @@ KE_TRACE(10, ("__kmpc_dist_for_static_init called (%d)\n", gtid)); #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format( "__kmpc_dist_for_static_init: T#%%d schedLoop=%%d liter=%%d " @@ -613,7 +613,7 @@ end:; #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format( "__kmpc_dist_for_static_init: last=%%d lo=%%%s up=%%%s upDist=%%%s " @@ -654,7 +654,7 @@ KE_TRACE(10, ("__kmp_team_static_init called (%d)\n", gtid)); #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_team_static_init enter: T#%%d liter=%%d " "iter=(%%%s, %%%s, %%%s) chunk %%%s; signed?<%s>\n", @@ -728,7 +728,7 @@ } #ifdef KMP_DEBUG { - const char *buff; + char *buff; // create format specifiers before the debug output buff = __kmp_str_format("__kmp_team_static_init exit: T#%%d team%%u liter=%%d " Index: openmp/trunk/runtime/src/kmp_settings.cpp =================================================================== --- openmp/trunk/runtime/src/kmp_settings.cpp +++ openmp/trunk/runtime/src/kmp_settings.cpp @@ -335,7 +335,7 @@ } // __kmp_stg_parse_size static void __kmp_stg_parse_str(char const *name, char const *value, - char const **out) { + char **out) { __kmp_str_free(out); *out = __kmp_str_format("%s", value); } // __kmp_stg_parse_str @@ -2180,7 +2180,7 @@ #undef set_respect #undef set_granularity - __kmp_str_free(CCAST(const char **, &buffer)); + __kmp_str_free(&buffer); if (proclist) { if (!type) { @@ -4354,6 +4354,8 @@ #if OMP_50_ENABLED && OMPT_SUPPORT +static char *__kmp_tool_libraries = NULL; + static void __kmp_stg_parse_omp_tool_libraries(char const *name, char const *value, void *data) { __kmp_stg_parse_str(name, value, &__kmp_tool_libraries); Index: openmp/trunk/runtime/src/kmp_str.h =================================================================== --- openmp/trunk/runtime/src/kmp_str.h +++ openmp/trunk/runtime/src/kmp_str.h @@ -103,7 +103,7 @@ int __kmp_str_eqf(char const *lhs, char const *rhs); char *__kmp_str_format(char const *format, ...); -void __kmp_str_free(char const **str); +void __kmp_str_free(char **str); int __kmp_str_match(char const *target, int len, char const *data); int __kmp_str_match_false(char const *data); int __kmp_str_match_true(char const *data); Index: openmp/trunk/runtime/src/kmp_str.cpp =================================================================== --- openmp/trunk/runtime/src/kmp_str.cpp +++ openmp/trunk/runtime/src/kmp_str.cpp @@ -255,9 +255,9 @@ } // kmp_str_fname_init void __kmp_str_fname_free(kmp_str_fname_t *fname) { - __kmp_str_free(CCAST(char const **, &fname->path)); - __kmp_str_free(CCAST(char const **, &fname->dir)); - __kmp_str_free(CCAST(char const **, &fname->base)); + __kmp_str_free(&fname->path); + __kmp_str_free(&fname->dir); + __kmp_str_free(&fname->base); } // kmp_str_fname_free int __kmp_str_fname_match(kmp_str_fname_t const *fname, char const *pattern) { @@ -325,7 +325,7 @@ void __kmp_str_loc_free(kmp_str_loc_t *loc) { __kmp_str_fname_free(&loc->fname); - __kmp_str_free(CCAST(const char **, &(loc->_bulk))); + __kmp_str_free(&(loc->_bulk)); loc->file = NULL; loc->func = NULL; } // kmp_str_loc_free @@ -424,9 +424,9 @@ return buffer; } // func __kmp_str_format -void __kmp_str_free(char const **str) { +void __kmp_str_free(char **str) { KMP_DEBUG_ASSERT(str != NULL); - KMP_INTERNAL_FREE(CCAST(char *, *str)); + KMP_INTERNAL_FREE(*str); *str = NULL; } // func __kmp_str_free Index: openmp/trunk/runtime/src/ompt-general.cpp =================================================================== --- openmp/trunk/runtime/src/ompt-general.cpp +++ openmp/trunk/runtime/src/ompt-general.cpp @@ -214,9 +214,9 @@ // Try tool-libraries-var ICV const char *tool_libs = getenv("OMP_TOOL_LIBRARIES"); if (tool_libs) { - const char *libs = __kmp_str_format("%s", tool_libs); + char *libs = __kmp_str_format("%s", tool_libs); char *buf; - char *fname = __kmp_str_token(CCAST(char *, libs), sep, &buf); + char *fname = __kmp_str_token(libs, sep, &buf); while (fname) { #if KMP_OS_UNIX void *h = dlopen(fname, RTLD_LAZY);