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.158 2004/04/30 20:54:55 nilsson Exp $ + || $Id: builtin.cmod,v 1.159 2004/05/13 23:29:27 nilsson 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:1939:    }    if (!from_ || !to_) {    Pike_error("Bad number of arguments to create().\n");    }    from = from_->u.array;    to = to_->u.array;    if (from->size != to->size) {    Pike_error("Replace must have equal-sized from and to arrays.\n");    }    -  if(from->type_field & ~BIT_STRING) { -  array_fix_type_field(from); -  if(from->type_field & ~BIT_STRING) +  if( (from->type_field & ~BIT_STRING) && +  (array_fix_type_field(from) & ~BIT_STRING) )    SIMPLE_BAD_ARG_ERROR("Replace", 1, "array(string)"); -  } -  if(to->type_field & ~BIT_STRING) { -  array_fix_type_field(to); -  if(to->type_field & ~BIT_STRING) +  +  if( (to->type_field & ~BIT_STRING) && +  (array_fix_type_field(to) & ~BIT_STRING) )    SIMPLE_BAD_ARG_ERROR("Replace", 2, "array(string)"); -  } +        if (THIS->v) {    for (i = 0; i < (int)THIS->v_sz; i++) {    if (!THIS->v[i].ind) break;    free_string(THIS->v[i].ind);    THIS->v[i].ind = NULL;    free_string(THIS->v[i].val);    THIS->v[i].val = NULL;    }    }