Skip to content

Commit

Permalink
Merge branch 'master' into nwellnhof/string_unescape
Browse files Browse the repository at this point in the history
Conflicts:
	DEPRECATED.pod
  • Loading branch information
nwellnhof committed Dec 28, 2010
2 parents ef08407 + e132190 commit 2ceb0e8
Show file tree
Hide file tree
Showing 18 changed files with 199 additions and 74 deletions.
9 changes: 8 additions & 1 deletion CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ N: Dave Woldrich
D: Win32 build fixes
E: dave@woldrich.com

N: David Czech
U: kapace
E: davidczech510@gmail.com
D: increasing EventHandler test coverage

N: David M. Lloyd
U: dmlloyd
E: dmlloyd@tds.net
Expand Down Expand Up @@ -712,7 +717,9 @@ N: Matt Kennedy
D: Some Env PMC method implementations and tests

N: Matt Rajca
D: Code refactoring
E: mattmatt.rajca@me.com
A: mattrajca
D: Code refactoring, increasing test coverage

N: Mattia Barbon
D: Win32 fixes, dynamic PMC creation and loading
Expand Down
26 changes: 12 additions & 14 deletions DEPRECATED.pod
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,6 @@ These will be changed to allow more flexibility in types.

L<https://trac.parrot.org/parrot/ticket/1565>

=item inplace string updates. [eligible in 2.4]

All "inplace" string update ops are deprecated. E.g. "chopn_s", etc.
Part of COW removal.

L<https://trac.parrot.org/parrot/ticket/1540>

=item finalize [experimental]

Finalize exception handler, unrolling inner runloops if needed.
Expand Down Expand Up @@ -324,13 +317,6 @@ this rather than relying on in-place modification of an existing pointer.

L<https://trac.parrot.org/parrot/ticket/1584>

=item STRING COW [eligible in 2.4]

COW strings are to be removed. All "inplace" string modification
functions and all "inplace" string ops are deprecated.

L<https://trac.parrot.org/parrot/ticket/1540>

=item Parrot_load_bytecode_file [experimental]

Load a .pbc file into the interpreter. Experimental.
Expand All @@ -342,6 +328,18 @@ is deprecated.

L<http://trac.parrot.org/parrot/ticket/1800>

=item Non-const STRING* arguments [eligible in 3.1]

Due immutable nature of STRINGs we are changing internal handling to use only
const STRING pointers. It will improve optimizations possibilities by compiler,
make parrot const-correct, etc.

Passing of non-const STRING* arguments is deprecated and will be changed to
const STRING*. This includes (but not limited to) all string API functions,
VTABLEs, PCC, etc.

L<http://trac.parrot.org/parrot/ticket/1906>

=item Old string_* functions [eligible in 3.0]

The old string_* functions will be removed.
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,6 @@ t/codingstd/c_struct.t [test]
t/codingstd/c_todo.t [test]
t/codingstd/check_isxxx.t [test]
t/codingstd/check_toxxx.t [test]
t/codingstd/checkdepend.t [test]
t/codingstd/copyright.t [test]
t/codingstd/cuddled_else.t [test]
t/codingstd/filenames.t [test]
Expand Down Expand Up @@ -1944,6 +1943,7 @@ t/run/options.t [test]
t/src/README []doc
t/src/atomic.t [test]
t/src/basic.t [test]
t/src/checkdepend.t [test]
t/src/embed.t [test]
t/src/embed/pmc.t [test]
t/src/embed/strings.t [test]
Expand Down
6 changes: 4 additions & 2 deletions config/gen/makefiles/root.in
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,8 @@ help :
@echo " apilist: Show list of PARROT_API functions"
@echo " exportlist: Show list of PARROT_EXPORT functions"
@echo " malloclist: Show list of PARROT_MALLOC functions"
@echo " cover: Run test suite coverage analysis."
@echo " quickcover: Run test suite coverage analysis (core)."
@echo " cover: Run test suite coverage analysis (full)."
@echo " tags-vi: Create tags for the vi editor."
@echo " tags-emacs: Create tags for the Emacs editor."
@echo " perlcritic: Check Perl code with Perl::Critic."
Expand Down Expand Up @@ -1947,7 +1948,8 @@ RUN_TEST_FILES = \
RUNCORE_TEST_FILES = \
--runcore-tests
SRC_TEST_FILES = \
t/src/*.t
t/src/*.t \
t/src/embed/*.t
TOOLS_TEST_FILES = $(TOOLS_TESTS_DIR)/tools/*.t

# pbc files used for several tests;
Expand Down
1 change: 1 addition & 0 deletions config/gen/platform/darwin/sysmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Get system memory information.
*/
#include <sys/sysctl.h>
#include <stdio.h>
#include "parrot/sysmem.h"

