From: Darren S. <ds...@us...> - 2005-12-21 18:37:25
|
Update of /cvsroot/xine/gnome-xine/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv513/src Modified Files: script_engine.h Log Message: Add "deprecated" warning macro. Report parameter count/type errors as errors, not informational messages. Index: script_engine.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/script_engine.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- script_engine.h 11 Nov 2005 20:52:10 -0000 1.24 +++ script_engine.h 21 Dec 2005 18:37:12 -0000 1.25 @@ -240,6 +240,12 @@ #define se_log(FMT, ...) #endif +#define se_log_fncall_deprecated(func) \ + do { \ + se_log_fncall ((func)); \ + JS_ReportWarning (cx, _("Deprecated: %s"), func); \ + } while (0) + #define se_log_fncall_checkinit(func) \ do \ { \ @@ -254,49 +260,49 @@ #define se_argc_check(value, FUNC) \ if (argc != (value)) { \ - se->print_cb (se->print_cb_data, \ + JS_ReportError (cx, \ _("error: %s() needs %d parameters\n"), (FUNC), (value)); \ return JS_TRUE; \ } #define se_argc_check_range(min, max, FUNC) \ if (argc < (uintN)(min) || argc > (uintN)(max)) { \ - se->print_cb (se->print_cb_data, \ + JS_ReportError (cx, \ _("error: %s() needs %d...%d parameters\n"), (FUNC), (min), (max)); \ return JS_TRUE; \ } #define se_argc_check_max(max, FUNC) \ if (argc > (uintN)(max)) { \ - se->print_cb (se->print_cb_data, \ + JS_ReportError (cx, \ _("error: %s() needs 0...%d parameters\n"), (FUNC), (max)); \ return JS_TRUE; \ } #define se_arg_is_object(n, FUNC) \ if (!JSVAL_IS_OBJECT (argv[(n)])) { \ - se->print_cb (se->print_cb_data, \ + JS_ReportError (cx, \ _("error: %s() argument %d is not an object\n"), (FUNC), (n)+1); \ return JS_TRUE; \ } #define se_arg_is_int(n, FUNC) \ if (!JSVAL_IS_INT (argv[(n)])) { \ - se->print_cb (se->print_cb_data, \ + JS_ReportError (cx, \ _("error: %s() argument %d is not an int\n"), (FUNC), (n)+1); \ return JS_TRUE; \ } #define se_arg_is_int_or_bool(n, FUNC) \ if (!JSVAL_IS_INT (argv[(n)]) && !JSVAL_IS_BOOLEAN (argv[(n)])) { \ - se->print_cb (se->print_cb_data, \ + JS_ReportError (cx, \ _("error: %s() argument %d is not an int or a boolean\n"), (FUNC), (n)+1); \ return JS_TRUE; \ } #define se_arg_is_string(n, FUNC) \ if (!JSVAL_IS_STRING (argv[(n)])) { \ - se->print_cb (se->print_cb_data, \ + JS_ReportError (cx, \ _("error: %s() argument %d is not a string\n"), (FUNC), (n)+1); \ return JS_TRUE; \ } |