Branch: Tag:

2002-08-15

2002-08-15 14:50:28 by Marcus Comstedt <marcus@mc.pp.se>

Rename fatal -> Pike_fatal.

Rev: src/apply_low.h:1.7
Rev: src/array.c:1.129
Rev: src/array.h:1.41
Rev: src/backend.cmod:1.27
Rev: src/bignum.c:1.25
Rev: src/block_alloc.h:1.41
Rev: src/builtin.cmod:1.90
Rev: src/builtin_functions.c:1.435
Rev: src/callback.c:1.26
Rev: src/code/ia32.c:1.21
Rev: src/code/ppc32.c:1.16
Rev: src/code/ppc32.h:1.14
Rev: src/code/sparc.c:1.11
Rev: src/code/sparc.h:1.13
Rev: src/compilation.h:1.28
Rev: src/constants.c:1.38
Rev: src/cpp.c:1.102
Rev: src/cyclic.c:1.6
Rev: src/dlopen.c:1.32
Rev: src/docode.c:1.144
Rev: src/dynamic_buffer.c:1.16
Rev: src/dynamic_load.c:1.64
Rev: src/encode.c:1.151
Rev: src/error.c:1.86
Rev: src/fd_control.c:1.41
Rev: src/fdlib.c:1.52
Rev: src/fdlib.h:1.41
Rev: src/fsort_template.h:1.11
Rev: src/gc.c:1.185
Rev: src/gc.h:1.90
Rev: src/hashtable.c:1.11
Rev: src/interpret.c:1.263
Rev: src/interpret.h:1.110
Rev: src/interpret_functions.h:1.105
Rev: src/interpreter.h:1.76
Rev: src/iterators.cmod:1.26
Rev: src/language.yacc:1.289
Rev: src/las.c:1.297
Rev: src/lex.c:1.105
Rev: src/lexer.h:1.38
Rev: src/main.c:1.150
Rev: src/mapping.c:1.149
Rev: src/module_support.c:1.46
Rev: src/modules/Gmp/mpf.cmod:1.9
Rev: src/modules/Gmp/mpq.cmod:1.10
Rev: src/modules/Gmp/mpz_glue.c:1.107
Rev: src/modules/HTTPLoop/cache.c:1.17
Rev: src/modules/HTTPLoop/requestobject.c:1.21
Rev: src/modules/Image/colors.c:1.61
Rev: src/modules/Image/colortable.c:1.109
Rev: src/modules/Image/colortable_lookup.h:1.18
Rev: src/modules/Image/encodings/bmp.c:1.35
Rev: src/modules/Image/font.c:1.72
Rev: src/modules/Image/image_module.c:1.14
Rev: src/modules/Image/layers.c:1.79
Rev: src/modules/Odbc/odbc.c:1.30
Rev: src/modules/Oracle/oracle.c:1.70
Rev: src/modules/PDF/pdf_module.c:1.11
Rev: src/modules/Parser/html.c:1.152
Rev: src/modules/Parser/parser.c:1.14
Rev: src/modules/Perl/perlmod.c:1.25
Rev: src/modules/Pipe/pipe.c:1.49
Rev: src/modules/_Charset/charsetmod.c:1.35
Rev: src/modules/_Charset/iso2022.c:1.23
Rev: src/modules/files/file.c:1.239
Rev: src/modules/files/sendfile.c:1.57
Rev: src/modules/files/socket.c:1.63
Rev: src/modules/files/stat.c:1.22
Rev: src/modules/files/udp.c:1.37
Rev: src/modules/spider/xml.c:1.52
Rev: src/modules/sprintf/sprintf.c:1.93
Rev: src/modules/sybase/sybase.c:1.9
Rev: src/multiset.c:1.50
Rev: src/multiset.h:1.25
Rev: src/object.c:1.203
Rev: src/object.h:1.71
Rev: src/opcodes.c:1.122
Rev: src/operators.c:1.159
Rev: src/peep.c:1.72
Rev: src/pike_error.h:1.19
Rev: src/pike_macros.h:1.31
Rev: src/pike_memory.c:1.120
Rev: src/pike_search.c:1.9
Rev: src/pike_search_engine.c:1.8
Rev: src/pike_search_engine2.c:1.5
Rev: src/pike_threadlib.h:1.16
Rev: src/pike_types.c:1.194
Rev: src/pike_types.h:1.79
Rev: src/port.c:1.52
Rev: src/post_modules/GTK/source/support.c:1.33
Rev: src/post_modules/Unicode/normalize.c:1.9
Rev: src/preprocessor.h:1.51
Rev: src/program.c:1.441
Rev: src/queue.c:1.8
Rev: src/rbtree.c:1.10
Rev: src/rbtree_low.h:1.2
Rev: src/signal_handler.c:1.225
Rev: src/stralloc.c:1.143
Rev: src/stralloc.h:1.66
Rev: src/svalue.c:1.144
Rev: src/svalue.h:1.106
Rev: src/threads.c:1.180

