From af91f644f4f857ddffcf3744987e89e2dc31dc19 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 2 Sep 2006 13:39:48 +0000 Subject: (concat) [__GNUC__]: Declare with `__attribute__((noinline))'. --- src/fns.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/fns.c') diff --git a/src/fns.c b/src/fns.c index 228d48049f0..f9f4b72529e 100644 --- a/src/fns.c +++ b/src/fns.c @@ -387,7 +387,12 @@ Symbols are also allowed; their print names are used instead. */) return i1 < SCHARS (s2) ? Qt : Qnil; } -static Lisp_Object concat (); +#if __GNUC__ +/* "gcc -O3" enables automatic function inlining, which optimizes out + the arguments for the invocations of this function, whereas it + expects these values on the stack. */ +static Lisp_Object concat () __attribute__((noinline)); +#endif /* ARGSUSED */ Lisp_Object -- cgit v1.2.3 From 008ef0efaab24b4d02cb2dfeb82cd050e08a21f3 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Wed, 20 Sep 2006 23:07:17 +0000 Subject: (Fmemq): Refill doc string. (Fmemql): New defun, like memq but using eql. (syms_of_fns): Defsubr it. --- src/fns.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'src/fns.c') diff --git a/src/fns.c b/src/fns.c index f9f4b72529e..e769f40cc88 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1464,11 +1464,10 @@ The value is actually the tail of LIST whose car is ELT. */) } DEFUN ("memq", Fmemq, Smemq, 2, 2, 0, - doc: /* Return non-nil if ELT is an element of LIST. -Comparison done with `eq'. The value is actually the tail of LIST -whose car is ELT. */) +doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eq'. +The value is actually the tail of LIST whose car is ELT. */) (elt, list) - Lisp_Object elt, list; + register Lisp_Object elt, list; { while (1) { @@ -1491,6 +1490,30 @@ whose car is ELT. */) return list; } +DEFUN ("memql", Fmemql, Smemql, 2, 2, 0, +doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eql'. +The value is actually the tail of LIST whose car is ELT. */) + (elt, list) + register Lisp_Object elt; + Lisp_Object list; +{ + register Lisp_Object tail; + + if (!FLOATP (elt)) + return Fmemq (elt, list); + + for (tail = list; !NILP (tail); tail = XCDR (tail)) + { + register Lisp_Object tem; + CHECK_LIST_CONS (tail, list); + tem = XCAR (tail); + if (FLOATP (tem) && internal_equal (elt, tem, 0, 0)) + return tail; + QUIT; + } + return Qnil; +} + DEFUN ("assq", Fassq, Sassq, 2, 2, 0, doc: /* Return non-nil if KEY is `eq' to the car of an element of LIST. The value is actually the first element of LIST whose car is KEY. @@ -5833,6 +5856,7 @@ used if both `use-dialog-box' and this variable are non-nil. */); defsubr (&Selt); defsubr (&Smember); defsubr (&Smemq); + defsubr (&Smemql); defsubr (&Sassq); defsubr (&Sassoc); defsubr (&Srassq); -- cgit v1.2.3 From 983f6a3da6987ede8d4166cbd5061a2a1235d80a Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 22 Sep 2006 12:54:38 +0000 Subject: (optimize_sub_char_table): Don't optimize a sub-char-table whose default value is non-nil. --- src/fns.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/fns.c') diff --git a/src/fns.c b/src/fns.c index e769f40cc88..ff945720f4f 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2777,7 +2777,8 @@ optimize_sub_char_table (table, chars) else from = 32, to = 128; - if (!SUB_CHAR_TABLE_P (*table)) + if (!SUB_CHAR_TABLE_P (*table) + || ! NILP (XCHAR_TABLE (*table)->defalt)) return; elt = XCHAR_TABLE (*table)->contents[from++]; for (; from < to; from++) @@ -2792,7 +2793,7 @@ DEFUN ("optimize-char-table", Foptimize_char_table, Soptimize_char_table, Lisp_Object table; { Lisp_Object elt; - int dim; + int dim, chars; int i, j; CHECK_CHAR_TABLE (table); @@ -2803,10 +2804,11 @@ DEFUN ("optimize-char-table", Foptimize_char_table, Soptimize_char_table, if (!SUB_CHAR_TABLE_P (elt)) continue; dim = CHARSET_DIMENSION (i - 128); + chars = CHARSET_CHARS (i - 128); if (dim == 2) for (j = 32; j < SUB_CHAR_TABLE_ORDINARY_SLOTS; j++) - optimize_sub_char_table (XCHAR_TABLE (elt)->contents + j, dim); - optimize_sub_char_table (XCHAR_TABLE (table)->contents + i, dim); + optimize_sub_char_table (XCHAR_TABLE (elt)->contents + j, chars); + optimize_sub_char_table (XCHAR_TABLE (table)->contents + i, chars); } return Qnil; } -- cgit v1.2.3