diff options
| author | Dmitry Antipov | 2014-08-29 11:29:47 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-08-29 11:29:47 +0400 |
| commit | 1764ec4414074ea0dcbd912efdfbedb119f8ed3b (patch) | |
| tree | 0d577861c3e8a3e3e7a554adef7bcb04e0de5c38 /src/alloc.c | |
| parent | 483dc86ad0e60a1a6da498f9eb95672f286a4ab5 (diff) | |
| download | emacs-1764ec4414074ea0dcbd912efdfbedb119f8ed3b.tar.gz emacs-1764ec4414074ea0dcbd912efdfbedb119f8ed3b.zip | |
Add vectors support to Fsort.
* configure.ac (AC_CHECK_FUNCS): Check for qsort_r.
* src/fns.c (sort_vector, sort_vector_compare): New functions.
(sort_list): Likewise, refactored out of ...
(Fsort): ... adjusted user. Mention vectors in docstring.
(sort_vector_predicate) [!HAVE_QSORT_R]: New variable.
* src/alloc.c (make_save_int_obj): New function.
* src/lisp.h (enum Lisp_Save_Type): New member SAVE_TYPE_INT_OBJ.
(make_save_int_obj): Add prototype.
* test/automated/fns-tests.el (fns-tests-sort): New test.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c index 9c81ae2eedf..bb47a24d905 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -3610,6 +3610,17 @@ make_save_ptr_int (void *a, ptrdiff_t b) | |||
| 3610 | return val; | 3610 | return val; |
| 3611 | } | 3611 | } |
| 3612 | 3612 | ||
| 3613 | Lisp_Object | ||
| 3614 | make_save_int_obj (ptrdiff_t a, Lisp_Object b) | ||
| 3615 | { | ||
| 3616 | Lisp_Object val = allocate_misc (Lisp_Misc_Save_Value); | ||
| 3617 | struct Lisp_Save_Value *p = XSAVE_VALUE (val); | ||
| 3618 | p->save_type = SAVE_TYPE_INT_OBJ; | ||
| 3619 | p->data[0].integer = a; | ||
| 3620 | p->data[1].object = b; | ||
| 3621 | return val; | ||
| 3622 | } | ||
| 3623 | |||
| 3613 | #if ! (defined USE_X_TOOLKIT || defined USE_GTK) | 3624 | #if ! (defined USE_X_TOOLKIT || defined USE_GTK) |
| 3614 | Lisp_Object | 3625 | Lisp_Object |
| 3615 | make_save_ptr_ptr (void *a, void *b) | 3626 | make_save_ptr_ptr (void *a, void *b) |