Branch: Tag:

2004-05-13

2004-05-13 23:32:52 by Martin Nilsson <mani@lysator.liu.se>

Simplified type_field use

Rev: src/builtin.cmod:1.159
Rev: src/builtin_functions.c:1.554
Rev: src/docode.c:1.175
Rev: src/modules/Image/polyfill.c:1.48
Rev: src/modules/files/efuns.c:1.143
Rev: src/modules/files/file.c:1.320
Rev: src/signal_handler.c:1.297

2:   || 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"
1946:    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++) {