pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:1:   /* -*- c -*-   || 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: builtin.cmod,v 1.206 2008/06/16 23:22:10 mast Exp $ + || $Id: builtin.cmod,v 1.207 2008/06/18 20:50:59 mast Exp $   */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"
pike.git/src/builtin.cmod:2219:    Pike_error("Bad number of arguments to create().\n");    }    THIS->from = mapping_indices(from_arg->u.mapping);    THIS->to = mapping_values(from_arg->u.mapping);    pop_n_elems(args);    args = 0;    } else {    /* FIXME: Why is from declared |void, when it isn't allowed    * to be void?    * /grubba 2004-09-02 +  * +  * It probably has to do with the "if (!args)" above: It should +  * be possible to create an empty instance. /mast    */    if (!from_arg || !to_arg) {    Pike_error("Bad number of arguments to create().\n");    }    pop_n_elems(args-2);    args = 2;    if (from_arg->type != T_ARRAY) {    SIMPLE_BAD_ARG_ERROR("Replace", 1,    "array(string)|mapping(string:string)");    }