pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:15:   #include "error.h"   #include "pike_types.h"   #include "fsort.h"   #include "builtin_functions.h"   #include "pike_memory.h"   #include "gc.h"   #include "main.h"   #include "security.h"   #include "stuff.h"    - RCSID("$Id: array.c,v 1.54 1999/09/16 23:56:08 hubbe Exp $"); + RCSID("$Id$");      struct array empty_array=   {    1, /* Never free */   #ifdef PIKE_SECURITY    0,   #endif    &empty_array, /* Next */    &empty_array, /* previous (circular) */    0, /* Size = 0 */
pike.git/src/array.c:1378:    struct svalue s;    INT32 e;       array_fix_type_field(a);    if(!a->size)    return mkefuncallnode("aggregate",0);       if(a->type_field == BIT_INT)    {    for(e=0; e<a->size; e++) -  if(ITEM(a)[e].u.integer != 0) +  if(ITEM(a)[e].u.integer || SUBTYPEOF(ITEM(a)[e]))    break;    if(e == a->size)    {    return mkefuncallnode("allocate",mkintnode(a->size));    }    }    if(!is_more_than_one_bit(a->type_field))    {    e=0;    switch(a->type_field)    {    case BIT_INT:    for(e=1; e<a->size; e++) -  if(ITEM(a)[e].u.integer != ITEM(a)[0].u.integer) +  if((ITEM(a)[e].u.integer != ITEM(a)[0].u.integer) || +  (SUBTYPEOF(ITEM(a)[e]) != SUBTYPEOF(ITEM(a)[0]))) {    break; -  if(e==a->size && ITEM(a)[0].u.integer==0) +  } +  if(e==a->size && ITEM(a)[0].u.integer==0 && !SUBTYPEOF(ITEM(a)[0]))    return mkefuncallnode("allocate",mkintnode(a->size));    break;       case BIT_STRING:    case BIT_PROGRAM:    case BIT_OBJECT:    for(e=1; e<a->size; e++)    if(ITEM(a)[e].u.refs != ITEM(a)[0].u.refs)    break;    break;