pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:6413:    }    }       /*! @decl array _values()    *!    *! Returns an array of elements in the list.    */    PIKEFUN array _values()    flags ID_PROTECTED;    { -  struct array * a; -  push_int(THIS->num_elems); -  f_allocate(1); +  struct array *a = allocate_array(THIS->num_elems); +  push_array(a);    -  a = Pike_sp[-1].u.array; +     if (THIS->num_elems) {    struct pike_list_node *node = THIS->head;    int i;    for (i = 0; i < THIS->num_elems; i++) {    assign_svalue_no_free(ITEM(a) + i, &node->val);    node = node->next;    }    } -  +  +  array_fix_type_field(a);    }       /*! @decl array|zero cast(string type)    *!    *! Cast the lists. @expr{array@} is the only    *! supported type.    */    PIKEFUN array|zero cast(string type)    flags ID_PROTECTED;    {