Front page | perl.cvs.parrot |
Postings from December 2008
[svn:parrot] r34730 - in trunk: compilers/imcc config/gen/platform/ansi config/gen/platform/generic config/gen/platform/win32 docs docs/book docs/dev examples/c examples/compilers ext/Parrot-Embed/lib/Parrot include/parrot languages/dotnet/ops src src/pmc
From:
infinoid
Date:
December 31, 2008 18:16
Subject:
[svn:parrot] r34730 - in trunk: compilers/imcc config/gen/platform/ansi config/gen/platform/generic config/gen/platform/win32 docs docs/book docs/dev examples/c examples/compilers ext/Parrot-Embed/lib/Parrot include/parrot languages/dotnet/ops src src/pmc
Message ID:
20090101021548.BBABBCB9FA@x12.develooper.com
Author: infinoid
Date: Wed Dec 31 18:15:46 2008
New Revision: 34730
Modified:
trunk/compilers/imcc/reg_alloc.c
trunk/config/gen/platform/ansi/exec.c
trunk/config/gen/platform/generic/exec.c
trunk/config/gen/platform/win32/exec.c
trunk/docs/book/ch13_reference.pod
trunk/docs/dev/fhs.pod
trunk/docs/embed.pod
trunk/docs/extend.pod
trunk/docs/tests.pod
trunk/examples/c/test_main.c
trunk/examples/compilers/japhc.c
trunk/ext/Parrot-Embed/lib/Parrot/Embed.xs
trunk/include/parrot/embed.h
trunk/include/parrot/interpreter.h
trunk/languages/dotnet/ops/dotnet.ops
trunk/src/parrot_debugger.c
trunk/src/pbc_disassemble.c
trunk/src/pmc/parrotinterpreter.pmc
trunk/t/src/basic.t
trunk/t/src/compiler.t
trunk/t/src/exit.t
trunk/t/src/extend.t
Log:
Apply patch from jimmy++ in TT #111.
* Convert lots of Parrot_Interp arguments to PARROT_INTERP and NULLOK_INTERP.
* Reformat some comments, fix some typos.
Modified: trunk/compilers/imcc/reg_alloc.c
==============================================================================
--- trunk/compilers/imcc/reg_alloc.c (original)
+++ trunk/compilers/imcc/reg_alloc.c Wed Dec 31 18:15:46 2008
@@ -59,7 +59,7 @@
__attribute__nonnull__(2)
FUNC_MODIFIES(*unit);
-static void build_reglist(Parrot_Interp interp, ARGMOD(IMC_Unit *unit))
+static void build_reglist(NULLOK_INTERP, ARGMOD(IMC_Unit *unit))
__attribute__nonnull__(2)
FUNC_MODIFIES(*unit);
@@ -634,7 +634,7 @@
*/
static void
-build_reglist(Parrot_Interp interp, ARGMOD(IMC_Unit *unit))
+build_reglist(NULLOK_INTERP, ARGMOD(IMC_Unit *unit))
{
SymHash const *hsh = &unit->hash;
unsigned int i, count, unused, n_symbols;
Modified: trunk/config/gen/platform/ansi/exec.c
==============================================================================
--- trunk/config/gen/platform/ansi/exec.c (original)
+++ trunk/config/gen/platform/ansi/exec.c Wed Dec 31 18:15:46 2008
@@ -23,7 +23,7 @@
/*
-=item C<INTVAL Parrot_Run_OS_Command(Parrot_Interp interp, STRING *command)>
+=item C<INTVAL Parrot_Run_OS_Command(PARROT_INTERP, STRING *command)>
Spawn a subprocess
@@ -32,7 +32,7 @@
*/
INTVAL
-Parrot_Run_OS_Command(Parrot_Interp interp, STRING *command)
+Parrot_Run_OS_Command(PARROT_INTERP, STRING *command)
{
Parrot_warn(NULL, PARROT_WARNINGS_PLATFORM_FLAG,
"Parrot_Run_OS_Command not implemented");
@@ -41,7 +41,7 @@
/*
-=item C<INTVAL Parrot_Run_OS_Command_Argv(Parrot_Interp interp, PMC *cmdargs)>
+=item C<INTVAL Parrot_Run_OS_Command_Argv(PARROT_INTERP, PMC *cmdargs)>
RT#48260: Not yet documented!!!
@@ -50,7 +50,7 @@
*/
INTVAL
-Parrot_Run_OS_Command_Argv(Parrot_Interp interp, PMC *cmdargs)
+Parrot_Run_OS_Command_Argv(PARROT_INTERP, PMC *cmdargs)
{
Parrot_warn(NULL, PARROT_WARNINGS_PLATFORM_FLAG,
"Parrot_Run_OS_Command_Argv not implemented");
@@ -59,7 +59,7 @@
/*
-=item C<void Parrot_Exec_OS_Comman(Parrot_Interp interp, STRING *command)>
+=item C<void Parrot_Exec_OS_Comman(PARROT_INTERP, STRING *command)>
RT#48260: Not yet documented!!!
@@ -68,7 +68,7 @@
*/
void
-Parrot_Exec_OS_Comman(Parrot_Interp interp, STRING *command)
+Parrot_Exec_OS_Comman(PARROT_INTERP, STRING *command)
{
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_NOSPAWN,
"Exec not implemented");
Modified: trunk/config/gen/platform/generic/exec.c
==============================================================================
--- trunk/config/gen/platform/generic/exec.c (original)
+++ trunk/config/gen/platform/generic/exec.c Wed Dec 31 18:15:46 2008
@@ -27,7 +27,7 @@
/*
=item C<INTVAL
-Parrot_Run_OS_Command(Parrot_Interp interp, STRING *command)>
+Parrot_Run_OS_Command(PARROT_INTERP, STRING *command)>
Spawn off a subprocess and wait for the damn thing to complete,
returning the return value of the process
@@ -37,7 +37,7 @@
*/
INTVAL
-Parrot_Run_OS_Command(Parrot_Interp interp, STRING *command)
+Parrot_Run_OS_Command(PARROT_INTERP, STRING *command)
{
pid_t child;
child = fork();
@@ -72,7 +72,7 @@
/*
=item C<INTVAL
-Parrot_Run_OS_Command_Argv(Parrot_Interp interp, PMC *cmdargs)>
+Parrot_Run_OS_Command_Argv(PARROT_INTERP, PMC *cmdargs)>
RT#48260: Not yet documented!!!
@@ -81,7 +81,7 @@
*/
INTVAL
-Parrot_Run_OS_Command_Argv(Parrot_Interp interp, PMC *cmdargs)
+Parrot_Run_OS_Command_Argv(PARROT_INTERP, PMC *cmdargs)
{
pid_t child;
int len = VTABLE_elements(interp, cmdargs);
@@ -133,7 +133,7 @@
/*
=item C<void
-Parrot_Exec_OS_Command(Parrot_Interp interp, STRING *command)>
+Parrot_Exec_OS_Command(PARROT_INTERP, STRING *command)>
RT #48260: Not yet documented!!!
@@ -142,7 +142,7 @@
*/
void
-Parrot_Exec_OS_Command(Parrot_Interp interp, STRING *command)
+Parrot_Exec_OS_Command(PARROT_INTERP, STRING *command)
{
/* Be horribly profligate with memory, since we're
about to be something else */
Modified: trunk/config/gen/platform/win32/exec.c
==============================================================================
--- trunk/config/gen/platform/win32/exec.c (original)
+++ trunk/config/gen/platform/win32/exec.c Wed Dec 31 18:15:46 2008
@@ -26,7 +26,7 @@
/*
=item C<INTVAL
-Parrot_Run_OS_Command(Parrot_Interp interp, STRING *command)>
+Parrot_Run_OS_Command(PARROT_INTERP, STRING *command)>
Spawn the subprocess specified in C<command>.
Waits for the process to complete, and then
@@ -37,7 +37,7 @@
*/
INTVAL
-Parrot_Run_OS_Command(Parrot_Interp interp, STRING *command)
+Parrot_Run_OS_Command(PARROT_INTERP, STRING *command)
{
DWORD status = 0;
STARTUPINFO si;
@@ -79,7 +79,7 @@
/*
=item C<INTVAL
-Parrot_Run_OS_Command_Argv(Parrot_Interp interp, PMC *cmdargs)>
+Parrot_Run_OS_Command_Argv(PARROT_INTERP, PMC *cmdargs)>
Spawns a subprocess with the arguments provided in the C<cmdargs> PMC array.
The first array element should be the name of the process to spawn,
@@ -92,7 +92,7 @@
*/
INTVAL
-Parrot_Run_OS_Command_Argv(Parrot_Interp interp, PMC *cmdargs)
+Parrot_Run_OS_Command_Argv(PARROT_INTERP, PMC *cmdargs)
{
DWORD status = 0;
STARTUPINFO si;
@@ -152,7 +152,7 @@
/*
=item C<void
-Parrot_Exec_OS_Command(Parrot_Interp interp, STRING *command)>
+Parrot_Exec_OS_Command(PARROT_INTERP, STRING *command)>
Exits parrot and passes control to the specified process. Does not return. Raises an exception
if the exec fails.
@@ -162,7 +162,7 @@
*/
void
-Parrot_Exec_OS_Command(Parrot_Interp interp, STRING *command)
+Parrot_Exec_OS_Command(PARROT_INTERP, STRING *command)
{
int status;
char *in = string_to_cstring(interp, command);
Modified: trunk/docs/book/ch13_reference.pod
==============================================================================
--- trunk/docs/book/ch13_reference.pod (original)
+++ trunk/docs/book/ch13_reference.pod Wed Dec 31 18:15:46 2008
@@ -4,7 +4,7 @@
Z<CHP-10>
-This chapter contains a condensed list of PASM opcodes, PIR directives
+This chapter contains a condensed list of PASM opcodes, PIR directives
and instructions, and Parrot command-line options, sorted alphabetically
for easy reference. Any PASM opcode is valid in PIR code, so if you're
looking up PIR syntax you should check A<CHP-10-SECT-1>"PASM Opcodes",
Modified: trunk/docs/dev/fhs.pod
==============================================================================
--- trunk/docs/dev/fhs.pod (original)
+++ trunk/docs/dev/fhs.pod Wed Dec 31 18:15:46 2008
@@ -5,7 +5,7 @@
=head1 Title
-FHS - Filesystem Hieararchy Standard and Parrot
+FHS - Filesystem Hierarchy Standard and Parrot
=head1 AUTHOR
Modified: trunk/docs/embed.pod
==============================================================================
--- trunk/docs/embed.pod (original)
+++ trunk/docs/embed.pod Wed Dec 31 18:15:46 2008
@@ -117,7 +117,7 @@
process should use the first interpreter as their parent. Failure to do so
may result in unpredictable errors.
-=item C<Parrot_set_flag(Parrot_Interp interp, Parrot_int flags)>
+=item C<Parrot_set_flag(PARROT_INTERP, Parrot_int flags)>
Sets or unsets interpreter flags. Flags should be OR'd together. Valid
flags include:
@@ -151,7 +151,7 @@
See F<interpreter.h> for the definition of these flags (TODO: document flag
definitions here).
-=item C<void Parrot_set_run_core(Parrot_Interp interp, Parrot_Run_core_t core)>
+=item C<void Parrot_set_run_core(PARROT_INTERP, Parrot_Run_core_t core)>
Sets the runcore for the interpreter. Must be called before executing any
bytecode. Valid runcores include:
@@ -207,35 +207,35 @@
=back
-=item C<void Parrot_set_executable_name(Parrot_Interp interp, Parrot_string name)>
+=item C<void Parrot_set_executable_name(PARROT_INTERP, Parrot_string name)>
Sets the executable name of the calling process. Note that the name is a
Parrot string, not a C string.
-=item C<void Parrot_destroy(Parrot_Interp interp)>
+=item C<void Parrot_destroy(PARROT_INTERP)>
Destroys an interpreter. At the time of this writing, this is a no-op.
See <Parrot_really_destroy()>.
-=item C<void Parrot_really_destroy(Parrot_Interp interp, int exit_code)>
+=item C<void Parrot_really_destroy(PARROT_INTERP, int exit_code)>
Destroys an interpreter, regardless of the environment. The exit code is
currently unused.
-=item C<void Parrot_exit(Parrot_Interp interp, int status)>
+=item C<void Parrot_exit(PARROT_INTERP, int status)>
Destroys the interpreter and exits with an exit code of C<status>. Before
exiting, the function calls all registered exit handlers in LIFO order.
C<Parrot_really_destroy()> is usually called as the last exit handler.
-=item C<void Parrot_on_exit(Parrot_Interp interp,
+=item C<void Parrot_on_exit(PARROT_INTERP,
void (*handler)(Parrot_Interp, int, void *), void *arg)>
Registers an exit handler to be called from C<Parrot_exit()> in LIFO order.
The handler function should accept as arguments an interpreter, an integer
exit code, and an argument (which can be NULL).
-=item C<void imcc_init(Parrot_Interp interp)>
+=item C<void imcc_init(PARROT_INTERP)>
Initializes the IMCC subsystem. Required for compiling PIR.
@@ -245,27 +245,27 @@
=over 4
-=item C<Parrot_PackFile Parrot_readbc(Parrot_Interp interp, const char *path)>
+=item C<Parrot_PackFile Parrot_readbc(PARROT_INTERP, const char *path)>
Reads Parrot bytecode or PIR from the file referenced by C<path>. Returns
a packfile structure for use by C<Parrot_loadbc()>.
-=item C<void Parrot_loadbc(Parrot_Interp interp, Parrot_PackFile pf)>
+=item C<void Parrot_loadbc(PARROT_INTERP, Parrot_PackFile pf)>
Loads a packfile into the interpreter. After this operation the interpreter
is ready to run the bytecode in the packfile.
-=item C<void Parrot_runcode(Parrot_Interp interp, int argc, char *argv[])>
+=item C<void Parrot_runcode(PARROT_INTERP, int argc, char *argv[])>
Runs the bytecode associated with the interpreter. Use C<argc> and C<argv[]>
to pass arguments to the bytecode.
-=item C<Parrot_PackFile PackFile_new_dummy(Parrot_Interp interp, char *name)>
+=item C<Parrot_PackFile PackFile_new_dummy(PARROT_INTERP, char *name)>
Creates a "dummy" packfile in lieu of actually creating one from a bytecode
file on disk.
-=item C<void Parrot_load_bytecode(Parrot_Interp interp, const char *path)>
+=item C<void Parrot_load_bytecode(PARROT_INTERP, const char *path)>
Reads and load Parrot bytecode or PIR from the file referenced by C<path>.
You should create a dummy packfile beforehand; see C<PackFile_new_dummy> for
@@ -280,22 +280,22 @@
=over 4
-=item C<int Parrot_PMC_typenum(Parrot_Interp interp, const char *type)>
+=item C<int Parrot_PMC_typenum(PARROT_INTERP, const char *type)>
Returns the internal type number corresponding to C<type>. Useful for
instantiating various Parrot data types.
-=item C<char *string_to_cstring(Parrot_Interp interp)>
+=item C<char *string_to_cstring(PARROT_INTERP)>
XXX needs to be a formal Parrot_* API.
Returns the C string representation of a Parrot string.
-=item C<STRING *string_from_cstring(Parrot_Interp interp, const char *string, int len)>
+=item C<STRING *string_from_cstring(PARROT_INTERP, const char *string, int len)>
XXX needs to be a formal Parrot_* API.
Returns the Parrot string representation of a C string.
-=item C<string_from_literal(Parrot_Interp interp, const char *string)>
+=item C<string_from_literal(PARROT_INTERP, const char *string)>
XXX needs to be a formal Parrot_* API.
A macro for simplifying calls to C<string_from_cstring>.
@@ -306,7 +306,7 @@
=over 4
-=item C<Parrot_PMC Parrot_PMC_new(Parrot_Interp interp, int typenum)>
+=item C<Parrot_PMC Parrot_PMC_new(PARROT_INTERP, int typenum)>
Creates a new PMC of the type identified by C<typenum>. Use
C<Parrot_PMC_typenum> to obtain the correct type number.
@@ -329,40 +329,40 @@
=over 4
-=item C<Parrot_PMC Parrot_find_global_cur(Parrot_Interp interp, Parrot_String name)>
+=item C<Parrot_PMC Parrot_find_global_cur(PARROT_INTERP, Parrot_String name)>
Find and return a global called C<name> in the current namespace. Returns
C<PMCNULL> if not found.
-=item C<Parrot_PMC Parrot_find_global_n(Parrot_Interp interp, Parrot_String namespace, Parrot_String name)>
+=item C<Parrot_PMC Parrot_find_global_n(PARROT_INTERP, Parrot_String namespace, Parrot_String name)>
Not documented yet.
-=item C<Parrot_PMC Parrot_find_global_s(Parrot_Interp interp, Parrot_String namespace, Parrot_String name)>
+=item C<Parrot_PMC Parrot_find_global_s(PARROT_INTERP, Parrot_String namespace, Parrot_String name)>
Find and return a global called C<name> in the namespace C<namespace>. Returns
C<PMCNULL> if not found.
-=item C<void Parrot_store_global_cur(Parrot_Interp interp, Parrot_String name, Parrot_PMC val)>
+=item C<void Parrot_store_global_cur(PARROT_INTERP, Parrot_String name, Parrot_PMC val)>
Sets the value of a global called C<name> in the current namespace. Does
nothing if the global is not found.
-=item C<void Parrot_store_global_n(Parrot_Interp interp, Parrot_String namespace, Parrot_String name, Parrot_PMC val)>
+=item C<void Parrot_store_global_n(PARROT_INTERP, Parrot_String namespace, Parrot_String name, Parrot_PMC val)>
Not documented yet.
-=item C<void Parrot_store_global_s(Parrot_Interp interp, Parrot_String namespace, Parrot_String name, Parrot_PMC val)>
+=item C<void Parrot_store_global_s(PARROT_INTERP, Parrot_String namespace, Parrot_String name, Parrot_PMC val)>
Sets the value of a global called C<name> in the namespace C<namespace>. Does
nothing if the global is not found.
-=item C<Parrot_PMC Parrot_find_global_k(Parrot_Interp interp, Parrot_PMC namespace_key, Parrot_String name)>
+=item C<Parrot_PMC Parrot_find_global_k(PARROT_INTERP, Parrot_PMC namespace_key, Parrot_String name)>
Find and return a global called C<name> in the keyed namespace C<namespace>.
Returns C<PMCNULL> if not found.
-=item C<void Parrot_store_global_k(Parrot_Interp interp, Parrot_PMC namespace_key, Parrot_String name, Parrot_PMC val)>
+=item C<void Parrot_store_global_k(PARROT_INTERP, Parrot_PMC namespace_key, Parrot_String name, Parrot_PMC val)>
Sets the value of a global called C<name> in the keyed namespace C<namespace>.
Does nothing if the global is not found.
@@ -377,15 +377,15 @@
=over 4
-=item C<void *Parrot_call_sub(Parrot_Interp interp, Parrot_PMC sub, const_char *signature)>
+=item C<void *Parrot_call_sub(PARROT_INTERP, Parrot_PMC sub, const_char *signature)>
Call a Parrot subroutine that returns a pointer using the supplied signature.
-=item C<Parrot_Int Parrot_call_sub_ret_int(Parrot_Interp interp, Parrot_PMC sub, const_char *signature)>
+=item C<Parrot_Int Parrot_call_sub_ret_int(PARROT_INTERP, Parrot_PMC sub, const_char *signature)>
Call a Parrot subroutine that returns an integer using the supplied signature.
-=item C<Parrot_Float Parrot_call_sub_ret_float(Parrot_Interp interp, Parrot_PMC sub, const_char *signature)>
+=item C<Parrot_Float Parrot_call_sub_ret_float(PARROT_INTERP, Parrot_PMC sub, const_char *signature)>
Call a Parrot subroutine that returns an float using the supplied signature.
@@ -397,11 +397,11 @@
=over 4
-=item C<Parrot_PMC Parrot_oo_get_class(Parrot_Interp interp, Parrot_PMC namespace)>
+=item C<Parrot_PMC Parrot_oo_get_class(PARROT_INTERP, Parrot_PMC namespace)>
Returns the class corresponding to the supplied namespace.
-=item C<Parrot_PMC Parrot_Class_instantiate(Parrot_Interp interp, Parrot_PMC the_class Parrot_PMC arg)>
+=item C<Parrot_PMC Parrot_Class_instantiate(PARROT_INTERP, Parrot_PMC the_class Parrot_PMC arg)>
Instantiates a new object of class C<the_class>, which can be obtained from
C<Parrot_oo_get_class()>. Passes an optional PMC argument C<arg> to the
Modified: trunk/docs/extend.pod
==============================================================================
--- trunk/docs/extend.pod (original)
+++ trunk/docs/extend.pod Wed Dec 31 18:15:46 2008
@@ -36,7 +36,7 @@
=over 4
-=item C<Parrot_call_method(Parrot_Interp interp, Parrot_PMC sub
+=item C<Parrot_call_method(PARROT_INTERP, Parrot_PMC sub
Parrot_PMC object, Parrot_String method, const char *signature, ...)>
Calls a method on C<object> with the given signature and arguments. C<sub> is
Modified: trunk/docs/tests.pod
==============================================================================
--- trunk/docs/tests.pod (original)
+++ trunk/docs/tests.pod Wed Dec 31 18:15:46 2008
@@ -115,7 +115,7 @@
}
static opcode_t*
- the_test(Parrot_Interp interp,
+ the_test(PARROT_INTERP,
opcode_t *cur_op, opcode_t *start)
{
/* Your test goes here. */
Modified: trunk/examples/c/test_main.c
==============================================================================
--- trunk/examples/c/test_main.c (original)
+++ trunk/examples/c/test_main.c Wed Dec 31 18:15:46 2008
@@ -28,7 +28,7 @@
#define setopt(flag) Parrot_setflag(interp, (flag), (*argv)[0]+2);
#define unsetopt(flag) Parrot_setflag(interp, (flag), 0)
-static char *parseflags(Parrot_Interp interp, int *argc, char **argv[]);
+static char *parseflags(PARROT_INTERP, int *argc, char **argv[]);
#define OPT_GC_DEBUG 128
#define OPT_DESTROY_FLAG 129
@@ -97,7 +97,7 @@
/*
=item C<char *
-parseflags(Parrot_Interp interp, int *argc, char **argv[])>
+parseflags(PARROT_INTERP, int *argc, char **argv[])>
Parses the command-line.
@@ -106,7 +106,7 @@
*/
static char *
-parseflags(Parrot_Interp interp, int *argc, char **argv[])
+parseflags(PARROT_INTERP, int *argc, char **argv[])
{
struct longopt_opt_info opt = LONGOPT_OPT_INFO_INIT;
Modified: trunk/examples/compilers/japhc.c
==============================================================================
--- trunk/examples/compilers/japhc.c (original)
+++ trunk/examples/compilers/japhc.c Wed Dec 31 18:15:46 2008
@@ -40,12 +40,12 @@
# define cdebug(x)
#endif
-PMC* japh_compiler(Parrot_Interp interp, const char *s);
+PMC* japh_compiler(PARROT_INTERP, const char *s);
/*
=item C<void
-Parrot_lib_japhc_init(Parrot_Interp interp, PMC* lib)>
+Parrot_lib_japhc_init(PARROT_INTERP, PMC* lib)>
loadlib calls the load and init hooks
we use init to register the compiler
@@ -55,7 +55,7 @@
*/
void
-Parrot_lib_japhc_init(Parrot_Interp interp, PMC* lib)
+Parrot_lib_japhc_init(PARROT_INTERP, PMC* lib)
{
STRING *cmp;
@@ -102,7 +102,7 @@
/*
=item C<static int
-add_const_str(Parrot_Interp interp, PackFile_ConstTable *consts, char *str)>
+add_const_str(PARROT_INTERP, PackFile_ConstTable *consts, char *str)>
add constant string to constant_table
@@ -111,7 +111,7 @@
*/
static int
-add_const_str(Parrot_Interp interp, PackFile_ConstTable *consts, char *str)
+add_const_str(PARROT_INTERP, PackFile_ConstTable *consts, char *str)
{
int k, l;
char *o;
@@ -156,7 +156,7 @@
/*
-=item C<PMC* japh_compiler(Parrot_Interp interp, const char *program)>
+=item C<PMC* japh_compiler(PARROT_INTERP, const char *program)>
simple compiler - no error checking
@@ -165,7 +165,7 @@
*/
PMC*
-japh_compiler(Parrot_Interp interp, const char *program)
+japh_compiler(PARROT_INTERP, const char *program)
{
PackFile_ByteCode *cur_cs, *old_cs;
PackFile_ConstTable *consts;
Modified: trunk/ext/Parrot-Embed/lib/Parrot/Embed.xs
==============================================================================
--- trunk/ext/Parrot-Embed/lib/Parrot/Embed.xs (original)
+++ trunk/ext/Parrot-Embed/lib/Parrot/Embed.xs Wed Dec 31 18:15:46 2008
@@ -23,7 +23,7 @@
} PMC_struct;
Interpreter_struct*
-make_interp( pTHX_ SV *parent, Parrot_Interp interp )
+make_interp( pTHX_ SV *parent, PARROT_INTERP )
{
Interpreter_struct *interp_struct;
if (interp == NULL)
Modified: trunk/include/parrot/embed.h
==============================================================================
--- trunk/include/parrot/embed.h (original)
+++ trunk/include/parrot/embed.h Wed Dec 31 18:15:46 2008
@@ -64,7 +64,7 @@
PARROT_DOES_NOT_RETURN
void Parrot_exit(Parrot_Interp, int status);
-PARROT_EXPORT void Parrot_run_native(Parrot_Interp interp, native_func_t func);
+PARROT_EXPORT void Parrot_run_native(PARROT_INTERP, native_func_t func);
/* Parrot_set_config_hash exists in *_config.o (e.g install_config.o),
so if you make this call then you will need to link with it in
Modified: trunk/include/parrot/interpreter.h
==============================================================================
--- trunk/include/parrot/interpreter.h (original)
+++ trunk/include/parrot/interpreter.h Wed Dec 31 18:15:46 2008
@@ -92,8 +92,7 @@
PARROT_CLONE_CC = 0x80, /* clone current continuation --
* fork()-like cloning (requires
* cloned code segments); probably
- * would only work if runloop_level is 1
- */
+ * would only work if runloop_level is 1 */
/* combinations of flags */
PARROT_CLONE_DEFAULT = 0x7f /* everything but CC */
@@ -101,10 +100,9 @@
/* &end_gen */
struct parrot_interp_t;
-/* One of the most common shim arguments is the interpreter itself, so it
- * gets its own macro.
- */
+/* One of the most common shim arguments is the interpreter itself, so it
+ * gets its own macro. */
#define PARROT_INTERP /*@notnull@*/ /*@in@*/ Parrot_Interp interp
#define NULLOK_INTERP /*@null@*/ /*@in@*/ Parrot_Interp interp
#define SHIM_INTERP /*@unused@*/ /*@null@*/ Parrot_Interp interp_unused __attribute__unused__
@@ -151,10 +149,8 @@
Warnings_classes classes;
} *Warnings;
-/*
- * ProfData have these extra items in front followed by
- * one entry per op at (op + extra)
- */
+/* ProfData have these extra items in front followed by
+ * one entry per op at (op + extra) */
typedef enum {
PARROT_PROF_DOD_p1, /* pass 1 mark root set */
@@ -167,9 +163,7 @@
PARROT_PROF_EXTRA
} profile_extra_enum;
-/*
- * data[op_count] is time spent for exception handling
- */
+/* data[op_count] is time spent for exception handling */
typedef struct ProfData {
int op;
UINTVAL numcalls;
@@ -184,8 +178,7 @@
} RunProfile;
/* Forward declaration for imc_info_t -- the actual struct is
- * defined in imcc/imc.h
- */
+ * defined in imcc/imc.h */
struct _imc_info_t;
typedef union {
@@ -210,6 +203,7 @@
struct Parrot_Context *caller_ctx; /* caller context */
Regs_ni bp; /* pointers to FLOATVAL & INTVAL */
Regs_ps bp_ps; /* pointers to PMC & STR */
+
/* end common header */
INTVAL *n_regs_used; /* INSP in PBC points to Sub */
size_t regs_mem_size; /* memory occupied by registers */
@@ -223,13 +217,11 @@
UINTVAL errors; /* fatals that can be turned off */
UINTVAL trace_flags;
UINTVAL recursion_depth; /* Sub call recursion depth */
- /*
- * new call scheme and introspective variables
- */
+
+ /* new call scheme and introspective variables */
PMC *current_sub; /* the Sub we are executing */
- /*
- * for now use a return continuation PMC
- */
+
+ /* for now use a return continuation PMC */
PMC *current_cont; /* the return continuation PMC */
PMC *current_object; /* current object if a method call */
opcode_t *current_pc; /* program counter of Sub invocation */
@@ -240,9 +232,9 @@
PMC *handlers; /* local handlers for the context */
/* deref the constants - we need it all the time */
struct PackFile_Constant ** constants;
+
/* code->prederefed.code - code->base.data in opcodes
- * to simplify conversio between code ptrs in e.g. invoke
- */
+ * to simplify conversio between code ptrs in e.g. invoke */
size_t pred_offset;
};
@@ -298,7 +290,7 @@
* used to resume execution at a point in the runloop where an exception
* handler can be run. Ultimately this information should be part of
* Parrot_Context, but at this point a new context isn't created for every
- * runloop ID, so it still needs to be a separate stack for a while longer.*/
+ * runloop ID, so it still needs to be a separate stack for a while longer. */
typedef struct parrot_runloop_t {
Parrot_jump_buff resume; /* jmp_buf */
@@ -508,7 +500,7 @@
VAR_SCOPE native_func_t run_native;
-typedef PMC *(*Parrot_compiler_func_t)(Parrot_Interp interp,
+typedef PMC *(*Parrot_compiler_func_t)(PARROT_INTERP,
const char * program);
/* HEADERIZER BEGIN: src/inter_create.c */
@@ -957,7 +949,7 @@
/* interpreter.pmc */
void clone_interpreter(Parrot_Interp dest, Parrot_Interp self, INTVAL flags);
-void Parrot_setup_event_func_ptrs(Parrot_Interp interp);
+void Parrot_setup_event_func_ptrs(PARROT_INTERP);
PARROT_EXPORT void disable_event_checking(PARROT_INTERP);
PARROT_EXPORT void enable_event_checking(PARROT_INTERP);
@@ -973,7 +965,7 @@
struct Parrot_Interp_;
typedef struct Parrot_Interp_ *Parrot_Interp;
-typedef void * *(*native_func_t)(Parrot_Interp interp,
+typedef void * *(*native_func_t)(PARROT_INTERP,
void *cur_opcode,
void *start_code);
Modified: trunk/languages/dotnet/ops/dotnet.ops
==============================================================================
--- trunk/languages/dotnet/ops/dotnet.ops (original)
+++ trunk/languages/dotnet/ops/dotnet.ops Wed Dec 31 18:15:46 2008
@@ -83,7 +83,7 @@
/* Overflow exception thrower. */
-static opcode_t* dotnet_OverflowException(Parrot_Interp interp, opcode_t *ret)
+static opcode_t* dotnet_OverflowException(PARROT_INTERP, opcode_t *ret)
{
PMC *ex_pmc = pmc_new(interp, enum_class_Exception);
VTABLE_set_string_native(interp, ex_pmc,
Modified: trunk/src/parrot_debugger.c
==============================================================================
--- trunk/src/parrot_debugger.c (original)
+++ trunk/src/parrot_debugger.c Wed Dec 31 18:15:46 2008
@@ -115,7 +115,7 @@
#include "parrot/debugger.h"
static void PDB_printwelcome(void);
-static void PDB_run_code(Parrot_Interp interp, int argc, char *argv[]);
+static void PDB_run_code(PARROT_INTERP, int argc, char *argv[]);
/*
@@ -249,7 +249,7 @@
*/
static void
-PDB_run_code(Parrot_Interp interp, int argc, char *argv[])
+PDB_run_code(PARROT_INTERP, int argc, char *argv[])
{
new_runloop_jump_point(interp);
if (setjmp(interp->current_runloop->resume)) {
Modified: trunk/src/pbc_disassemble.c
==============================================================================
--- trunk/src/pbc_disassemble.c (original)
+++ trunk/src/pbc_disassemble.c Wed Dec 31 18:15:46 2008
@@ -82,7 +82,7 @@
/*
-=item C<static void do_dis(Parrot_Interp interp)>
+=item C<static void do_dis(PARROT_INTERP)>
Do the disassembling.
@@ -91,7 +91,7 @@
*/
static void
-do_dis(Parrot_Interp interp)
+do_dis(PARROT_INTERP)
{
Parrot_disassemble(interp);
}
Modified: trunk/src/pmc/parrotinterpreter.pmc
==============================================================================
--- trunk/src/pmc/parrotinterpreter.pmc (original)
+++ trunk/src/pmc/parrotinterpreter.pmc Wed Dec 31 18:15:46 2008
@@ -170,7 +170,7 @@
}
static int
-recursion_limit(Parrot_Interp interp, PMC *self, int l)
+recursion_limit(PARROT_INTERP, PMC *self, int l)
{
const int ret = interp->recursion_limit;
interp->recursion_limit = l;
Modified: trunk/t/src/basic.t
==============================================================================
--- trunk/t/src/basic.t (original)
+++ trunk/t/src/basic.t Wed Dec 31 18:15:46 2008
@@ -6,9 +6,7 @@
use warnings;
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test;
-
-plan tests => 3;
+use Parrot::Test tests => 3;
=head1 NAME
Modified: trunk/t/src/compiler.t
==============================================================================
--- trunk/t/src/compiler.t (original)
+++ trunk/t/src/compiler.t Wed Dec 31 18:15:46 2008
@@ -6,11 +6,7 @@
use warnings;
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test;
-
-$^O eq 'MSWin32'
- ? plan( skip_all => 'linking problem' )
- : plan( tests => 5 );
+use Parrot::Test tests => 5;
=head1 NAME
@@ -35,7 +31,7 @@
#include "parrot/extend.h"
static opcode_t *
-run(Parrot_Interp interp, int argc, char *argv[])
+run(PARROT_INTERP, int argc, char *argv[])
{
const char *c_src = ".sub main :main\n" " print \"ok\\n\"\n" ".end\n";
@@ -117,7 +113,7 @@
#include "parrot/extend.h"
static void
-compile_run(Parrot_Interp interp, const char *src, STRING *type, int argc,
+compile_run(PARROT_INTERP, const char *src, STRING *type, int argc,
char *argv[])
{
STRING *smain;
@@ -150,7 +146,7 @@
}
static opcode_t *
-run(Parrot_Interp interp, int argc, char *argv[])
+run(PARROT_INTERP, int argc, char *argv[])
{
const char *c_src = ".sub main :main\n" " print \"ok\\n\"\n" ".end\n";
@@ -210,7 +206,7 @@
#include "parrot/extend.h"
static void
-compile_run(Parrot_Interp interp, const char *src, STRING *type, int argc,
+compile_run(PARROT_INTERP, const char *src, STRING *type, int argc,
char *argv[])
{
STRING *smain;
@@ -243,7 +239,7 @@
}
static opcode_t *
-run(Parrot_Interp interp, int argc, char *argv[])
+run(PARROT_INTERP, int argc, char *argv[])
{
const char *c_src = ".sub main :main\n" " print ok\\n\"\n" ".end\n";
@@ -303,7 +299,7 @@
#include "parrot/extend.h"
static void
-compile_run(Parrot_Interp interp, const char *src, STRING *type, int argc,
+compile_run(PARROT_INTERP, const char *src, STRING *type, int argc,
char *argv[])
{
STRING *smain;
@@ -336,7 +332,7 @@
}
static opcode_t *
-run(Parrot_Interp interp, int argc, char *argv[])
+run(PARROT_INTERP, int argc, char *argv[])
{
const char *c_src = ".sub main :main\n" " print ok\\n\"\n" ".end\n";
@@ -395,7 +391,7 @@
#include "parrot/extend.h"
static void
-compile_run(Parrot_Interp interp, const char *src, STRING *type, int argc,
+compile_run(PARROT_INTERP, const char *src, STRING *type, int argc,
char *argv[])
{
STRING *smain;
@@ -428,7 +424,7 @@
}
static opcode_t *
-run(Parrot_Interp interp, int argc, char *argv[])
+run(PARROT_INTERP, int argc, char *argv[])
{
const char *c_src = ".sub main :main\n" " print ok\\n\"\n" ".end\n";
Modified: trunk/t/src/exit.t
==============================================================================
--- trunk/t/src/exit.t (original)
+++ trunk/t/src/exit.t Wed Dec 31 18:15:46 2008
@@ -6,9 +6,7 @@
use warnings;
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test;
-
-plan tests => 1;
+use Parrot::Test tests => 1;
=head1 NAME
@@ -30,19 +28,19 @@
#include <parrot/embed.h>
void
-ex1(Parrot_Interp interp, int x, void*p)
+ex1(PARROT_INTERP, int x, void*p)
{
printf("ex1\n");
}
void
-ex2(Parrot_Interp interp, int x, void*p)
+ex2(PARROT_INTERP, int x, void*p)
{
printf("ex2\n");
}
void
-ex3(Parrot_Interp interp, int x, void*p)
+ex3(PARROT_INTERP, int x, void*p)
{
Parrot_io_printf(interp, "ex3\n");
}
Modified: trunk/t/src/extend.t
==============================================================================
--- trunk/t/src/extend.t (original)
+++ trunk/t/src/extend.t Wed Dec 31 18:15:46 2008
@@ -184,7 +184,7 @@
#include "parrot/extend.h"
static opcode_t*
-the_test(Parrot_Interp interp, opcode_t *cur_op, opcode_t *start)
+the_test(PARROT_INTERP, opcode_t *cur_op, opcode_t *start)
{
Parrot_Int type = Parrot_PMC_typenum(interp, "ResizablePMCArray");
Parrot_PMC array = Parrot_PMC_new(interp, type);
@@ -438,7 +438,7 @@
* so that buffering in PIO is not an issue */
static opcode_t*
-the_test(Parrot_Interp interp, opcode_t *cur_op, opcode_t *start)
+the_test(PARROT_INTERP, opcode_t *cur_op, opcode_t *start)
{
PackFile *pf = Parrot_readbc(interp, "$temp_pbc");
STRING *name = const_string(interp, "_sub1");
@@ -512,7 +512,7 @@
* so that buffering in PIO is not an issue */
static opcode_t*
-the_test(Parrot_Interp interp, opcode_t *cur_op, opcode_t *start)
+the_test(PARROT_INTERP, opcode_t *cur_op, opcode_t *start)
{
PackFile *pf = Parrot_readbc(interp, "$temp_pbc");
STRING *name = const_string(interp, "_sub1");
@@ -709,7 +709,7 @@
*/
void interp_cleanup(Parrot_Interp, int);
-void interp_cleanup(Parrot_Interp interp, int status)
+void interp_cleanup(PARROT_INTERP, int status)
{
handler_node_t *node = interp->exit_handler_list;
-
[svn:parrot] r34730 - in trunk: compilers/imcc config/gen/platform/ansi config/gen/platform/generic config/gen/platform/win32 docs docs/book docs/dev examples/c examples/compilers ext/Parrot-Embed/lib/Parrot include/parrot languages/dotnet/ops src src/pmc
by infinoid