pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: mapping.c,v 1.155 2002/11/24 22:47:06 mast Exp $ + || $Id: mapping.c,v 1.156 2002/11/28 02:20:48 mast Exp $   */      #include "global.h" - RCSID("$Id: mapping.c,v 1.155 2002/11/24 22:47:06 mast Exp $"); + RCSID("$Id: mapping.c,v 1.156 2002/11/28 02:20:48 mast Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"   #include "svalue.h"   #include "array.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "pike_memory.h"   #include "dynamic_buffer.h"   #include "interpret.h"
pike.git/src/mapping.c:1665:    struct keypair *k;    int notfirst = 0;       if (m->data->size == 1) {    my_strcat("([ /* 1 element */\n");    } else {    sprintf(buf, "([ /* %ld elements */\n", (long)m->data->size);    my_strcat(buf);    }    -  /* no mapping locking required (I hope) */ +     NEW_MAPPING_LOOP(m->data) {    if (notfirst) my_strcat(",\n");    else notfirst = 1;    for(d = 0; d < indent; d++)    my_putchar(' '); -  + #if 0 +  /* describe_svalue might do anything. */    describe_svalue(&k->ind, indent+2, &doing);    my_putchar(':');    describe_svalue(&k->val, indent+2, &doing); -  + #else +  sprintf (buf, "<%d>", k->ind.type); +  my_strcat (buf); +  my_putchar(':'); +  sprintf (buf, "<%d>", k->val.type); +  my_strcat (buf); + #endif    }       my_putchar('\n');    for(e=2; e<indent; e++) my_putchar(' ');    my_strcat("])");    return;    }       a = mapping_indices(m);    SET_ONERROR(err, do_free_array, a);
pike.git/src/mapping.c:1708:    t_flag = 0;    if(SETJMP(catch)) {    free_svalue(&throw_value);    throw_value.type = T_INT;    }    else    sort_array_destructively(a);    UNSETJMP(catch);    t_flag = save_t_flag;    -  /* no mapping locking required (I hope) */ +     for(e = 0; e < a->size; e++)    {    struct svalue *tmp;    if(e)    my_strcat(",\n");       for(d = 0; d < indent; d++)    my_putchar(' ');       describe_svalue(ITEM(a)+e, indent+2, &doing);