pike.git / src / error.c

version» Context lines:

pike.git/src/error.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: error.c,v 1.120 2004/02/09 18:49:16 mast Exp $ + || $Id: error.c,v 1.121 2004/04/18 02:19:38 mast Exp $   */      #define NO_PIKE_SHORTHAND   #include "global.h"   #include "svalue.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "interpret.h"   #include "stralloc.h"   #include "builtin_functions.h"   #include "array.h"   #include "object.h"   #include "main.h"   #include "builtin_functions.h"   #include "backend.h"   #include "operators.h"   #include "module_support.h"   #include "threads.h"   #include "gc.h"    - RCSID("$Id: error.c,v 1.120 2004/02/09 18:49:16 mast Exp $"); + RCSID("$Id: error.c,v 1.121 2004/04/18 02:19:38 mast Exp $");      #undef ATTRIBUTE   #define ATTRIBUTE(X)      PMOD_EXPORT const char msg_fatal_error[] =    "%s:%d: Fatal error:\n";   #ifdef PIKE_DEBUG   PMOD_EXPORT const char msg_unsetjmp_nosync_1[] =    "UNSETJMP out of sync! (last SETJMP at %s)!\n";   PMOD_EXPORT const char msg_unsetjmp_nosync_2[] =
pike.git/src/error.c:600:    int i = find_identifier("error_type", p);    struct identifier *id = ID_FROM_INT(p, i);    int mode = 0;    if(args>0 && Pike_sp[-args].type == PIKE_T_INT)    mode = Pike_sp[-args].u.integer;    pop_n_elems(args);    if(mode != 'O') {    push_undefined();    return;    } +  push_constant_text ("Error.");    push_svalue(&PROG_FROM_INT(p, i)->constants[id->func.offset].sval);    push_constant_text("(%O)");    if(GENERIC_ERROR_THIS->error_message)    ref_push_string(GENERIC_ERROR_THIS->error_message);    else    push_int(0);    f_sprintf(2); -  f_add(2); +  f_add(3);   }      /*! @decl void create(string message)    */   static void f_error_create(INT32 args)   {    struct pike_string *msg;    get_all_args("create", args, "%W", &msg);    do_free_string(GENERIC_ERROR_THIS->error_message);    copy_shared_string(GENERIC_ERROR_THIS->error_message, msg);
pike.git/src/error.c:775:   }      PMOD_EXPORT DECLSPEC(noreturn) void bad_arg_error(    const char *func,    struct svalue *base_sp, int args,    int which_argument,    const char *expected_type,    struct svalue *got_value,    const char *desc, ...) ATTRIBUTE((noreturn,format (printf, 7, 8)))   { -  INIT_ERROR(bad_arg); -  ERROR_COPY(bad_arg, which_argument); +  INIT_ERROR(bad_argument); +  ERROR_COPY(bad_argument, which_argument);    if (expected_type) -  ERROR_STRUCT(bad_arg,o)->expected_type=make_shared_string(expected_type); +  ERROR_STRUCT(bad_argument,o)->expected_type=make_shared_string(expected_type);    else -  ERROR_STRUCT(bad_arg,o)->expected_type = NULL; -  ERROR_COPY_SVALUE(bad_arg, got_value); +  ERROR_STRUCT(bad_argument,o)->expected_type = NULL; +  ERROR_COPY_SVALUE(bad_argument, got_value);    DWERROR((stderr, "%s():Bad arg %d (expected %s)\n",    func, which_arg, expected_type));    ERROR_DONE(generic);   }      PMOD_EXPORT DECLSPEC(noreturn) void math_error(    const char *func,    struct svalue *base_sp, int args,    struct svalue *number,    const char *desc, ...) ATTRIBUTE((noreturn,format (printf, 5, 6)))