pike.git / src / operators.c

version» Context lines:

pike.git/src/operators.c:1:   /*   || 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: operators.c,v 1.209 2006/04/24 12:00:15 grubba Exp $ + || $Id: operators.c,v 1.210 2006/04/25 18:29:49 neotron Exp $   */      #include "global.h"   #include <math.h>   #include "interpret.h"   #include "svalue.h"   #include "multiset.h"   #include "mapping.h"   #include "array.h"   #include "stralloc.h"
pike.git/src/operators.c:4351:    case RANGE_LOW_FROM_END|RANGE_HIGH_FROM_END: return "arg1[<arg2..<arg3]";    case RANGE_LOW_FROM_END|RANGE_HIGH_OPEN: return "arg1[<arg2..]";    case RANGE_LOW_OPEN|RANGE_HIGH_FROM_BEG: return "arg1[..arg2]";    case RANGE_LOW_OPEN|RANGE_HIGH_FROM_END: return "arg1[..<arg2]";    case RANGE_LOW_OPEN|RANGE_HIGH_OPEN: return "arg1[..]";   #ifdef PIKE_DEBUG    default:    Pike_fatal ("Unexpected bound_types.\n");   #endif    } +  return "Unexpected bound_types"; /* Make compiler quiet */   }      PMOD_EXPORT void o_range2 (int bound_types)   /* This takes between one and three args depending on whether    * RANGE_LOW_OPEN and/or RANGE_HIGH_OPEN is set in bound_types. */   {    struct svalue *ind, *low, *high;       high = bound_types & RANGE_HIGH_OPEN ? sp : sp - 1;    low = bound_types & RANGE_LOW_OPEN ? high : high - 1;
pike.git/src/operators.c:4433:    move_svalue (ind, sp - 1);    /* low and high have lost their refs in call_old_range_lfun. */    sp = ind + 1;    }       break;    }       case T_STRING:    case T_ARRAY: { -  INT_TYPE l, h; +  INT_TYPE l=0, h=0;    if (!(bound_types & RANGE_LOW_OPEN)) {    if (low->type != T_INT)    bad_arg_error (range_func_name (bound_types),    ind, sp - ind, 2, "int", low,    "Bad lower bound. Expected int, got %s.\n",    get_name_of_type (low->type));    l = low->u.integer;    }    if (!(bound_types & RANGE_HIGH_OPEN)) {    if (high->type != T_INT)
pike.git/src/operators.c:4641:    * themselves have lost their refs in call_old_range_lfun. */    sp = ind + 1;    }    }       break;    }       case T_STRING:    case T_ARRAY: { -  INT_TYPE l, h; +  INT_TYPE l=0, h=0;    int bound_types;    CALC_BOUND_TYPES (bound_types);       if (!(bound_types & RANGE_LOW_OPEN)) {    if (ind[1].type != T_INT)    SIMPLE_ARG_TYPE_ERROR ("predef::`[..]", 2, "int");    l = ind[1].u.integer;    }    if (!(bound_types & RANGE_HIGH_OPEN)) {    if (ind[3].type != T_INT)