cvsuser     03/12/13 07:01:19

  Modified:    classes  parrotinterpreter.pmc
               imcc     main.c
               include/parrot embed.h interpreter.h
               src      debug.c embed.c interpreter.c pbc_info.c pdump.c
                        runops_cores.c
               t/src    basic.t exit.t extend.t hash.t intlist.t io.t
                        list.t sprintf.t
  Log:
  Parrot_new takes a parent interp argument now
  
  Revision  Changes    Path
  1.7       +3 -3      parrot/classes/parrotinterpreter.pmc
  
  Index: parrotinterpreter.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/classes/parrotinterpreter.pmc,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -r1.6 -r1.7
  --- parrotinterpreter.pmc     15 Oct 2003 08:31:15 -0000      1.6
  +++ parrotinterpreter.pmc     13 Dec 2003 15:01:09 -0000      1.7
  @@ -1,7 +1,7 @@
   /* parrotinterpreter.pmc
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: parrotinterpreter.pmc,v 1.6 2003/10/15 08:31:15 leo Exp $
  + *     $Id: parrotinterpreter.pmc,v 1.7 2003/12/13 15:01:09 leo Exp $
    *  Overview:
    *     These are the vtable functions for the ParrotInterpreter base class
    *  Data Structure and Algorithms:
  @@ -23,10 +23,10 @@
   
       void init () {
        struct Parrot_Interp *new_interp;
  -     new_interp = make_interpreter(0);
  -     new_interp->parent_interpreter = interpreter;
  +     new_interp = make_interpreter(INTERP, 0);
        PMC_data(SELF) = new_interp;
       }
  +
       void set_integer_native (INTVAL value) {
        SELF->cache.int_val = value;
       }
  
  
  
  1.62      +1 -1      parrot/imcc/main.c
  
  Index: main.c
  ===================================================================
  RCS file: /cvs/public/parrot/imcc/main.c,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -w -r1.61 -r1.62
  --- main.c    13 Nov 2003 07:05:00 -0000      1.61
  +++ main.c    13 Dec 2003 15:01:12 -0000      1.62
  @@ -400,7 +400,7 @@
       struct PackFile *pf;
       int obj_file;
   
  -    struct Parrot_Interp *interpreter = Parrot_new();
  +    struct Parrot_Interp *interpreter = Parrot_new(NULL);
   
       Parrot_init(interpreter);
       interpreter->imc_info = mem_sys_allocate_zeroed(sizeof(imc_info_t));
  
  
  
  1.22      +2 -2      parrot/include/parrot/embed.h
  
  Index: embed.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/embed.h,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -w -r1.21 -r1.22
  --- embed.h   15 Oct 2003 08:31:23 -0000      1.21
  +++ embed.h   13 Dec 2003 15:01:15 -0000      1.22
  @@ -1,7 +1,7 @@
   /* embed.h
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: embed.h,v 1.21 2003/10/15 08:31:23 leo Exp $
  + *     $Id: embed.h,v 1.22 2003/12/13 15:01:15 leo Exp $
    *  Overview:
    *     This is the Parrot embedding system--the only part of Parrot that
    *     the outside world should see.
  @@ -21,7 +21,7 @@
   
   typedef int Parrot_warnclass;
   
  -Parrot_Interp Parrot_new(void);
  +Parrot_Interp Parrot_new(Parrot_Interp parent);
   
   void Parrot_init(Parrot_Interp);
   
  
  
  
  1.105     +9 -2      parrot/include/parrot/interpreter.h
  
  Index: interpreter.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/interpreter.h,v
  retrieving revision 1.104
  retrieving revision 1.105
  diff -u -w -r1.104 -r1.105
  --- interpreter.h     24 Nov 2003 05:45:06 -0000      1.104
  +++ interpreter.h     13 Dec 2003 15:01:15 -0000      1.105
  @@ -1,7 +1,7 @@
   /* interpreter.h
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: interpreter.h,v 1.104 2003/11/24 05:45:06 mrjoltcola Exp $
  + *     $Id: interpreter.h,v 1.105 2003/12/13 15:01:15 leo Exp $
    *  Overview:
    *     The interpreter api handles running the operations
    *  Data Structure and Algorithms:
  @@ -229,6 +229,13 @@
       struct MMD_table *binop_mmd_funcs; /* Table of MMD function pointers */
   } Interp;
   
  +typedef enum {
  +    RESUME_NONE         = 0x00,
  +    RESUME_RESTART      = 0x01,
  +    RESUME_ISJ          = 0x02,
  +    RESUME_INITIAL      = 0x04
  +} resume_flag_enum;
  +
   /* &gen_from_enum(iglobals.pasm) */
   typedef enum {
       IGLOBALS_CLASSNAME_HASH,
  @@ -277,7 +284,7 @@
   
   /* &end_gen */
   
  -struct Parrot_Interp *make_interpreter(Interp_flags);
  +struct Parrot_Interp *make_interpreter(Parrot_Interp parent, Interp_flags);
   void Parrot_init(Parrot_Interp);
   void Parrot_destroy(Parrot_Interp);
   INTVAL interpinfo(struct Parrot_Interp *interpreter, INTVAL what);
  
  
  
  1.116     +2 -2      parrot/src/debug.c
  
  Index: debug.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/debug.c,v
  retrieving revision 1.115
  retrieving revision 1.116
  diff -u -w -r1.115 -r1.116
  --- debug.c   23 Oct 2003 17:48:59 -0000      1.115
  +++ debug.c   13 Dec 2003 15:01:17 -0000      1.116
  @@ -2,7 +2,7 @@
    * debug.c
    *
    * CVS Info
  - *    $Id: debug.c,v 1.115 2003/10/23 17:48:59 robert Exp $
  + *    $Id: debug.c,v 1.116 2003/12/13 15:01:17 leo Exp $
    * Overview:
    *    Parrot debugger
    * History:
  @@ -738,7 +738,7 @@
       /* Destroy the old interpreter FIXME */
       free(interpreter);
       /* Get a new interpreter */
  -    interpreter = make_interpreter(NO_FLAGS);
  +    interpreter = make_interpreter(interpreter, NO_FLAGS);
       interpreter->code = code;
       interpreter->pdb = pdb;
       interpreter->lo_var_ptr = stacktop;
  
  
  
  1.97      +4 -4      parrot/src/embed.c
  
  Index: embed.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/embed.c,v
  retrieving revision 1.96
  retrieving revision 1.97
  diff -u -w -r1.96 -r1.97
  --- embed.c   24 Nov 2003 05:47:40 -0000      1.96
  +++ embed.c   13 Dec 2003 15:01:17 -0000      1.97
  @@ -1,7 +1,7 @@
   /* embed.c
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: embed.c,v 1.96 2003/11/24 05:47:40 mrjoltcola Exp $
  + *     $Id: embed.c,v 1.97 2003/12/13 15:01:17 leo Exp $
    *  Overview:
    *     The Parrot embedding interface.
    *  Data Structure and Algorithms:
  @@ -16,11 +16,11 @@
   #include "parrot/parrot.h"
   #include "parrot/embed.h"
   
  -struct Parrot_Interp *
  -Parrot_new(void)
  +Parrot_Interp
  +Parrot_new(Parrot_Interp parent)
   {
       /* interpreter.c:make_interpreter builds a new Parrot_Interp. */
  -    return make_interpreter(NO_FLAGS);
  +    return make_interpreter(parent, NO_FLAGS);
   }
   
   extern void Parrot_initialize_core_pmcs(Interp *interp);
  
  
  
  1.236     +34 -24    parrot/src/interpreter.c
  
  Index: interpreter.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/interpreter.c,v
  retrieving revision 1.235
  retrieving revision 1.236
  diff -u -w -r1.235 -r1.236
  --- interpreter.c     4 Dec 2003 12:43:16 -0000       1.235
  +++ interpreter.c     13 Dec 2003 15:01:17 -0000      1.236
  @@ -1,7 +1,7 @@
   /* interpreter.c
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: interpreter.c,v 1.235 2003/12/04 12:43:16 leo Exp $
  + *     $Id: interpreter.c,v 1.236 2003/12/13 15:01:17 leo Exp $
    *  Overview:
    *     The interpreter api handles running the operations
    *  Data Structure and Algorithms:
  @@ -474,26 +474,26 @@
   runops_int(struct Parrot_Interp *interpreter, size_t offset)
   {
       int lo_var_ptr;
  +    void *old_lo_var_ptr;
       opcode_t *(*core) (struct Parrot_Interp *, opcode_t *) =
           (opcode_t *(*) (struct Parrot_Interp *, opcode_t *)) 0;
   
  +    /*
  +     * if we are entering the run-loop first-time, set the stack limit
  +     */
  +    if (interpreter->resume_flag & RESUME_INITIAL) {
  +        interpreter->lo_var_ptr = (void *)&lo_var_ptr;
  +    }
       interpreter->resume_offset = offset;
  -    interpreter->resume_flag = 1;
  +    interpreter->resume_flag |= RESUME_RESTART;
   
  -    while (interpreter->resume_flag & 1) {
  +    while (interpreter->resume_flag & RESUME_RESTART) {
           opcode_t *pc = (opcode_t *)
               interpreter->code->byte_code + interpreter->resume_offset;
   
  -        /*
  -         * if we are reentering the run-loop, offset will be non-zero
  -         * e.g. from delegate.pmc
  -         * This might be of course wrong, when a new segment is run
  -         * TODO have some flag for this case
  -         */
  -        if (!offset)
  -            interpreter->lo_var_ptr = (void *)&lo_var_ptr;
  +        old_lo_var_ptr = interpreter->lo_var_ptr;
           interpreter->resume_offset = 0;
  -        interpreter->resume_flag = 0;
  +        interpreter->resume_flag &= ~(RESUME_RESTART | RESUME_INITIAL);
           switch (interpreter->run_core) {
               case PARROT_SLOW_CORE:
   
  @@ -517,10 +517,11 @@
   #ifdef HAVE_COMPUTED_GOTO
                   /* clear stacktop, it gets set in runops_cgoto_core beyond the
                    * opfunc table again, if the compiler supports nested funcs
  +                 * - but only, if we are the top running loop
                    */
                   /* #ifdef HAVE_NESTED_FUNC */
   #  ifdef __GNUC__
  -                if (!offset)
  +                if (old_lo_var_ptr == interpreter->lo_var_ptr)
                       interpreter->lo_var_ptr = 0;
   #  endif
                   core = runops_cgoto_core;
  @@ -566,9 +567,8 @@
            * the stacktop again to a sane value, so that restarting the runloop
            * is ok.
            */
  -        if (!offset)
  -            interpreter->lo_var_ptr = (void *)&lo_var_ptr;
  -        if ((interpreter->resume_flag & 1) &&
  +        interpreter->lo_var_ptr = old_lo_var_ptr;
  +        if ((interpreter->resume_flag & RESUME_RESTART) &&
                   (int)interpreter->resume_offset < 0)
                   internal_exception(1, "branch_cs: illegal resume offset");
       }
  @@ -580,13 +580,13 @@
   static void
   runops_ex(struct Parrot_Interp *interpreter, size_t offset)
   {
  -    interpreter->resume_flag = 2;
  +    interpreter->resume_flag |= RESUME_ISJ;
   
  -    while (interpreter->resume_flag & 2) {
  -        interpreter->resume_flag = 0;
  +    while (interpreter->resume_flag & RESUME_ISJ) {
  +        interpreter->resume_flag &= ~RESUME_ISJ;
           runops_int(interpreter, offset);
   
  -        if (interpreter->resume_flag & 2) {
  +        if (interpreter->resume_flag & RESUME_ISJ) {
               /* inter segment jump
                * resume_offset = entry of name in current const_table
                */
  @@ -789,8 +789,8 @@
    *  Create the Parrot interpreter.  Allocate memory and clear the registers.
    */
   
  -struct Parrot_Interp *
  -make_interpreter(Interp_flags flags)
  +Parrot_Interp
  +make_interpreter(Parrot_Interp parent, Interp_flags flags)
   {
       struct Parrot_Interp *interpreter;
   #if EXEC_CAPABLE
  @@ -805,8 +805,18 @@
   #endif
           interpreter = mem_sys_allocate_zeroed(sizeof(struct Parrot_Interp));
   
  -    /* must be set after if this is not the first interpreter */
  +    /*
  +     * the last interpreter (w/o) parent has to cleanup globals
  +     * so remember parent if any
  +     */
  +    if (parent) {
  +        interpreter->parent_interpreter = parent;
  +        interpreter->lo_var_ptr = parent->lo_var_ptr;
  +    }
  +    else {
  +        interpreter->resume_flag = RESUME_INITIAL;
       SET_NULL(interpreter->parent_interpreter);
  +    }
   
       interpreter->DOD_block_level = 1;
       interpreter->GC_block_level = 1;
  
  
  
  1.4       +2 -2      parrot/src/pbc_info.c
  
  Index: pbc_info.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/pbc_info.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -r1.3 -r1.4
  --- pbc_info.c        23 Oct 2003 17:48:59 -0000      1.3
  +++ pbc_info.c        13 Dec 2003 15:01:17 -0000      1.4
  @@ -1,7 +1,7 @@
   /* pbc_info.c
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: pbc_info.c,v 1.3 2003/10/23 17:48:59 robert Exp $
  + *     $Id: pbc_info.c,v 1.4 2003/12/13 15:01:17 leo Exp $
    *  Overview:
    *     Sample program dumping PackFile segment names by iterating
    *     over the main directory.
  @@ -31,7 +31,7 @@
       struct Parrot_Interp *interpreter;
       struct PackFile_Segment *seg;
   
  -    interpreter = make_interpreter(NO_FLAGS);
  +    interpreter = make_interpreter(NULL, NO_FLAGS);
       Parrot_init(interpreter);
   
       pf = Parrot_readbc(interpreter, argv[1]);
  
  
  
  1.31      +2 -2      parrot/src/pdump.c
  
  Index: pdump.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/pdump.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -w -r1.30 -r1.31
  --- pdump.c   22 Nov 2003 12:13:05 -0000      1.30
  +++ pdump.c   13 Dec 2003 15:01:17 -0000      1.31
  @@ -1,7 +1,7 @@
   /* pdump.c
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: pdump.c,v 1.30 2003/11/22 12:13:05 leo Exp $
  + *     $Id: pdump.c,v 1.31 2003/12/13 15:01:17 leo Exp $
    *  Overview:
    *     A program to dump pack files to human readable form.
    *  Data Structure and Algorithms:
  @@ -115,7 +115,7 @@
       if (argc < 2) {
           help();
       }
  -    interpreter = make_interpreter(NO_FLAGS);
  +    interpreter = make_interpreter(NULL, NO_FLAGS);
       Parrot_init(interpreter);
       while ((status = longopt_get(interpreter,
                       argc, argv, options, &opt)) > 0) {
  
  
  
  1.40      +2 -2      parrot/src/runops_cores.c
  
  Index: runops_cores.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/runops_cores.c,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -w -r1.39 -r1.40
  --- runops_cores.c    22 Nov 2003 09:55:49 -0000      1.39
  +++ runops_cores.c    13 Dec 2003 15:01:17 -0000      1.40
  @@ -1,7 +1,7 @@
   /* runops_cores.c
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: runops_cores.c,v 1.39 2003/11/22 09:55:49 leo Exp $
  + *     $Id: runops_cores.c,v 1.40 2003/12/13 15:01:17 leo Exp $
    *  Overview:
    *     The switchable runops cores.
    *  Data Structure and Algorithms:
  @@ -91,7 +91,7 @@
   
   #ifdef USE_TRACE_INTERP
       if (Interp_flags_TEST(interpreter, PARROT_TRACE_FLAG)) {
  -        trace_i = make_interpreter(NO_FLAGS);
  +        trace_i = make_interpreter(interpreter, NO_FLAGS);
           Parrot_init(trace_i);
           /* remeber old context */
           trace_ctx = mem_sys_allocate(sizeof(struct Parrot_Context));
  
  
  
  1.8       +1 -1      parrot/t/src/basic.t
  
  Index: basic.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/src/basic.t,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -w -r1.7 -r1.8
  --- basic.t   26 Sep 2003 14:41:55 -0000      1.7
  +++ basic.t   13 Dec 2003 15:01:19 -0000      1.8
  @@ -36,7 +36,7 @@
   {
       struct Parrot_Interp *     interpreter;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       if (!interpreter) {
           return 1;
       }
  
  
  
  1.5       +1 -1      parrot/t/src/exit.t
  
  Index: exit.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/src/exit.t,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -r1.4 -r1.5
  --- exit.t    27 Sep 2003 11:49:37 -0000      1.4
  +++ exit.t    13 Dec 2003 15:01:19 -0000      1.5
  @@ -63,7 +63,7 @@
   {
       struct Parrot_Interp *     interpreter;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       if (!interpreter) {
           return 1;
       }
  
  
  
  1.13      +12 -12    parrot/t/src/extend.t
  
  Index: extend.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/src/extend.t,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -w -r1.12 -r1.13
  --- extend.t  25 Nov 2003 16:56:33 -0000      1.12
  +++ extend.t  13 Dec 2003 15:01:19 -0000      1.13
  @@ -15,7 +15,7 @@
       Parrot_Int parrot_reg, value, new_value;
   
       /* Interpreter set-up */
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       if ( interpreter == NULL ) return 1;
       Parrot_init(interpreter);
   
  @@ -46,7 +46,7 @@
       Parrot_Float value, new_value;
   
       /* Interpreter set-up */
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       if ( interpreter == NULL ) return 1;
       Parrot_init(interpreter);
   
  @@ -76,7 +76,7 @@
       Parrot_STRING output;
   
       /* Interpreter set-up */
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       if ( interpreter == NULL ) return 1;
       Parrot_init(interpreter);
   
  @@ -102,7 +102,7 @@
       Parrot_STRING value, new_value;
   
       /* Interpreter set-up */
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       if ( interpreter == NULL ) return 1;
       Parrot_init(interpreter);
   
  @@ -131,7 +131,7 @@
       Parrot_PMC testpmc;
   
       /* Interpreter set-up */
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       if ( interpreter == NULL ) return 1;
       Parrot_init(interpreter);
   
  @@ -162,7 +162,7 @@
       Parrot_PMC testpmc, newpmc;
   
       /* Interpreter set-up */
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       if ( interpreter == NULL ) return 1;
       Parrot_init(interpreter);
   
  @@ -198,7 +198,7 @@
       Parrot_PMC testpmc;
   
       /* Interpreter set-up */
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       if ( interpreter == NULL ) return 1;
       Parrot_init(interpreter);
   
  @@ -230,7 +230,7 @@
       Parrot_PMC testpmc;
   
       /* Interpreter set-up */
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       if ( interpreter == NULL ) return 1;
       Parrot_init(interpreter);
   
  @@ -262,7 +262,7 @@
       char* new_value;
   
       /* Interpreter set-up */
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       if ( interpreter == NULL ) return 1;
       Parrot_init(interpreter);
   
  @@ -296,7 +296,7 @@
       char* new_value;
   
       /* Interpreter set-up */
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       if ( interpreter == NULL ) return 1;
       Parrot_init(interpreter);
   
  @@ -354,7 +354,7 @@
       struct PackFile *pf;
       PMC *key, *sub, *arg;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       pf = Parrot_readbc(interpreter, "temp.pbc");
       Parrot_loadbc(interpreter, pf);
       key = key_new_cstring(interpreter, "_sub1");
  @@ -414,7 +414,7 @@
       PMC *key, *sub;
       Parrot_exception jb;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       pf = Parrot_readbc(interpreter, "temp.pbc");
       Parrot_loadbc(interpreter, pf);
       key = key_new_cstring(interpreter, "_sub1");
  
  
  
  1.10      +10 -10    parrot/t/src/hash.t
  
  Index: hash.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/src/hash.t,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -w -r1.9 -r1.10
  --- hash.t    21 Nov 2003 10:55:00 -0000      1.9
  +++ hash.t    13 Dec 2003 15:01:19 -0000      1.10
  @@ -15,7 +15,7 @@
       STRING *key;
       HashEntry value;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
   
       if ( interpreter == NULL ) return 1;
   
  @@ -49,7 +49,7 @@
       STRING *key;
       HashEntry value;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
   
       if ( interpreter == NULL ) return 1;
   
  @@ -89,7 +89,7 @@
       HashEntry _value;
       HashEntry *value = &_value;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
   
       if ( interpreter == NULL ) return 1;
   
  @@ -130,7 +130,7 @@
       HashEntry _value;
       HashEntry *value = &_value;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
   
       if ( interpreter == NULL ) return 1;
   
  @@ -179,7 +179,7 @@
       HashEntry _value;
       HashEntry *value = &_value;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
   
       if ( interpreter == NULL ) return 1;
   
  @@ -218,7 +218,7 @@
   
   int main(int argc, char* argv[]) {
       Interp* interpreter;
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
   
       if ( interpreter == NULL ) return 1;
       interpreter->lo_var_ptr = &interpreter;
  @@ -273,7 +273,7 @@
       STRING *key;
       HashEntry value;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
   
       if ( interpreter == NULL ) return 1;
   
  @@ -322,7 +322,7 @@
       STRING *key;
       PMC *value;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
   
       if ( interpreter == NULL ) return 1;
   
  @@ -377,7 +377,7 @@
       STRING *key;
       PMC *value;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
   
       if ( interpreter == NULL ) return 1;
   
  @@ -425,7 +425,7 @@
       STRING *key;
       HashEntry value;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
   
       if ( interpreter == NULL ) return 1;
   
  
  
  
  1.9       +4 -4      parrot/t/src/intlist.t
  
  Index: intlist.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/src/intlist.t,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -r1.8 -r1.9
  --- intlist.t 28 Aug 2003 15:26:27 -0000      1.8
  +++ intlist.t 13 Dec 2003 15:01:19 -0000      1.9
  @@ -11,7 +11,7 @@
               int x;
               IntList* list;
   
  -            Interp* interpreter = Parrot_new();
  +            Interp* interpreter = Parrot_new(NULL);
               if (interpreter == NULL) return 1;
               Parrot_init(interpreter);
   
  @@ -40,7 +40,7 @@
               int i;
               IntList* list;
   
  -            Interp* interpreter = Parrot_new();
  +            Interp* interpreter = Parrot_new(NULL);
               if (interpreter == NULL) return "create interpreter";
               Parrot_init(interpreter);
   
  @@ -173,7 +173,7 @@
               IntList* list;
               Interp* interpreter;
   
  -            interpreter = Parrot_new();
  +            interpreter = Parrot_new(NULL);
               if (interpreter == NULL) return 1;
               Parrot_init(interpreter);
   
  @@ -278,7 +278,7 @@
               IntList* list;
               Interp* interpreter;
   
  -            interpreter = Parrot_new();
  +            interpreter = Parrot_new(NULL);
               if (interpreter == NULL) return 1;
               Parrot_init(interpreter);
   
  
  
  
  1.8       +67 -66    parrot/t/src/io.t
  
  Index: io.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/src/io.t,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -w -r1.7 -r1.8
  --- io.t      26 Nov 2003 16:06:55 -0000      1.7
  +++ io.t      13 Dec 2003 15:01:19 -0000      1.8
  @@ -37,7 +37,7 @@
   {
       struct Parrot_Interp *interpreter;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       Parrot_init(interpreter);
   
       PIO_printf(interpreter, "Hello, World!\n");
  @@ -62,7 +62,7 @@
       ParrotIO *io;
       char *p;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       Parrot_init(interpreter);
   
       io = PIO_STDOUT(interpreter);
  @@ -101,7 +101,7 @@
       char buf[1024];
       UINTVAL len;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       Parrot_init(interpreter);
   
       io = PIO_open(interpreter, NULL, "temp.file", "<");
  @@ -118,7 +118,8 @@
       do {
           len = PIO_read(interpreter, io, buf, 3);
           buf[len] = '\0';
  -        PIO_printf(interpreter, "%d: %s\n", len, buf);
  +     /* dont write trailing spaces */
  +        PIO_printf(interpreter, "%d: %s\n", len, len ? buf : "EOF");
       } while (len > 0);
   
       return 0;
  @@ -131,7 +132,7 @@
   3: rld
   2: !
   
  -0: 
  +0: EOF
   OUTPUT
   
   ###############################################################################
  @@ -147,7 +148,7 @@
       struct Parrot_Interp *interpreter;
       ParrotIO *io;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       Parrot_init(interpreter);
   
       io = PIO_open(interpreter, NULL, "temp.file", ">>");
  @@ -180,7 +181,7 @@
       size_t len;
       char buf[1024];
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       Parrot_init(interpreter);
   
       io = PIO_open(interpreter, NULL, "temp.file", "<");
  @@ -189,7 +190,7 @@
       do {
           len = PIO_read(interpreter, io, buf, sizeof(buf)-1);
           buf[len] = '\0';
  -        PIO_printf(interpreter, "%d: %s", len, buf);
  +        PIO_printf(interpreter, "%d: %s", len, len ? buf : "EOF");
       } while (len > 0);
   
      PIO_printf(interpreter, "\n");
  @@ -199,7 +200,7 @@
   CODE
   14: Hello, World!
   14: Parrot flies.
  -0: 
  +0: EOF
   OUTPUT
   
   ###############################################################################
  @@ -256,7 +257,7 @@
       PMC *io;
       int i, j;
        
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       
       if ( interpreter == NULL ) return 1;
       
  @@ -303,7 +304,7 @@
       PMC *io;
       char *buffer;
       
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       
       if ( interpreter == NULL ) return 1;
       
  @@ -360,7 +361,7 @@
       PMC *io;
       char *buffer;
       
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       
       if ( interpreter == NULL ) return 1;
       
  @@ -399,7 +400,7 @@
       Interp* interpreter;
       PMC *io;
       
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       
       if ( interpreter == NULL ) return 1;
       
  @@ -435,7 +436,7 @@
       Interp* interpreter;
       PMC *io;
       
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       
       if ( interpreter == NULL ) return 1;
       
  @@ -514,7 +515,7 @@
       int i;
       int got;
       
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       
       if ( interpreter == NULL ) return 1;
       
  @@ -573,7 +574,7 @@
       PIOHANDLE fd;
       PMC *io;
       
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       
       if ( interpreter == NULL ) return 1;
       
  @@ -613,7 +614,7 @@
       Interp *interpreter;
       PMC *io;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       
       if ( interpreter == NULL ) return 1;
       
  
  
  
  1.11      +2 -2      parrot/t/src/list.t
  
  Index: list.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/src/list.t,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -w -r1.10 -r1.11
  --- list.t    28 Aug 2003 15:26:27 -0000      1.10
  +++ list.t    13 Dec 2003 15:01:19 -0000      1.11
  @@ -17,7 +17,7 @@
       List* list, *list2;
       PMC *p1, *p2;
   
  -    Interp* interpreter = Parrot_new();
  +    Interp* interpreter = Parrot_new(NULL);
       if (interpreter == NULL) return 1;
       Parrot_init(interpreter);
   
  @@ -279,7 +279,7 @@
       char buf[100];
       int i, j, ok;
   
  -    Interp* interpreter = Parrot_new();
  +    Interp* interpreter = Parrot_new(NULL);
       if (interpreter == NULL) return 1;
       Parrot_init(interpreter);
   
  
  
  
  1.25      +2 -2      parrot/t/src/sprintf.t
  
  Index: sprintf.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/src/sprintf.t,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -w -r1.24 -r1.25
  --- sprintf.t 22 Sep 2003 11:57:32 -0000      1.24
  +++ sprintf.t 13 Dec 2003 15:01:19 -0000      1.25
  @@ -153,7 +153,7 @@
   int main(int argc, char* argv[]) {
       struct Parrot_Interp * interpreter;
   
  -    interpreter = Parrot_new();
  +    interpreter = Parrot_new(NULL);
       Parrot_init(interpreter);
       do_test(interpreter);
   
  @@ -198,7 +198,7 @@
       INTVAL i;
       struct Parrot_Interp *interp = NULL;
   
  -    interp = Parrot_new ();
  +    interp = Parrot_new (NULL);
       Parrot_init(interp);
       interp->lo_var_ptr = &i; /* we don't have a run-loop so ... */
   
  
  
  

Reply via email to