5:   \*/   /**/   #include "global.h" - RCSID("$Id: mapping.c,v 1.148 2002/05/31 22:41:24 nilsson Exp $"); + RCSID("$Id: mapping.c,v 1.149 2002/08/15 14:49:22 marcus Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"
49:   #define EXIT_BLOCK(m) do{ \   DO_IF_DEBUG( \    if(m->refs) \ -  fatal("really free mapping on mapping with nonzero refs.\n"); \ +  Pike_fatal("really free mapping on mapping with nonzero refs.\n"); \   ) \    \    FREE_PROT(m); \
94:    prev_ = md->hash + h_; \    DO_IF_DEBUG( \    if (!*prev_) { \ -  fatal("Node to move not found!\n"); \ +  Pike_fatal("Node to move not found!\n"); \    } \    ); \    while (*prev_ != md->free_list) { \    prev_ = &((*prev_)->next); \    DO_IF_DEBUG( \    if (!*prev_) { \ -  fatal("Node to move not found!\n"); \ +  Pike_fatal("Node to move not found!\n"); \    } \    ); \    } \
129: Inside #if defined(PIKE_DEBUG)
   }       if(val_types & ~(m->data->val_types)) -  fatal("Mapping value types out of order!\n"); +  Pike_fatal("Mapping value types out of order!\n");       if(ind_types & ~(m->data->ind_types)) -  fatal("Mapping indices types out of order!\n"); +  Pike_fatal("Mapping indices types out of order!\n");   }   #endif   
160: Inside #if defined(PIKE_DEBUG)
   debug_malloc_touch(m);   #ifdef PIKE_DEBUG    if (Pike_in_gc > GC_PASS_PREPARE && Pike_in_gc < GC_PASS_ZAP_WEAK) -  fatal("Can't allocate a new mapping_data inside gc.\n"); -  if(size < 0) fatal("init_mapping with negative value.\n"); +  Pike_fatal("Can't allocate a new mapping_data inside gc.\n"); +  if(size < 0) Pike_fatal("init_mapping with negative value.\n");   #endif    if(size)    {
