pike.git / src / modules / _Stdio / stat.c

version» Context lines:

pike.git/src/modules/_Stdio/stat.c:361:       else if (TYPEOF(sp[-1]) == T_ARRAY) {    struct array *a = sp[-1].u.array;    int i;    if (a->size != 7)    SIMPLE_BAD_ARG_ERROR ("Stat create", 1, "stat array with 7 elements");    for (i = 0; i < 7; i++) {    INT64 val;    if (TYPEOF(ITEM(a)[i]) == T_INT)    val = ITEM(a)[i].u.integer; - #ifdef AUTO_BIGNUM +     else if (TYPEOF(ITEM(a)[i]) == T_OBJECT &&    is_bignum_object (ITEM(a)[i].u.object)) {    if (!int64_from_bignum (&val, ITEM(a)[i].u.object))    Pike_error ("Stat create: Too big integer in stat array.\n");    } - #endif /* AUTO_BINUM */ +     else    SIMPLE_BAD_ARG_ERROR ("Stat create", 1, "array(int)");    stat_compat_set (i, val);    }    }       else    SIMPLE_BAD_ARG_ERROR ("Stat create", 1, "void|Stdio.Stat|array(int)");    }   
pike.git/src/modules/_Stdio/stat.c:576:    }    else if (args>=2) /* range */    {    INT_TYPE from, to, n=0;       if (args > 2) {    pop_n_elems(args - 2);    args = 2;    }    - #if AUTO_BIGNUM +     if (TYPEOF(sp[-2]) != T_INT &&    !(TYPEOF(sp[-2]) == T_OBJECT && is_bignum_object (sp[-2].u.object)))    SIMPLE_BAD_ARG_ERROR("Stat `[..]",1,"int");       if (TYPEOF(sp[-1]) != T_INT &&    !(TYPEOF(sp[-1]) == T_OBJECT && is_bignum_object (sp[-1].u.object)))    SIMPLE_BAD_ARG_ERROR("Stat `[..]",2,"int"); - #endif +        /* make in range 0..6 */    push_int(6);    f_min(2);    stack_swap();    push_int(0);    f_max(2);    stack_swap();       from = sp[-2].u.integer;
pike.git/src/modules/_Stdio/stat.c:623:    if (args < 2)    SIMPLE_TOO_FEW_ARGS_ERROR ("Stat `[]=", 2);       if (args > 2) {    pop_n_elems (args - 2);    args = 2;    }       if (TYPEOF(sp[-1]) == T_INT)    int_val = sp[-1].u.integer, got_int_val = 1; -  - #if AUTO_BIGNUM -  else if (TYPEOF(sp[-1]) == T_OBJECT && is_bignum_object (sp[-1].u.object)) { +  else if (TYPEOF(sp[-1]) == T_OBJECT && is_bignum_object (sp[-1].u.object)) +  {    if (!int64_from_bignum (&int_val, sp[-1].u.object))    Pike_error ("Stat `[]=: Too big integer as value.\n");    else    got_int_val = 1;    } - #endif +     /* shouldn't there be an else clause here ? */    /* No, the second argument is checked further below depending on    * what the first is. /mast */       if (TYPEOF(sp[-2]) == T_INT) {    if (!got_int_val)    SIMPLE_BAD_ARG_ERROR ("Stat `[]=", 2,    "integer when the first argument is an integer");    if (!stat_compat_set (sp[-2].u.integer, int_val))    SIMPLE_BAD_ARG_ERROR ("Stat `[]=", 1, "int(0..6)|string");