pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:2316:    INT32 i;    for( i=0; i<a->size; i++ )    {    if( TYPEOF(a->item[i]) != PIKE_T_ARRAY )    Pike_error("Too many automap levels.\n");    if( TYPEOF(b->item[i]) != PIKE_T_ARRAY ) /* obscure messages much? */    Pike_error("Not enough levels of mapping in RHS\n");    assign_array_level( a->item[i].u.array, b->item[i].u.array, level-1 );    }    } -  else -  assign_svalues( a->item, b->item, a->size, a->type_field|b->type_field ); +  else { +  assign_svalues( a->item, b->item, a->size, +  a->type_field|b->type_field ); +  a->type_field = b->type_field;    } -  + }      /* Assign all elemnts in a at level to b.    * This implements X[*] = expression without automap.    */   void assign_array_level_value( struct array *a, struct svalue *b, int level )   {    INT32 i;    if( level > 1 )    {    /* recurse. */
pike.git/src/array.c:2342:    Pike_error("Too many automap levels.\n");    assign_array_level_value( a->item[i].u.array, b, level-1 );    }    }    else    {    if( a->type_field & BIT_REF_TYPES ) free_mixed_svalues( a->item, a->size );    if( REFCOUNTED_TYPE(TYPEOF(*b)) ) *b->u.refs+=a->size;    for( i=0; i<a->size; i++)    a->item[i] = *b; +  a->type_field = 1 << TYPEOF(*b);    }   }      typedef char *(* explode_searchfunc)(void *,void *,size_t);      /** Explode a string into an array by a delimiter.    *    * @param str the string to be split    * @param del the string to split str by    * @returns an array containing the elements of the split string