aboutsummaryrefslogtreecommitdiffstats
path: root/src/fns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c49
1 files changed, 40 insertions, 9 deletions
diff --git a/src/fns.c b/src/fns.c
index 5fe429fcf8b..31774e71787 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -387,7 +387,12 @@ Symbols are also allowed; their print names are used instead. */)
387 return i1 < SCHARS (s2) ? Qt : Qnil; 387 return i1 < SCHARS (s2) ? Qt : Qnil;
388} 388}
389 389
390static Lisp_Object concat (); 390#if __GNUC__
391/* "gcc -O3" enables automatic function inlining, which optimizes out
392 the arguments for the invocations of this function, whereas it
393 expects these values on the stack. */
394static Lisp_Object concat () __attribute__((noinline));
395#endif
391 396
392/* ARGSUSED */ 397/* ARGSUSED */
393Lisp_Object 398Lisp_Object
@@ -1459,11 +1464,10 @@ The value is actually the tail of LIST whose car is ELT. */)
1459} 1464}
1460 1465
1461DEFUN ("memq", Fmemq, Smemq, 2, 2, 0, 1466DEFUN ("memq", Fmemq, Smemq, 2, 2, 0,
1462 doc: /* Return non-nil if ELT is an element of LIST. 1467doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eq'.
1463Comparison done with `eq'. The value is actually the tail of LIST 1468The value is actually the tail of LIST whose car is ELT. */)
1464whose car is ELT. */)
1465 (elt, list) 1469 (elt, list)
1466 Lisp_Object elt, list; 1470 register Lisp_Object elt, list;
1467{ 1471{
1468 while (1) 1472 while (1)
1469 { 1473 {
@@ -1486,6 +1490,30 @@ whose car is ELT. */)
1486 return list; 1490 return list;
1487} 1491}
1488 1492
1493DEFUN ("memql", Fmemql, Smemql, 2, 2, 0,
1494doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eql'.
1495The value is actually the tail of LIST whose car is ELT. */)
1496 (elt, list)
1497 register Lisp_Object elt;
1498 Lisp_Object list;
1499{
1500 register Lisp_Object tail;
1501
1502 if (!FLOATP (elt))
1503 return Fmemq (elt, list);
1504
1505 for (tail = list; !NILP (tail); tail = XCDR (tail))
1506 {
1507 register Lisp_Object tem;
1508 CHECK_LIST_CONS (tail, list);
1509 tem = XCAR (tail);
1510 if (FLOATP (tem) && internal_equal (elt, tem, 0, 0))
1511 return tail;
1512 QUIT;
1513 }
1514 return Qnil;
1515}
1516
1489DEFUN ("assq", Fassq, Sassq, 2, 2, 0, 1517DEFUN ("assq", Fassq, Sassq, 2, 2, 0,
1490 doc: /* Return non-nil if KEY is `eq' to the car of an element of LIST. 1518 doc: /* Return non-nil if KEY is `eq' to the car of an element of LIST.
1491The value is actually the first element of LIST whose car is KEY. 1519The value is actually the first element of LIST whose car is KEY.
@@ -2749,7 +2777,8 @@ optimize_sub_char_table (table, chars)
2749 else 2777 else
2750 from = 32, to = 128; 2778 from = 32, to = 128;
2751 2779
2752 if (!SUB_CHAR_TABLE_P (*table)) 2780 if (!SUB_CHAR_TABLE_P (*table)
2781 || ! NILP (XCHAR_TABLE (*table)->defalt))
2753 return; 2782 return;
2754 elt = XCHAR_TABLE (*table)->contents[from++]; 2783 elt = XCHAR_TABLE (*table)->contents[from++];
2755 for (; from < to; from++) 2784 for (; from < to; from++)
@@ -2764,7 +2793,7 @@ DEFUN ("optimize-char-table", Foptimize_char_table, Soptimize_char_table,
2764 Lisp_Object table; 2793 Lisp_Object table;
2765{ 2794{
2766 Lisp_Object elt; 2795 Lisp_Object elt;
2767 int dim; 2796 int dim, chars;
2768 int i, j; 2797 int i, j;
2769 2798
2770 CHECK_CHAR_TABLE (table); 2799 CHECK_CHAR_TABLE (table);
@@ -2775,10 +2804,11 @@ DEFUN ("optimize-char-table", Foptimize_char_table, Soptimize_char_table,
2775 if (!SUB_CHAR_TABLE_P (elt)) 2804 if (!SUB_CHAR_TABLE_P (elt))
2776 continue; 2805 continue;
2777 dim = CHARSET_DIMENSION (i - 128); 2806 dim = CHARSET_DIMENSION (i - 128);
2807 chars = CHARSET_CHARS (i - 128);
2778 if (dim == 2) 2808 if (dim == 2)
2779 for (j = 32; j < SUB_CHAR_TABLE_ORDINARY_SLOTS; j++) 2809 for (j = 32; j < SUB_CHAR_TABLE_ORDINARY_SLOTS; j++)
2780 optimize_sub_char_table (XCHAR_TABLE (elt)->contents + j, dim); 2810 optimize_sub_char_table (XCHAR_TABLE (elt)->contents + j, chars);
2781 optimize_sub_char_table (XCHAR_TABLE (table)->contents + i, dim); 2811 optimize_sub_char_table (XCHAR_TABLE (table)->contents + i, chars);
2782 } 2812 }
2783 return Qnil; 2813 return Qnil;
2784} 2814}
@@ -5831,6 +5861,7 @@ used if both `use-dialog-box' and this variable are non-nil. */);
5831 defsubr (&Selt); 5861 defsubr (&Selt);
5832 defsubr (&Smember); 5862 defsubr (&Smember);
5833 defsubr (&Smemq); 5863 defsubr (&Smemq);
5864 defsubr (&Smemql);
5834 defsubr (&Sassq); 5865 defsubr (&Sassq);
5835 defsubr (&Sassoc); 5866 defsubr (&Sassoc);
5836 defsubr (&Srassq); 5867 defsubr (&Srassq);