Skip to content

Commit

Permalink
fix const warnings in library.c
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/trunk@8803 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
Leopold Toetsch committed Aug 4, 2005
1 parent 5a45e8a commit 2016a0a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/library.c
Expand Up @@ -189,6 +189,10 @@ Parrot_locate_runtime_file(Interp *interpreter, const char *file_name,
const char **paths;
int length;

union {
const void * __c_ptr;
void * __ptr;
} __ptr_u;
if (type & PARROT_RUNTIME_FT_DYNEXT)
paths = dynext_paths;
else if (type & (PARROT_RUNTIME_FT_PBC | PARROT_RUNTIME_FT_SOURCE))
Expand Down Expand Up @@ -287,7 +291,7 @@ Parrot_locate_runtime_file(Interp *interpreter, const char *file_name,
str = string_from_cstring(interpreter, full_name, strlen(full_name));
if (Parrot_stat_info_intval(interpreter, str, STAT_EXISTS)) {
if (free_prefix)
string_cstring_free(prefix);
string_cstring_free(const_cast(prefix));
return full_name;
}

Expand All @@ -307,7 +311,7 @@ Parrot_locate_runtime_file(Interp *interpreter, const char *file_name,
/* Fix up any forward slashes. */
while ((p = strchr(parrot_path, '/')))
*p = '\\';

/* And try it. */
str = string_from_cstring(interpreter, parrot_path, strlen(parrot_path));
if (Parrot_stat_info_intval(interpreter, str, STAT_EXISTS)) {
Expand Down Expand Up @@ -339,12 +343,12 @@ Parrot_locate_runtime_file(Interp *interpreter, const char *file_name,
str = string_from_cstring(interpreter, full_name, strlen(full_name));
if (Parrot_stat_info_intval(interpreter, str, STAT_EXISTS)) {
if (free_prefix)
string_cstring_free(prefix);
string_cstring_free(const_cast(prefix));
return full_name;
}
}
if (free_prefix)
string_cstring_free(prefix);
string_cstring_free(const_cast(prefix));
return NULL;
}

Expand Down

0 comments on commit 2016a0a

Please sign in to comment.