240: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if (md->refs) { -  fatal("really_free_mapping_data(): md has non-zero refs: %d\n", +  Pike_fatal("really_free_mapping_data(): md has non-zero refs: %d\n",    md->refs);    }   #endif /* PIKE_DEBUG */
278: Inside #if undefined(PIKE_MAPPING_KEYPAIR_LOOP)
   k=md->free_list;   #ifndef PIKE_MAPPING_KEYPAIR_LOOP   #ifdef PIKE_DEBUG -  if(!k) fatal("Error in rehash: not enough keypairs.\n"); +  if(!k) Pike_fatal("Error in rehash: not enough keypairs.\n");   #endif    md->free_list=k->next;   #else /* PIKE_MAPPING_KEYPAIR_LOOP */
313: Inside #if undefined(PIKE_MAPPING_KEYPAIR_LOOP)
   k=md->free_list;   #ifndef PIKE_MAPPING_KEYPAIR_LOOP   #ifdef PIKE_DEBUG -  if(!k) fatal("Error in rehash: not enough keypairs.\n"); +  if(!k) Pike_fatal("Error in rehash: not enough keypairs.\n");   #endif    md->free_list=k->next;   #else /* PIKE_MAPPING_KEYPAIR_LOOP */
353: Inside #if defined(PIKE_DEBUG)
   debug_malloc_touch(md);   #ifdef PIKE_DEBUG    if(md->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");       if(d_flag>1) check_mapping(m);   #endif
381: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(m->data->size != tmp) -  fatal("Rehash failed, size not same any more.\n"); +  Pike_fatal("Rehash failed, size not same any more.\n");   #endif   #ifdef MAPPING_SIZE_DEBUG    m->debug_size = m->data->size;
410: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if (Pike_in_gc > GC_PASS_PREPARE && Pike_in_gc < GC_PASS_ZAP_WEAK) -  fatal("Can't allocate a new mapping_data inside gc.\n"); +  Pike_fatal("Can't allocate a new mapping_data inside gc.\n");   #endif       debug_malloc_touch(md);
449: Inside #if defined(PIKE_DEBUG)
   {   #ifdef PIKE_DEBUG    if(md->refs <= 0 || md->valrefs<=0) -  fatal("Hardlink without refs/valrefs!\n"); +  Pike_fatal("Hardlink without refs/valrefs!\n");   #endif    md->hardlinks--;    md->valrefs--;
600: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(val_types & ~(m->data->val_types)) -  fatal("Mapping value types out of order!\n"); +  Pike_fatal("Mapping value types out of order!\n");       if(ind_types & ~(m->data->ind_types)) -  fatal("Mapping indices types out of order!\n"); +  Pike_fatal("Mapping indices types out of order!\n");   #endif    m->data->val_types = val_types;    m->data->ind_types = ind_types;
646: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       h2=hash_svalue(key);
680: Inside #if defined(PIKE_DEBUG)
   mi_set_value:   #ifdef PIKE_DEBUG    if(m->data != md) -  fatal("Wrong dataset in mapping_insert!\n"); +  Pike_fatal("Wrong dataset in mapping_insert!\n");    if(d_flag>1) check_mapping(m);   #endif    free_mapping_data(md);
697: Inside #if defined(PIKE_DEBUG)
   mi_insert:   #ifdef PIKE_DEBUG    if(m->data != md) -  fatal("Wrong dataset in mapping_insert!\n"); +  Pike_fatal("Wrong dataset in mapping_insert!\n");    if(d_flag>1) check_mapping(m);   #endif    free_mapping_data(md);
759: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");       if(d_flag>1) check_mapping(m);   
796: Inside #if defined(PIKE_DEBUG)
   mg_set_value:   #ifdef PIKE_DEBUG    if(m->data != md) -  fatal("Wrong dataset in mapping_get_item_ptr!\n"); +  Pike_fatal("Wrong dataset in mapping_get_item_ptr!\n");    if(d_flag)    check_mapping(m);   #endif
814: Inside #if defined(PIKE_DEBUG)
   mg_insert:   #ifdef PIKE_DEBUG    if(m->data != md) -  fatal("Wrong dataset in mapping_get_item_ptr!\n"); +  Pike_fatal("Wrong dataset in mapping_get_item_ptr!\n");    if(d_flag)    check_mapping(m);   #endif
875: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");    if(d_flag>1) check_mapping(m);    debug_malloc_touch(m);   #endif
907: Inside #if defined(PIKE_DEBUG)
   md_remove_value:   #ifdef PIKE_DEBUG    if(md->refs <= 1) -  fatal("Too few refs i mapping->data\n"); +  Pike_fatal("Too few refs i mapping->data\n");    if(m->data != md) -  fatal("Wrong dataset in mapping_delete!\n"); +  Pike_fatal("Wrong dataset in mapping_delete!\n");    if(d_flag>1) check_mapping(m);    debug_malloc_touch(m);   #endif
955: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");    if(d_flag>1) check_mapping(m);    debug_malloc_touch(m);    if (Pike_in_gc > GC_PASS_PREPARE && Pike_in_gc < GC_PASS_FREE) -  fatal("check_mapping_for_destruct called in invalid pass inside gc.\n"); +  Pike_fatal("check_mapping_for_destruct called in invalid pass inside gc.\n");   #endif       /* no is_eq -> no locking */
1029: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");    if(d_flag>1) check_mapping(m);   #endif   
1096: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       if(!s || !s->type==T_MAPPING)
1171: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       check_mapping_for_destruct(m);
1200: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       check_mapping_for_destruct(m);
1229: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       a=allocate_array(m->data->size);
1258: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       md=m->data;
1290: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(ind->size != val->size) -  fatal("mkmapping on different sized arrays.\n"); +  Pike_fatal("mkmapping on different sized arrays.\n");   #endif       m=allocate_mapping(MAP_SLOTS(ind->size));
1329: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       n=allocate_mapping(0);
1360: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(a->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");    if(b->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       ai=mapping_indices(a);
1448:    cv=array_zip(av,b,zipper); /* b must not be used */    break;    default: -  fatal("merge_mapping_array on other than AND or SUB\n"); +  Pike_fatal("merge_mapping_array on other than AND or SUB\n");    }       UNSET_ONERROR(r2); free_array(av);
1541: Inside #if defined(PIKE_DEBUG)
   }   #ifdef PIKE_DEBUG    if(!ret) -  fatal("add_mappings is confused!\n"); +  Pike_fatal("add_mappings is confused!\n");   #endif    return ret;   }
1555: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(a->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");    if(b->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       if(a==b) return 1;
1637: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       if(! m->data->size)
1754: Inside #if defined(PIKE_DEBUG)
  {   #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       mapping_fix_type_field(m);
1826: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       doing.next=p;
1883: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif    md=m->data;   
1964: Inside #if defined(PIKE_DEBUG)
   md=m->data;       if(m->refs <=0) -  fatal("Mapping has zero refs.\n"); +  Pike_fatal("Mapping has zero refs.\n");       if(!m->data) -  fatal("Mapping has no data block.\n"); +  Pike_fatal("Mapping has no data block.\n");       if (!m->data->refs) -  fatal("Mapping data block has zero refs.\n"); +  Pike_fatal("Mapping data block has zero refs.\n");       if(m->next && m->next->prev != m) -  fatal("Mapping ->next->prev != mapping.\n"); +  Pike_fatal("Mapping ->next->prev != mapping.\n");      #ifdef MAPPING_SIZE_DEBUG    if(m->debug_size != md->size)
1988: Inside #if defined(PIKE_DEBUG) and #if defined(MAPPING_SIZE_DEBUG)
   describe(m);    fprintf(stderr,"--MAPPING ZAPPING (%d!=%d), mapping data:\n",m->debug_size,md->size);    describe(md); -  fatal("Mapping zapping detected (%d != %d)!\n",m->debug_size,md->size); +  Pike_fatal("Mapping zapping detected (%d != %d)!\n",m->debug_size,md->size);    }   #endif       if(m->prev)    {    if(m->prev->next != m) -  fatal("Mapping ->prev->next != mapping.\n"); +  Pike_fatal("Mapping ->prev->next != mapping.\n");    }else{    if(first_mapping != m) -  fatal("Mapping ->prev == 0 but first_mapping != mapping.\n"); +  Pike_fatal("Mapping ->prev == 0 but first_mapping != mapping.\n");    }       if(md->valrefs <0) -  fatal("md->valrefs < 0\n"); +  Pike_fatal("md->valrefs < 0\n");       if(md->hardlinks <0) -  fatal("md->valrefs < 0\n"); +  Pike_fatal("md->valrefs < 0\n");       if(md->refs < md->valrefs+1) -  fatal("md->refs < md->valrefs+1\n"); +  Pike_fatal("md->refs < md->valrefs+1\n");       if(md->valrefs < md->hardlinks) -  fatal("md->refs < md->valrefs+1\n"); +  Pike_fatal("md->refs < md->valrefs+1\n");       if(md->hashsize < 0) -  fatal("Assert: I don't think he's going to make it Jim.\n"); +  Pike_fatal("Assert: I don't think he's going to make it Jim.\n");       if(md->size < 0) -  fatal("Core breach, evacuate ship!\n"); +  Pike_fatal("Core breach, evacuate ship!\n");       if(md->num_keypairs < 0) -  fatal("Starboard necell on fire!\n"); +  Pike_fatal("Starboard necell on fire!\n");       if(md->size > md->num_keypairs) -  fatal("Pretty mean hashtable there buster!\n"); +  Pike_fatal("Pretty mean hashtable there buster!\n");       if(md->hashsize > md->num_keypairs) -  fatal("Pretty mean hashtable there buster %d > %d (2)!\n",md->hashsize,md->num_keypairs); +  Pike_fatal("Pretty mean hashtable there buster %d > %d (2)!\n",md->hashsize,md->num_keypairs);       if(md->num_keypairs > (md->hashsize + 3) * AVG_LINK_LENGTH) -  fatal("Mapping from hell detected, attempting to send it back...\n"); +  Pike_fatal("Mapping from hell detected, attempting to send it back...\n");       if(md->size > 0 && (!md->ind_types || !md->val_types)) -  fatal("Mapping type fields are... wrong.\n"); +  Pike_fatal("Mapping type fields are... wrong.\n");       num=0;    NEW_MAPPING_LOOP(md)
2040: Inside #if defined(PIKE_DEBUG)
   num++;       if(! ( (1 << k->ind.type) & (md->ind_types) )) -  fatal("Mapping indices type field lies.\n"); +  Pike_fatal("Mapping indices type field lies.\n");       if(! ( (1 << k->val.type) & (md->val_types) )) -  fatal("Mapping values type field lies.\n"); +  Pike_fatal("Mapping values type field lies.\n");       check_svalue(& k->ind);    check_svalue(& k->val);
2055: Inside #if defined(PIKE_DEBUG)
   }       if(md->size != num) -  fatal("Shields are failing, hull integrity down to 20%%\n"); +  Pike_fatal("Shields are failing, hull integrity down to 20%%\n");       in_check_mapping=0;   }