/*
Expand Down
2 changes: 1 addition & 1 deletion docs/project/release_manager_guide.pod
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ the resources/ and html/ directories created in docs/.
ssh into the parrotvm, and in the
webroot for docs.parrot.org, expand these into a release directory (e.g.
1.4.0). in <webroot>/parrot, there are symbolic links for latest, supported,
and devel. Update the latest symlink to point to your new directory.
and devel. Update the devel symlink to point to your new directory.
If this is a supported release, also update the supported symlink. Do not delete
any old copies of the docs.

Expand Down
2 changes: 1 addition & 1 deletion include/parrot/dynext.h
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion include/parrot/string_funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
PMC* Parrot_str_split(PARROT_INTERP,
ARGIN_NULLOK(const STRING *delim),
ARGIN_NULLOK(STRING *str))
ARGIN_NULLOK(const STRING *str))
__attribute__nonnull__(1);

PARROT_EXPORT
Expand Down
50 changes: 24 additions & 26 deletions src/dynext.c
Original file line number Diff line number Diff line change
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
4 changes: 2 additions & 2 deletions src/embed/pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,15 +469,15 @@ value if this call is successful and false value otherwise.
*/

PARROT_API
/*PARROT_API
Parrot_Int
Parrot_api_add_exception_handler(ARGIN(Parrot_PMC interp_pmc), ARGIN(Parrot_PMC handler))
{
ASSERT_ARGS(Parrot_api_add_exception_handler)
EMBED_API_CALLIN(interp_pmc, interp)
Parrot_cx_add_handler(interp, handler);
EMBED_API_CALLOUT(interp_pmc, interp)
}
}*/

/*
Expand Down
5 changes: 3 additions & 2 deletions src/string/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2949,7 +2949,8 @@ Parrot_str_join(PARROT_INTERP, ARGIN_NULLOK(STRING *j), ARGIN(PMC *ar))

/*
=item C<PMC* Parrot_str_split(PARROT_INTERP, const STRING *delim, STRING *str)>
=item C<PMC* Parrot_str_split(PARROT_INTERP, const STRING *delim, const STRING
*str)>
Splits the string C<str> at the delimiter C<delim>, returning a
C<ResizableStringArray>, or his mapped type in the current HLL, of results.
Expand All @@ -2964,7 +2965,7 @@ PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
PMC*
Parrot_str_split(PARROT_INTERP,
ARGIN_NULLOK(const STRING *delim), ARGIN_NULLOK(STRING *str))
ARGIN_NULLOK(const STRING *delim), ARGIN_NULLOK(const STRING *str))
{
ASSERT_ARGS(Parrot_str_split)
PMC *res;
Expand Down
5 changes: 4 additions & 1 deletion t/pmc/hash.t
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ well.
.sub main :main
.include 'test_more.pir'

plan(174)
plan(175)

initial_hash_tests()
more_than_one_hash()
Expand Down Expand Up @@ -271,6 +271,9 @@ check:
set $P0["0"], 1
set $I0, $P0
is( $I0, 2, 'hash size of 2' )

$I1 = elements $P0
is( $I1, $I0, "'elements' gives the same result" )
.end

.sub stress_test_loop_set_check
Expand Down
5 changes: 4 additions & 1 deletion t/pmc/hashiterator.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ well.
.sub main :main
.include 'test_more.pir'

plan(10)
plan(11)

iter_over_empty_hash()
iter_over_single_element()
Expand All @@ -38,6 +38,9 @@ well.
$I0 = isfalse it
ok($I0, "Iterator for empty Hash is empty")

$I0 = elements it
is($I0, 0, "Iterator for empty Hash has 0 elements")

# shift_pmc throws on empty Hash but shift_string doesn't.

$S0 = shift it
Expand Down
Loading

0 comments on commit 2ceb0e8

Please sign in to comment.