pike.git / src / opcodes.c

version» Context lines:

pike.git/src/opcodes.c:20:   #include "pike_types.h"   #include "pike_memory.h"   #include "fd_control.h"   #include "cyclic.h"   #include "builtin_functions.h"   #include "module_support.h"   #include "security.h"   #include "bignum.h"   #include "operators.h"    - RCSID("$Id: opcodes.c,v 1.115 2001/07/31 19:31:21 marcus Exp $"); + RCSID("$Id: opcodes.c,v 1.116 2001/09/24 14:58:05 grubba Exp $");      void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)   {    INT32 i;      #ifdef PIKE_SECURITY    if(what->type <= MAX_COMPLEX)    if(!CHECK_DATA_SECURITY(what->u.array, SECURITY_BIT_INDEX))    Pike_error("Index permission denied.\n");   #endif
pike.git/src/opcodes.c:372:    default:    Pike_error("Cannot cast %s to string.\n", get_name_of_type(sp[-1].type));    }       sp[-1].type = PIKE_T_STRING;    sp[-1].u.string = make_shared_string(buf);   }      void o_cast(struct pike_type *type, INT32 run_time_type)   { -  INT32 i; -  +     if(run_time_type != sp[-1].type)    {    if(run_time_type == T_MIXED)    return;       if(sp[-1].type == T_OBJECT)    {    struct pike_string *s;    s=describe_type(type);    push_string(s);
pike.git/src/opcodes.c:494:    {    FLOAT_TYPE f = 0.0;       switch(sp[-1].type)    {    case T_INT:    f=(FLOAT_TYPE)(sp[-1].u.integer);    break;       case T_STRING: -  f=STRTOD_PCHARP(MKPCHARP(sp[-1].u.string->str, -  sp[-1].u.string->size_shift),0); +  f = +  (FLOAT_TYPE)STRTOD_PCHARP(MKPCHARP(sp[-1].u.string->str, +  sp[-1].u.string->size_shift), +  0);    free_string(sp[-1].u.string);    break;       default:    Pike_error("Cannot cast %s to float.\n",get_name_of_type(sp[-1].type));    }       sp[-1].type=T_FLOAT;    sp[-1].u.float_number=f;    break;
pike.git/src/opcodes.c:615:    if(run_time_itype != T_MIXED)    {    struct array *a;    struct array *tmp=sp[-2].u.array;    DECLARE_CYCLIC();       if((a=(struct array *)BEGIN_CYCLIC(tmp,0)))    {    ref_push_array(a);    }else{ -  INT32 e,i; +  INT32 e;   #ifdef PIKE_DEBUG    struct svalue *save_sp=sp+1;   #endif    push_array(a=allocate_array(tmp->size));    SET_CYCLIC_RET(a);       for(e=0;e<a->size;e++)    {    push_svalue(tmp->item+e);    o_cast(itype, run_time_itype);
pike.git/src/opcodes.c:660:    if(run_time_itype != T_MIXED)    {    struct multiset *m;    struct array *tmp=sp[-2].u.multiset->ind;    DECLARE_CYCLIC();       if((m=(struct multiset *)BEGIN_CYCLIC(tmp,0)))    {    ref_push_multiset(m);    }else{ -  INT32 e,i; +  INT32 e;    struct array *a;   #ifdef PIKE_DEBUG    struct svalue *save_sp=sp+1;   #endif    push_multiset(m=allocate_multiset(a=allocate_array(tmp->size)));       SET_CYCLIC_RET(m);       for(e=0;e<a->size;e++)    {
pike.git/src/opcodes.c:713:    run_time_vtype != T_MIXED)    {    struct mapping *m;    struct mapping *tmp=sp[-3].u.mapping;    DECLARE_CYCLIC();       if((m=(struct mapping *)BEGIN_CYCLIC(tmp,0)))    {    ref_push_mapping(m);    }else{ -  INT32 e,i; +  INT32 e;    struct keypair *k;   #ifdef PIKE_DEBUG    struct svalue *save_sp=sp+1;   #endif    push_mapping(m=allocate_mapping(m_sizeof(tmp)));       SET_CYCLIC_RET(m);       MAPPING_LOOP(tmp)    {
pike.git/src/opcodes.c:1121:    PIKE_CONCAT(p_wchar, MATCH_SHIFT) *match, \    ptrdiff_t match_len, \    ptrdiff_t *chars_matched, \    int *success) \   { \    struct svalue sval; \    INT32 matches, arg; \    ptrdiff_t cnt, eye, e, field_length = 0; \    int no_assign = 0, minus_flag = 0; \    struct sscanf_set set; \ -  struct svalue *argp; \ +     \    \    set.a = 0; \    success[0] = 0; \    \    eye = arg = matches = 0; \    \    for(cnt = 0; cnt < match_len; cnt++) \    { \    for(;cnt<match_len;cnt++) \
pike.git/src/opcodes.c:1250:    break; \    } \    } \    cnt=e; \    UNSET_ONERROR(err); \    break; \    } \    \    case 'c': \    { \ + CHAROPT2( \    int e; \ -  + ) \    sval.type=T_INT; \    sval.subtype=NUMBER_NUMBER; \    if(field_length == -1) \    { \    if(eye+1 > input_len) \    { \    chars_matched[0]=eye; \    return matches; \    } \    sval.u.integer=input[eye]; \
pike.git/src/opcodes.c:1286:    } \    } \   ) \    sval.u.integer=0; \    if (minus_flag) \    { \    int x, pos=0; \    \    while(--field_length >= 0) \    { \ -  int lshfun, orfun; \ +     x = input[eye]; \    \    DO_IF_BIGNUM( \    if(INT_TYPE_LSH_OVERFLOW(x, pos)) \    { \    push_int(sval.u.integer); \    convert_stack_top_to_bignum(); \    \    while(field_length-- >= 0) \    { \
pike.git/src/opcodes.c:1390:    case 'f': \    { \    PIKE_CONCAT(p_wchar, INPUT_SHIFT) *t; \    PCHARP t2; \    \    if(eye>=input_len) \    { \    chars_matched[0]=eye; \    return matches; \    } \ -  sval.u.float_number=STRTOD_PCHARP(MKPCHARP(input+eye, \ +  sval.u.float_number = \ +  (FLOAT_TYPE)STRTOD_PCHARP(MKPCHARP(input+eye, \    INPUT_SHIFT),&t2); \    t = (PIKE_CONCAT(p_wchar, INPUT_SHIFT) *)(t2.ptr); \    if(input + eye == t) \    { \    chars_matched[0]=eye; \    return matches; \    } \    eye=t-input; \    sval.type=T_FLOAT; \    DO_IF_CHECKER(sval.subtype=0); \