Index: xotcl/generic/xotclError.c =================================================================== diff -u -r2846921e448d4d4aeb3245ebbfe4381182f0e286 -r1aa7246cc8e44078c9dbd33e03992478615f314f --- xotcl/generic/xotclError.c (.../xotclError.c) (revision 2846921e448d4d4aeb3245ebbfe4381182f0e286) +++ xotcl/generic/xotclError.c (.../xotclError.c) (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) @@ -1,5 +1,5 @@ /* -*- Mode: c++ -*- - * $Id: xotclError.c,v 1.4 2006/09/25 08:29:04 neumann Exp $ + * $Id: xotclError.c,v 1.5 2006/09/27 08:12:40 neumann Exp $ * * Extended Object Tcl (XOTcl) * @@ -15,35 +15,35 @@ #include "xotclInt.h" int -XOTclErrMsg(Tcl_Interp *in, char* msg, Tcl_FreeProc* type) { +XOTclErrMsg(Tcl_Interp *in, char *msg, Tcl_FreeProc* type) { Tcl_SetResult(in, msg, type); return TCL_ERROR; } int -XOTclVarErrMsg TCL_VARARGS_DEF (Tcl_Interp *,arg1) +XOTclVarErrMsg TCL_VARARGS_DEF (Tcl_Interp *, arg1) { va_list argList; char *string; Tcl_Interp *in; - in = TCL_VARARGS_START(Tcl_Interp *,arg1,argList); + in = TCL_VARARGS_START(Tcl_Interp *, arg1, argList); Tcl_ResetResult(in); while (1) { - string = va_arg(argList, char *); - if (string == NULL) { - break; - } - Tcl_AppendResult(in, string, (char*) NULL); + string = va_arg(argList, char *); + if (string == NULL) { + break; + } + Tcl_AppendResult(in, string, (char *) NULL); } va_end(argList); return TCL_ERROR; } int -XOTclErrInProc (Tcl_Interp *in, Tcl_Obj* objName, - Tcl_Obj* clName, char* procName) { +XOTclErrInProc (Tcl_Interp *in, Tcl_Obj *objName, + Tcl_Obj *clName, char *procName) { Tcl_DString errMsg; char *cName, *space; ALLOC_DSTRING(&errMsg, "\n "); @@ -67,27 +67,36 @@ int XOTclObjErrArgCnt(Tcl_Interp *in, Tcl_Obj *cmdname, char *arglist) { Tcl_ResetResult(in); - Tcl_AppendResult(in, "wrong # args: should be {", 0); + Tcl_AppendResult(in, "wrong # args: should be {", (char *) NULL); if (cmdname) { - Tcl_AppendResult(in, ObjStr(cmdname), " ", 0); + Tcl_AppendResult(in, ObjStr(cmdname), " ", (char *) NULL); } - if (arglist != 0) Tcl_AppendResult(in, arglist, 0); - Tcl_AppendResult(in, "}", 0); + if (arglist != 0) Tcl_AppendResult(in, arglist, (char *) NULL); + Tcl_AppendResult(in, "}", (char *) NULL); return TCL_ERROR; } int -XOTclErrBadVal(Tcl_Interp *in, char *expected, char *value) { +XOTclErrBadVal(Tcl_Interp *in, char *context, char *expected, char *value) { Tcl_ResetResult(in); - Tcl_AppendResult(in, "expected ", expected, " but got", 0); - Tcl_AppendElement(in, value); + Tcl_AppendResult(in, context, ": expected ", expected, " but got '", + value, "'", (char *) NULL); return TCL_ERROR; } +int +XOTclErrBadVal_(Tcl_Interp *in, char *expected, char *value) { + fprintf(stderr, "Deprecated call, recompile your program with xotcl 1.5 or newer\n"); + Tcl_ResetResult(in); + Tcl_AppendResult(in, ": expected ", expected, " but got '", + value, "'", (char *) NULL); + return TCL_ERROR; +} + extern int -XOTclObjErrType(Tcl_Interp *in, Tcl_Obj *nm, char* wt) { +XOTclObjErrType(Tcl_Interp *in, Tcl_Obj *nm, char *wt) { Tcl_ResetResult(in); Tcl_AppendResult(in,"'",ObjStr(nm), "' method should be called on '", - wt, "'", 0); + wt, "'", (char *) NULL); return TCL_ERROR; }