pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:2592:    PIKEVAR program oprog flags ID_PROTECTED|ID_PRIVATE;   #endif    PIKEVAR array args;       /* These are cleared when filename and lineno have been initialized    * from them. */    PIKEVAR program prog flags ID_PROTECTED|ID_PRIVATE;    CVAR PIKE_OPCODE_T *pc;       /* These two are considered to be uninitialized from prog, pc and -  * fun as long as lineno == -1. */ +  * fun as long as lineno == 0. */    CVAR struct pike_string *filename;    CVAR INT_TYPE lineno;    -  + #ifdef PIKE_NULL_IS_SPECIAL    INIT    {    THIS->pc = NULL; -  THIS->lineno = -1; +  THIS->lineno = 0;    THIS->filename = NULL;    } -  + #endif       EXIT    gc_trivial;    {    if (THIS->filename) {    free_string(THIS->filename);    THIS->filename = NULL;    }    THIS->pc = NULL; -  THIS->lineno = -1; +  THIS->lineno = 0;    }       /* NOTE: Use old-style getter/setter syntax for compatibility with    * old Parser.Pike.split() used by precompile.pike.    */       PIKEFUN mixed `->fun()    {    push_svalue(&THIS->_fun);    }
pike.git/src/builtin.cmod:2648:    *! This object claims to be an array for backward compatibility.    */    PIKEFUN int(0..1) _is_type(string t)    {    RETURN (t == literal_array_string);    }       static void fill_in_file_and_line()    {    struct pike_string *file = NULL; -  assert (THIS->lineno == -1); +  assert (THIS->lineno == 0);       if (THIS->pc && THIS->prog) {    file = low_get_line(THIS->pc, THIS->prog, &THIS->lineno);    THIS->pc = NULL;    }    else if (TYPEOF(THIS->_fun) == PIKE_T_FUNCTION) {   #ifdef PIKE_DEBUG    if (THIS->_fun.u.object->prog &&    THIS->_fun.u.object->prog != THIS->oprog) {    struct identifier *id = ID_FROM_INT(THIS->oprog, SUBTYPEOF(THIS->_fun));
pike.git/src/builtin.cmod:2695:    {    pop_n_elems(args);       if (c != 'O') {    push_undefined ();    return;    }       push_static_text("backtrace_frame(");    -  if (THIS->lineno == -1) fill_in_file_and_line(); +  if (THIS->lineno == 0) fill_in_file_and_line();       if (THIS->filename) {    ref_push_string(THIS->filename);    push_static_text(":");    push_int(THIS->lineno);    push_static_text(", ");    f_add(4);    } else {    push_static_text("Unknown file, ");    }
pike.git/src/builtin.cmod:2796:    return;    }       if (end >= numargs)    end = numargs-1;    }       for (i = index; i <= end; i++) {    switch(i) {    case 0: /* Filename */ -  if (THIS->lineno == -1) fill_in_file_and_line(); +  if (THIS->lineno == 0) fill_in_file_and_line();    if (THIS->filename)    ref_push_string(THIS->filename);    else    push_int(0);    break;    case 1: /* Linenumber */ -  if (THIS->lineno == -1) fill_in_file_and_line(); +  if (THIS->lineno == 0) fill_in_file_and_line();    push_int(THIS->lineno);    break;    case 2: /* Function */    push_svalue(&THIS->_fun);    break;    default: /* Arguments */    {    if ((i > 2) && (THIS->args) && (i-3 < THIS->args->size)) {    push_svalue(THIS->args->item + (i - 3));    break;
pike.git/src/builtin.cmod:2851:    else if (index < 0)    index += numargs;       if (args > 2) {    pop_n_elems(args - 2);    args = 2;    }       switch(index) {    case 0: /* Filename */ -  if (THIS->lineno == -1) fill_in_file_and_line(); +  if (THIS->lineno == 0) fill_in_file_and_line();    if (TYPEOF(*value) != PIKE_T_STRING) {    if ((TYPEOF(*value) != PIKE_T_INT) ||    (value->u.integer)) {    SIMPLE_ARG_TYPE_ERROR("`[]=", 2, "string|int(0..0)");    }    if (THIS->filename) {    free_string(THIS->filename);    THIS->filename = NULL;    }    } else {    if (THIS->filename) {    free_string(THIS->filename);    THIS->filename = NULL;    }    copy_shared_string(THIS->filename, value->u.string);    }    break;       case 1: /* Linenumber */ -  if (THIS->lineno == -1) fill_in_file_and_line(); +  if (THIS->lineno == 0) fill_in_file_and_line();    if (TYPEOF(*value) != PIKE_T_INT)    SIMPLE_ARG_TYPE_ERROR("`[]=", 2, "int(1..)");    THIS->lineno = value->u.integer;    break;       case 2: /* Function */ -  if (THIS->lineno == -1) fill_in_file_and_line(); +  if (THIS->lineno == 0) fill_in_file_and_line();    assign_svalue(&THIS->_fun, value);    break;    default: /* Arguments */    assign_svalue(THIS->args->item + index - 3, value);    break;    }    stack_swap();    pop_stack();    }