2080:    IND_TYPES = MD->ind_types; \    NEW_MAPPING_LOOP(MD) { \    if (!IS_DESTRUCTED(&k->ind) && RECURSE_FN(&k->ind, 1)) { \ -  DO_IF_DEBUG(fatal("Didn't expect an svalue zapping now.\n")); \ +  DO_IF_DEBUG(Pike_fatal("Didn't expect an svalue zapping now.\n")); \    } \    RECURSE_FN(&k->val, 1); \    VAL_TYPES |= 1 << k->val.type; \
2157: Inside #if defined(PIKE_DEBUG)
  {   #ifdef PIKE_DEBUG    if(m->data->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif    debug_malloc_touch(m);    debug_malloc_touch(m->data);
2215: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if(md->refs <=0) -  fatal("Zero refs in mapping->data\n"); +  Pike_fatal("Zero refs in mapping->data\n");   #endif       if ((md->ind_types | md->val_types) & BIT_COMPLEX) {
2315: Inside #if defined(PIKE_DEBUG)
   unsigned n = 0;    struct mapping *m;    if (first_mapping && first_mapping->prev) -  fatal("Error in mapping link list.\n"); +  Pike_fatal("Error in mapping link list.\n");    for (m = first_mapping; m; m = m->next) {    debug_gc_touch(m);    n++;    if (m->next && m->next->prev != m) -  fatal("Error in mapping link list.\n"); +  Pike_fatal("Error in mapping link list.\n");    }    return n;   }
2336: Inside #if defined(DEBUG_MALLOC)
   if (((int)m->data) == 0x55555555) {    fprintf(stderr, "** Zapped mapping in list of active mappings!\n");    describe_something(m, T_MAPPING, 0,2,0, NULL); -  fatal("Zapped mapping in list of active mappings!\n"); +  Pike_fatal("Zapped mapping in list of active mappings!\n");    }   #endif /* DEBUG_MALLOC */