summaryrefslogtreecommitdiff
path: root/libguile/quicksort.i.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-11-27 18:13:59 +0100
committerAndy Wingo <wingo@pobox.com>2009-12-01 21:00:25 +0100
commit6c9e8a53542019d1d207f25bfb18fbba9aabf59d (patch)
tree23d07556bc98d02da91044aa8c2eb3073facfec7 /libguile/quicksort.i.c
parentb3f04491ee90015cd661b08dcb0b5ae731ee6022 (diff)
downloadguile-6c9e8a53542019d1d207f25bfb18fbba9aabf59d.tar.gz
remove uses of trampolines within guile itself
* libguile/eval.c (scm_map, scm_for_each) * libguile/hashtab.c (scm_hash_for_each_handle) * libguile/list.c (scm_filter, scm_filter_x) * libguile/quicksort.i.c: * libguile/sort.c (scm_restricted_vector_sort_x, scm_sorted_p) (scm_merge, scm_merge_list_x, scm_merge_x) (scm_merge_list_step, scm_sort_x, scm_sort, scm_merge_vector_x) (scm_merge_vector_step, scm_stable_sort_x, scm_sort_list_x) (scm_sort_list)nn * libguile/srfi-13.c (scm_string_any, scm_string_every) (scm_string_tabulate, scm_string_trim, string_trim_right) (scm_string_trim_both, scm_string_index, scm_string_index_right) (scm_string_skip, scm_string_skip_right, scm_string_count) (scm_string_map, scm_string_map_x, scm_string_for_each) (scm_string_for_each_index, scm_string_filter, scm_string_delete): Remove uses of trampolines.
Diffstat (limited to 'libguile/quicksort.i.c')
-rw-r--r--libguile/quicksort.i.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libguile/quicksort.i.c b/libguile/quicksort.i.c
index 91801c19a..4e39f827a 100644
--- a/libguile/quicksort.i.c
+++ b/libguile/quicksort.i.c
@@ -55,7 +55,7 @@
static void
NAME (SCM *const base_ptr, size_t nr_elems, INC_PARAM
- scm_t_trampoline_2 cmp, SCM less)
+ SCM less)
{
/* Stack node declarations used to store unfulfilled partition obligations. */
typedef struct {
@@ -93,13 +93,13 @@ NAME (SCM *const base_ptr, size_t nr_elems, INC_PARAM
SCM_TICK;
- if (scm_is_true ((*cmp) (less, ELT(mid), ELT(lo))))
+ if (scm_is_true (scm_call_2 (less, ELT(mid), ELT(lo))))
SWAP (ELT(mid), ELT(lo));
- if (scm_is_true ((*cmp) (less, ELT(hi), ELT(mid))))
+ if (scm_is_true (scm_call_2 (less, ELT(hi), ELT(mid))))
SWAP (ELT(mid), ELT(hi));
else
goto jump_over;
- if (scm_is_true ((*cmp) (less, ELT(mid), ELT(lo))))
+ if (scm_is_true (scm_call_2 (less, ELT(mid), ELT(lo))))
SWAP (ELT(mid), ELT(lo));
jump_over:;
@@ -112,7 +112,7 @@ NAME (SCM *const base_ptr, size_t nr_elems, INC_PARAM
that this algorithm runs much faster than others. */
do
{
- while (scm_is_true ((*cmp) (less, ELT(left), pivot)))
+ while (scm_is_true (scm_call_2 (less, ELT(left), pivot)))
{
left += 1;
/* The comparison predicate may be buggy */
@@ -120,7 +120,7 @@ NAME (SCM *const base_ptr, size_t nr_elems, INC_PARAM
scm_misc_error (NULL, s_buggy_less, SCM_EOL);
}
- while (scm_is_true ((*cmp) (less, pivot, ELT(right))))
+ while (scm_is_true (scm_call_2 (less, pivot, ELT(right))))
{
right -= 1;
/* The comparison predicate may be buggy */
@@ -192,7 +192,7 @@ NAME (SCM *const base_ptr, size_t nr_elems, INC_PARAM
and the operation speeds up insertion sort's inner loop. */
for (run = tmp + 1; run <= thresh; run += 1)
- if (scm_is_true ((*cmp) (less, ELT(run), ELT(tmp))))
+ if (scm_is_true (scm_call_2 (less, ELT(run), ELT(tmp))))
tmp = run;
if (tmp != 0)
@@ -206,7 +206,7 @@ NAME (SCM *const base_ptr, size_t nr_elems, INC_PARAM
SCM_TICK;
tmp = run - 1;
- while (scm_is_true ((*cmp) (less, ELT(run), ELT(tmp))))
+ while (scm_is_true (scm_call_2 (less, ELT(run), ELT(tmp))))
{
/* The comparison predicate may be buggy */
if (tmp == 0)