Skip to content

Commit

Permalink
Unconstify STRING* to partially unbroke c++ build. plobsing++
Browse files Browse the repository at this point in the history
  • Loading branch information
bacek committed Dec 26, 2010
1 parent 1648804 commit 0ed95be
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion include/parrot/dynext.h
Expand Up @@ -48,7 +48,7 @@ PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * Parrot_dyn_load_lib(PARROT_INTERP,
ARGIN_NULLOK(const STRING *lib),
ARGIN_NULLOK(STRING *lib),
ARGIN_NULLOK(PMC *parameters))
__attribute__nonnull__(1);

Expand Down
50 changes: 24 additions & 26 deletions src/dynext.c
Expand Up @@ -50,7 +50,7 @@ static void * dlopen_string(PARROT_INTERP,
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
static STRING * get_path(PARROT_INTERP,
ARGIN(const STRING *lib),
ARGIN(STRING *lib),
Parrot_dlopen_flags flags,
ARGOUT(void **handle),
ARGIN(const STRING *wo_ext),
Expand All @@ -64,15 +64,15 @@ static STRING * get_path(PARROT_INTERP,

PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
static PMC* is_loaded(PARROT_INTERP, ARGIN(const STRING *path))
static PMC* is_loaded(PARROT_INTERP, ARGIN(STRING *path))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

PARROT_CANNOT_RETURN_NULL
static PMC * run_init_lib(PARROT_INTERP,
ARGIN(void *handle),
ARGIN(const STRING *lib_name),
ARGIN(const STRING *wo_ext))
ARGIN(STRING *lib_name),
ARGIN(STRING *wo_ext))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
Expand All @@ -81,7 +81,7 @@ static PMC * run_init_lib(PARROT_INTERP,
static void set_cstring_prop(PARROT_INTERP,
ARGMOD(PMC *lib_pmc),
ARGIN(const char *what),
ARGIN(const STRING *name))
ARGIN(STRING *name))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
Expand All @@ -90,9 +90,9 @@ static void set_cstring_prop(PARROT_INTERP,

static void store_lib_pmc(PARROT_INTERP,
ARGIN(PMC *lib_pmc),
ARGIN(const STRING *path),
ARGIN(const STRING *type),
ARGIN(const STRING *lib_name))
ARGIN(STRING *path),
ARGIN(STRING *type),
ARGIN(STRING *lib_name))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
Expand Down Expand Up @@ -140,7 +140,7 @@ static void store_lib_pmc(PARROT_INTERP,
/*
=item C<static void set_cstring_prop(PARROT_INTERP, PMC *lib_pmc, const char
*what, const STRING *name)>
*what, STRING *name)>
Sets a property C<name> with value C<what> on the C<ParrotLibrary> C<lib_pmc>.
Expand All @@ -150,7 +150,7 @@ Sets a property C<name> with value C<what> on the C<ParrotLibrary> C<lib_pmc>.

static void
set_cstring_prop(PARROT_INTERP, ARGMOD(PMC *lib_pmc), ARGIN(const char *what),
ARGIN(const STRING *name))
ARGIN(STRING *name))
{
ASSERT_ARGS(set_cstring_prop)
STRING * const key = Parrot_str_new_constant(interp, what);
Expand All @@ -163,8 +163,8 @@ set_cstring_prop(PARROT_INTERP, ARGMOD(PMC *lib_pmc), ARGIN(const char *what),

/*
=item C<static void store_lib_pmc(PARROT_INTERP, PMC *lib_pmc, const STRING
*path, const STRING *type, const STRING *lib_name)>
=item C<static void store_lib_pmc(PARROT_INTERP, PMC *lib_pmc, STRING *path,
STRING *type, STRING *lib_name)>
Stores a C<ParrotLibrary> PMC in the interpreter's C<iglobals>.
Expand All @@ -173,8 +173,8 @@ Stores a C<ParrotLibrary> PMC in the interpreter's C<iglobals>.
*/

static void
store_lib_pmc(PARROT_INTERP, ARGIN(PMC *lib_pmc), ARGIN(const STRING *path),
ARGIN(const STRING *type), ARGIN(const STRING *lib_name))
store_lib_pmc(PARROT_INTERP, ARGIN(PMC *lib_pmc), ARGIN(STRING *path),
ARGIN(STRING *type), ARGIN(STRING *lib_name))
{
ASSERT_ARGS(store_lib_pmc)
PMC * const iglobals = interp->iglobals;
Expand All @@ -194,7 +194,7 @@ store_lib_pmc(PARROT_INTERP, ARGIN(PMC *lib_pmc), ARGIN(const STRING *path),

/*
=item C<static PMC* is_loaded(PARROT_INTERP, const STRING *path)>
=item C<static PMC* is_loaded(PARROT_INTERP, STRING *path)>
Returns a C<ParrotLibrary> PMC with the given filename path, if it exists.
Otherwise returns PMCNULL.
Expand All @@ -206,7 +206,7 @@ Otherwise returns PMCNULL.
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
static PMC*
is_loaded(PARROT_INTERP, ARGIN(const STRING *path))
is_loaded(PARROT_INTERP, ARGIN(STRING *path))
{
ASSERT_ARGS(is_loaded)
PMC * const iglobals = interp->iglobals;
Expand Down Expand Up @@ -244,9 +244,8 @@ dlopen_string(PARROT_INTERP, Parrot_dlopen_flags flags, ARGIN(const STRING *path

/*
=item C<static STRING * get_path(PARROT_INTERP, const STRING *lib,
Parrot_dlopen_flags flags, void **handle, const STRING *wo_ext, const STRING
*ext)>
=item C<static STRING * get_path(PARROT_INTERP, STRING *lib, Parrot_dlopen_flags
flags, void **handle, const STRING *wo_ext, const STRING *ext)>
Returns path and handle of a dynamic lib, setting lib_name to just the filestem
(i.e. without path or extension) as a freshly-allocated C string.
Expand All @@ -258,7 +257,7 @@ Returns path and handle of a dynamic lib, setting lib_name to just the filestem
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
static STRING *
get_path(PARROT_INTERP, ARGIN(const STRING *lib), Parrot_dlopen_flags flags,
get_path(PARROT_INTERP, ARGIN(STRING *lib), Parrot_dlopen_flags flags,
ARGOUT(void **handle), ARGIN(const STRING *wo_ext), ARGIN(const STRING *ext))
{
ASSERT_ARGS(get_path)
Expand Down Expand Up @@ -453,8 +452,8 @@ Parrot_dyn_dlsym_str(PARROT_INTERP,

/*
=item C<static PMC * run_init_lib(PARROT_INTERP, void *handle, const STRING
*lib_name, const STRING *wo_ext)>
=item C<static PMC * run_init_lib(PARROT_INTERP, void *handle, STRING *lib_name,
STRING *wo_ext)>
Loads and initializes a new library and returns a ParrotLibrary PMC. Takes the
name of a library C<lib_name>, that is loaded with handle C<handle>. Calls the
Expand All @@ -467,7 +466,7 @@ necessary initialization routines, if any.
PARROT_CANNOT_RETURN_NULL
static PMC *
run_init_lib(PARROT_INTERP, ARGIN(void *handle),
ARGIN(const STRING *lib_name), ARGIN(const STRING *wo_ext))
ARGIN(STRING *lib_name), ARGIN(STRING *wo_ext))
{
ASSERT_ARGS(run_init_lib)
STRING *type;
Expand Down Expand Up @@ -621,8 +620,7 @@ Parrot_dyn_clone_lib_into(ARGMOD(Interp *d), ARGMOD(Interp *s), ARGIN(PMC *lib_p

/*
=item C<PMC * Parrot_dyn_load_lib(PARROT_INTERP, const STRING *lib, PMC
*parameters)>
=item C<PMC * Parrot_dyn_load_lib(PARROT_INTERP, STRING *lib, PMC *parameters)>
Dynamic library loader.
Expand Down Expand Up @@ -652,7 +650,7 @@ PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC *
Parrot_dyn_load_lib(PARROT_INTERP,
ARGIN_NULLOK(const STRING *lib),
ARGIN_NULLOK(STRING *lib),
ARGIN_NULLOK(PMC *parameters))
{
ASSERT_ARGS(Parrot_dyn_load_lib)
Expand Down

0 comments on commit 0ed95be

Please sign in to comment.