Skip to content

Commit

Permalink
Replace a couple of calls to
Browse files Browse the repository at this point in the history
make_interpreter() with Parrot_new().


git-svn-id: https://svn.parrot.org/parrot/trunk@12076 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
bschmalhofer committed Mar 29, 2006
1 parent a725410 commit a25ee79
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 16 deletions.
6 changes: 3 additions & 3 deletions docs/embed.pod
Expand Up @@ -12,18 +12,18 @@ embed.pod - Parrot embedding system
int main(int argc, char *argv[]) {
Parrot_Interp interp;
Parrot_PackFile pf;
char *bcfile="program.pbc";
char * bcfile = "program.pbc";

argc--; argv++; /* skip the program name */

interp=Parrot_new(0);
interp=Parrot_new(NULL);
Parrot_init(interp);

if(PARROT_JIT_CAPABLE) {
Parrot_set_run_core(interp, PARROT_JIT_CORE); /* activate JIT */
}

pf=Parrot_readbc(interp, bcfile);
pf = Parrot_readbc(interp, bcfile);
Parrot_loadbc(interp, pf);

Parrot_runcode(interp, argc, argv); /* argc and argv as seen by the bytecode file */
Expand Down
2 changes: 1 addition & 1 deletion docs/tests.pod
Expand Up @@ -105,7 +105,7 @@ C source tests are usually located in F<t/src/*.t>. A simple test looks like:
interpreter = Parrot_new(NULL);

if (!interpreter)
return 1;
return 1;

Parrot_init(interpreter);
Parrot_run_native(interpreter, the_test);
Expand Down
2 changes: 0 additions & 2 deletions examples/c/test_main.c
Expand Up @@ -74,11 +74,9 @@ main(int argc, char *argv[])
Parrot_PackFile pf;

interpreter = Parrot_new(NULL);

if (!interpreter) {
return 1;
}

Parrot_init(interpreter);

filename = parseflags(interpreter, &argc, &argv);
Expand Down
2 changes: 1 addition & 1 deletion include/parrot/interpreter.h
@@ -1,5 +1,5 @@
/* interpreter.h
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* Copyright: 2001-2006 The Perl Foundation. All Rights Reserved.
* SVN Info
* $Id$
* Overview:
Expand Down
1 change: 0 additions & 1 deletion src/embed.c
Expand Up @@ -75,7 +75,6 @@ Use this function when you call into Parrot before entering a run loop.
void
Parrot_init(Interp *interpreter)
{

if (!interpreter->world_inited) {
/* global_setup.c:init_world sets up some vtable stuff.
* It must only be called once.
Expand Down
4 changes: 2 additions & 2 deletions src/exec.c
@@ -1,5 +1,5 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
Copyright: 2001-2006 The Perl Foundation. All Rights Reserved.
$Id$
=head1 NAME
Expand Down Expand Up @@ -35,7 +35,7 @@ static int symbol_list_find(Parrot_exec_objfile_t *obj, const char *func_name);
* Parrot_exec_run must be 0 while the program runs.
* It will be set to 2 inside eval (s. eval.pmc)
* to switch to runops_jit (s. interpreter.c:runops_exec()).
* Must be 1 while starting the compiled code to have make_interpreter
* Must be 1 while starting the compiled code to have Parrot_new()
* return the address of the global interpreter (s. interpreter.c)
* and PackFile_ConstTable_unpack use the global const_table (s. packfile.c).
* Must also be 1 while generating the executable.
Expand Down
4 changes: 2 additions & 2 deletions src/pbc_info.c
Expand Up @@ -60,13 +60,13 @@ the directory using PackFile_map_segments() and iter().
*/

int
main(int argc, char **argv)
main(int argc, char * argv[] )
{
struct PackFile *pf;
Interp *interpreter;
struct PackFile_Segment *seg;

interpreter = make_interpreter(NULL, PARROT_NO_FLAGS);
interpreter = Parrot_new(NULL);
Parrot_init(interpreter);

pf = Parrot_readbc(interpreter, argv[1]);
Expand Down
2 changes: 1 addition & 1 deletion src/pbc_merge.c
Expand Up @@ -722,7 +722,7 @@ main(int argc, char **argv)
int i;

/* Create a Parrot interpreter. */
interpreter = make_interpreter(NULL, PARROT_NO_FLAGS);
interpreter = Parrot_new(NULL);
Parrot_init(interpreter);
Parrot_block_DOD(interpreter);

Expand Down
2 changes: 1 addition & 1 deletion src/pdump.c
Expand Up @@ -209,7 +209,7 @@ main(int argc, char **argv)
if (argc < 2) {
help();
}
interpreter = make_interpreter(NULL, PARROT_NO_FLAGS);
interpreter = Parrot_new(NULL);
/* init and set top of stack */
Parrot_init_stacktop(interpreter, &status);
while ((status = longopt_get(interpreter,
Expand Down
4 changes: 2 additions & 2 deletions src/runops_cores.c
@@ -1,5 +1,5 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
Copyright: 2001-2006 The Perl Foundation. All Rights Reserved.
$Id$
=head1 NAME
Expand Down Expand Up @@ -120,7 +120,7 @@ runops_trace_core(Interp *interpreter, opcode_t *pc)

debugger = interpreter->debugger =
/*
* using a distinc interpreter for tracing should be ok
* using a distinct interpreter for tracing should be ok
* - just in case, make it easy to switch
*/
#if 1
Expand Down

0 comments on commit a25ee79

Please sign in to comment.