aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorDan Nicolaescu2010-07-12 21:47:45 -0700
committerDan Nicolaescu2010-07-12 21:47:45 -0700
commitb3ffc17c5dafe807981af3e0b72b3508d3b4fff4 (patch)
tree9ead3d845ae4b514f7330a27e335fbe443442dfd /src/eval.c
parent0521f5806bfc9ad55488c26c9808f513b9384ff4 (diff)
downloademacs-b3ffc17c5dafe807981af3e0b72b3508d3b4fff4.tar.gz
emacs-b3ffc17c5dafe807981af3e0b72b3508d3b4fff4.zip
Convert maybe_fatal to standard C.
* src/lisp.h (verror): Declare. * src/eval.c (verror): New function containing the code from ... (error): ... this. Call verror. * src/term.c (vfatal): New function containing the code from ... (fatal): ... this. Call vfatal. (maybe_fatal): Convert to standard C, use variable number of arguments. Declare as non-return. (init_tty): Fix maybe_fatal call.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/eval.c b/src/eval.c
index 1a7eb4a123e..953a41e4b1e 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1991,11 +1991,10 @@ find_handler_clause (Lisp_Object handlers, Lisp_Object conditions,
1991 return Qnil; 1991 return Qnil;
1992} 1992}
1993 1993
1994/* dump an error message; called like printf */
1995 1994
1996/* VARARGS 1 */ 1995/* dump an error message; called like vprintf */
1997void 1996void
1998error (const char *m, ...) 1997verror (const char *m, va_list ap)
1999{ 1998{
2000 char buf[200]; 1999 char buf[200];
2001 int size = 200; 2000 int size = 200;
@@ -2009,14 +2008,8 @@ error (const char *m, ...)
2009 2008
2010 while (1) 2009 while (1)
2011 { 2010 {
2012 va_list ap;
2013 int used; 2011 int used;
2014
2015 /* A va_list can't be reused if we have to go around the loop
2016 again; we need to "reinitialize" it each time. */
2017 va_start(ap, m);
2018 used = doprnt (buffer, size, m, m + mlen, ap); 2012 used = doprnt (buffer, size, m, m + mlen, ap);
2019 va_end(ap);
2020 if (used < size) 2013 if (used < size)
2021 break; 2014 break;
2022 size *= 2; 2015 size *= 2;
@@ -2035,6 +2028,19 @@ error (const char *m, ...)
2035 2028
2036 xsignal1 (Qerror, string); 2029 xsignal1 (Qerror, string);
2037} 2030}
2031
2032
2033/* dump an error message; called like printf */
2034
2035/* VARARGS 1 */
2036void
2037error (const char *m, ...)
2038{
2039 va_list ap;
2040 va_start (ap, m);
2041 verror (m, ap);
2042 va_end (ap);
2043}
2038 2044
2039DEFUN ("commandp", Fcommandp, Scommandp, 1, 2, 0, 2045DEFUN ("commandp", Fcommandp, Scommandp, 1, 2, 0,
2040 doc: /* Non-nil if FUNCTION makes provisions for interactive calling. 2046 doc: /* Non-nil if FUNCTION makes provisions for interactive calling.