pike.git / src / operators.c

version» Context lines:

pike.git/src/operators.c:1770:    first_arg=my_get_arg(&_CDR(n), 0);    second_arg=my_get_arg(&_CDR(n), 1);       do_docode(CDR(n),DO_NOT_COPY_TOPLEVEL);    if(first_arg[0]->type == float_type_string &&    second_arg[0]->type == float_type_string)    {    emit0(F_ADD_FLOATS);    }    else if(first_arg[0]->type && second_arg[0]->type && -  pike_types_le(first_arg[0]->type, int_type_string) && -  pike_types_le(second_arg[0]->type, int_type_string)) +  pike_types_le(first_arg[0]->type, int_type_string, 0, 0) && +  pike_types_le(second_arg[0]->type, int_type_string, 0, 0))    {    emit0(F_ADD_INTS);    }    else    {    emit0(F_ADD);    }    modify_stack_depth(-1);    return 1;   
pike.git/src/operators.c:1802:    emit0(F_ADD_FLOATS);    modify_stack_depth(-1);    if (third_arg[0]->type == float_type_string) {    do_docode(*third_arg, 0);    emit0(F_ADD_FLOATS);    modify_stack_depth(-1);    return 1;    }    }    else if(first_arg[0]->type && second_arg[0]->type && -  pike_types_le(first_arg[0]->type, int_type_string) && -  pike_types_le(second_arg[0]->type, int_type_string)) +  pike_types_le(first_arg[0]->type, int_type_string, 0, 0) && +  pike_types_le(second_arg[0]->type, int_type_string, 0, 0))    {    do_docode(*first_arg, 0);    do_docode(*second_arg, 0);    emit0(F_ADD_INTS);    modify_stack_depth(-1);    if (third_arg[0]->type && -  pike_types_le(third_arg[0]->type, int_type_string)) { +  pike_types_le(third_arg[0]->type, int_type_string, 0, 0)) {    do_docode(*third_arg, 0);    emit0(F_ADD_INTS);    modify_stack_depth(-1);    return 1;    }    }    else    {    return 0;    }
pike.git/src/operators.c:1940: Inside #if 0
   TMP_OPT(f_gt, "`<=");    TMP_OPT(f_le, "`>");    TMP_OPT(f_ge, "`<");   #endif   #undef TMP_OPT    if((more_args = is_call_to(*first_arg, f_search)) &&    (count_args(*more_args) == 2)) {    node *search_args = *more_args;    if ((search_args->token == F_ARG_LIST) &&    CAR(search_args) && -  pike_types_le(CAR(search_args)->type, string_type_string) && +  pike_types_le(CAR(search_args)->type, string_type_string, 0, 0) &&    CDR(search_args) && -  pike_types_le(CDR(search_args)->type, string_type_string)) { +  pike_types_le(CDR(search_args)->type, string_type_string, 0, 0)) {    /* !search(string a, string b) => has_prefix(a, b) */    ADD_NODE_REF(*more_args);    return mkefuncallnode("has_prefix", search_args);    }    }    }       return 0;   }   
pike.git/src/operators.c:5478:   static node *optimize_sizeof(node *n)   {    if (CDR(n) && (CDR(n)->token == F_APPLY) &&    (CADR(n)) && (CADR(n)->token == F_CONSTANT) &&    (TYPEOF(CADR(n)->u.sval) == T_FUNCTION) &&    (SUBTYPEOF(CADR(n)->u.sval) == FUNCTION_BUILTIN)) {    extern struct program *string_split_iterator_program;    /* sizeof(efun(...)) */    if ((CADR(n)->u.sval.u.efun->function == f_divide) &&    CDDR(n) && (CDDR(n)->token == F_ARG_LIST) && -  CADDR(n) && pike_types_le(CADDR(n)->type, string_type_string) && +  CADDR(n) && pike_types_le(CADDR(n)->type, string_type_string, 0, 0) &&    CDDDR(n) && (CDDDR(n)->token == F_CONSTANT) &&    (TYPEOF(CDDDR(n)->u.sval) == T_STRING) &&    (CDDDR(n)->u.sval.u.string->len == 1)) {    p_wchar2 split = index_shared_string(CDDDR(n)->u.sval.u.string, 0);       /* sizeof(`/(str, "x")) */    ADD_NODE_REF2(CADDR(n),    return mkefuncallnode("sizeof",    mkapplynode(mkprgnode(string_split_iterator_program),    mknode(F_ARG_LIST, CADDR(n),
pike.git/src/operators.c:5500:    );    }    if ((CADR(n)->u.sval.u.efun->function == f_minus) &&    CDDR(n) && (CDDR(n)->token == F_ARG_LIST) &&    CADDR(n) && (CADDR(n)->token == F_APPLY) &&    CAADDR(n) && (CAADDR(n)->token == F_CONSTANT) &&    (TYPEOF(CAADDR(n)->u.sval) == T_FUNCTION) &&    (SUBTYPEOF(CAADDR(n)->u.sval) == FUNCTION_BUILTIN) &&    (CAADDR(n)->u.sval.u.efun->function == f_divide) &&    CDADDR(n) && (CDADDR(n)->token == F_ARG_LIST) && -  CADADDR(n) && pike_types_le(CADADDR(n)->type, string_type_string) && +  CADADDR(n) && pike_types_le(CADADDR(n)->type, string_type_string, 0, 0) &&    CDDADDR(n) && (CDDADDR(n)->token == F_CONSTANT) &&    (TYPEOF(CDDADDR(n)->u.sval) == T_STRING) &&    (CDDADDR(n)->u.sval.u.string->len == 1) &&    CDDDR(n)) {    /* sizeof(`-(`/(str, "x"), y)) */    if (((CDDDR(n)->token == F_CONSTANT) &&    (TYPEOF(CDDDR(n)->u.sval) == T_ARRAY) &&    (CDDDR(n)->u.sval.u.array->size == 1) &&    (TYPEOF(CDDDR(n)->u.sval.u.array->item[0]) == T_STRING) &&    (CDDDR(n)->u.sval.u.array->item[0].u.string->len == 0)) ||
pike.git/src/operators.c:5545:    }    return NULL;   }      static int generate_sizeof(node *n)   {    struct compilation *c = THIS_COMPILATION;    if(count_args(CDR(n)) != 1) return 0;    if(do_docode(CDR(n),DO_NOT_COPY) != 1)    Pike_fatal("Count args was wrong in sizeof().\n"); -  if( pike_types_le( my_get_arg(&CDR(n), 0)[0]->type, string_type_string ) ) +  if( pike_types_le( my_get_arg(&CDR(n), 0)[0]->type, string_type_string, 0, 0 ) )    emit0(F_SIZEOF_STRING); -  /* else if( pike_types_le( my_get_arg(&CDR(n), 0)[0]->type, array_type_string ) ) */ +  /* else if( pike_types_le( my_get_arg(&CDR(n), 0)[0]->type, array_type_string, 0, 0 ) ) */    /* emit0(F_SIZEOF_ARRAY); */    else    emit0(F_SIZEOF);    return 1;   }      extern int generate_call_function(node *n);      /*! @decl void _Static_assert(int constant_expression, string constant_message)    *!