pike.git / src / program.c

version» Context lines:

pike.git/src/program.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: program.c,v 1.699 2008/05/18 15:36:23 grubba Exp $ + || $Id: program.c,v 1.700 2008/05/21 21:55:48 grubba Exp $   */      #include "global.h"   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"   #include "pike_types.h"   #include "stralloc.h"   #include "las.h"   #include "lex.h"
pike.git/src/program.c:6862:    o = loc.o;    }    if (IDENTIFIER_IS_PIKE_FUNCTION(id->identifier_flags))    return low_get_line (p->program + id->func.offset, p, linep);    return low_get_program_line(o->prog, linep);    }    *linep = 0;    return NULL;   }    + /* FIXME: Consider converting these to using va_yyreport(). */ +    PMOD_EXPORT void va_yyerror(const char *fmt, va_list args)   {    struct string_builder s;    struct pike_string *tmp;    init_string_builder(&s, 0);    string_builder_vsprintf(&s, fmt, args);    tmp = finish_string_builder(&s);    low_yyerror(tmp);    free_string(tmp);   }
pike.git/src/program.c:7976:    return;       apply_handler:    if (args > 5) {    f_sprintf(args - 4);    args = 5;    }    get_all_args("report", args, "%d%W%i%W%W",    &level, &filename, &linenumber,    &subsystem, &message); +     ref_push_string(filename);    push_int(linenumber);    ref_push_string(message);    apply_low(handler, fun, 3);    stack_pop_n_elems_keep_top(args);   }      /*! @decl void create(string|void source, @    *! CompilationHandler|void handler, @    *! int|void major, int|void minor,@
pike.git/src/program.c:8620:    *! @returns    *! Returns a continuation type if it succeeded in strengthening the type.    *!    *! Returns @tt{UNDEFINED@} otherwise (this is not an error indication).    *!    *! @seealso    *! @[pop_type_attribute()], @[push_type_attribute()]    */   static void f_compilation_apply_attribute_constant(INT32 args)   { +  struct compilation *c = THIS_COMPILATION;    struct pike_string *attribute;    struct pike_string *test;    get_all_args("apply_attribute_constant", args, "%S", &attribute);    MAKE_CONST_STRING(test, "sprintf_format");    if (attribute == test) {    f___handle_sprintf_format(args);    return;    }    MAKE_CONST_STRING(test, "sscanf_format");    if (attribute == test) {
pike.git/src/program.c:10130: Inside #if 0
   find_child_cache[h].cid=child->id;    find_child_cache[h].id=i;    return i;    }    }    }    return -1;   }   #endif /* 0 */    - void yywarning(char *fmt, ...) + void va_yyreport(int severity_level, const char *system, +  const char *fmt, va_list args)   {    struct compilation *c = MAYBE_THIS_COMPILATION;    struct string_builder s;    struct pike_string *msg; -  va_list args; +     -  if (!c) return; +  if (!c) return; /* No compiler context. */       /* If we have parse errors we might get erroneous warnings,    * so don't print them.    * This has the additional benefit of making it easier to    * visually locate the actual error message.    */ -  if (Pike_compiler->num_parse_error) return; +  if ((severity_level <= REPORT_WARNING) && +  Pike_compiler->num_parse_error) { +  return; +  }       init_string_builder(&s, 0); -  va_start(args,fmt); +     string_builder_vsprintf(&s, fmt, args); -  va_end(args); +     msg = finish_string_builder(&s);    -  push_int(REPORT_WARNING); +  push_int(severity_level);    ref_push_string(c->lex.current_file);    push_int(c->lex.current_line); -  push_constant_text("parse"); +  push_text(system);    push_string(msg);    safe_apply_current(PC_REPORT_FUN_NUM, 5);    pop_stack();   }    -  + void yyreport(int severity_level, const char *system, const char *fmt, ...) + { +  va_list args;    -  +  va_start(args,fmt); +  va_yyreport(severity_level, system, fmt, args); +  va_end(args); + }    -  + void yywarning(char *fmt, ...) + { +  va_list args; +  +  va_start(args,fmt); +  va_yyreport(REPORT_WARNING, "parse", fmt, args); +  va_end(args); + } +  +  +    /* returns 1 if a implements b */   static int low_implements(struct program *a, struct program *b)   {    int e;    struct pike_string *s=findstring("__INIT");    for(e=0;e<b->num_identifier_references;e++)    {    struct identifier *bid;    int i;    if (b->identifier_references[e].id_flags & (ID_STATIC|ID_HIDDEN))