From 694b6c97ebb8310bc18dd305c2f277bcc11cebca Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Fri, 27 Jul 2012 10:04:35 +0400 Subject: Utility function to make a list from specified amount of objects. * lisp.h (enum constype): New datatype. (listn): New prototype. * alloc.c (listn): New function. (Fmemory_use_count, syms_of_alloc): Use it. * buffer.c (syms_of_buffer): Likewise. * callint.c (syms_of_callint): Likewise. * charset.c (define_charset_internal): Likewise. * coding.c (syms_of_coding): Likewise. * keymap.c (syms_of_keymap): Likewise. * search.c (syms_of_search): Likewise. * syntax.c (syms_of_syntax): Likewise. * w32.c (init_environment): Likewise. * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise. * xdisp.c (syms_of_xdisp): Likewise. * xfns.c (syms_of_xfns): Likewise. --- src/coding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/coding.c') diff --git a/src/coding.c b/src/coding.c index 212eb8275fe..8b858aa218e 100644 --- a/src/coding.c +++ b/src/coding.c @@ -10411,7 +10411,7 @@ syms_of_coding (void) DEFSYM (Qcoding_system_error, "coding-system-error"); Fput (Qcoding_system_error, Qerror_conditions, - pure_cons (Qcoding_system_error, pure_cons (Qerror, Qnil))); + listn (PURE, 2, Qcoding_system_error, Qerror)); Fput (Qcoding_system_error, Qerror_message, build_pure_c_string ("Invalid coding system")); -- cgit v1.2.1 From 3438fe218c77633ee2c5f106e3a335f906347247 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 27 Jul 2012 12:24:34 +0300 Subject: Fix failure to compile on Windows due to 2012-07-27T06:04:35Z!dmantipov@yandex.ru. src/lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for enumeration constants, as PURE and HEAP are too general, and clash with other headers and sources, such as gmalloc.c and the MS-Windows system headers. All users changed. --- src/coding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/coding.c') diff --git a/src/coding.c b/src/coding.c index 8b858aa218e..7b178b0ce14 100644 --- a/src/coding.c +++ b/src/coding.c @@ -10411,7 +10411,7 @@ syms_of_coding (void) DEFSYM (Qcoding_system_error, "coding-system-error"); Fput (Qcoding_system_error, Qerror_conditions, - listn (PURE, 2, Qcoding_system_error, Qerror)); + listn (CONSTYPE_PURE, 2, Qcoding_system_error, Qerror)); Fput (Qcoding_system_error, Qerror_message, build_pure_c_string ("Invalid coding system")); -- cgit v1.2.1 From 6cd7a13902729007a4d1e14a299bad47c9808353 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Mon, 30 Jul 2012 10:43:46 +0400 Subject: Convert safe_call to use variable number of arguments. * xdisp.c (safe_call): Convert to use varargs. Adjust users. (safe_call2): Fix comment. * lisp.h (safe_call): Adjust prototype. * coding.c (encode_coding_object): Change to use safe_call2. * xfaces.c (merge_face_heights): Change to use safe_call1. --- src/coding.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/coding.c') diff --git a/src/coding.c b/src/coding.c index 7b178b0ce14..e4ed65079d9 100644 --- a/src/coding.c +++ b/src/coding.c @@ -7931,15 +7931,12 @@ encode_coding_object (struct coding_system *coding, } { - Lisp_Object args[3]; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; GCPRO5 (coding->src_object, coding->dst_object, src_object, dst_object, old_deactivate_mark); - args[0] = CODING_ATTR_PRE_WRITE (attrs); - args[1] = make_number (BEG); - args[2] = make_number (Z); - safe_call (3, args); + safe_call2 (CODING_ATTR_PRE_WRITE (attrs), + make_number (BEG), make_number (Z)); UNGCPRO; } if (XBUFFER (coding->src_object) != current_buffer) -- cgit v1.2.1