summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-11 12:30:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-11 12:30:48 +0000
commit1b03efee58ee4c825b278a7bcb4ac80e41e7c18a (patch)
tree816ef7c640e729eeb44447211cb3be2071ee86c6 /util.c
parent32f264bfef9ef6eb96c791ee33ffad8d5e461578 (diff)
* array.c, enum.c, eval.c, util.c: safer function pointer usage.
fixed: [ruby-core:06143] * util.h (qsort): removed the definition incompatible to ANSI. fixed: [ruby-core:06147] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'util.c')
-rw-r--r--util.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/util.c b/util.c
index 1c841b346b..da21ee412e 100644
--- a/util.c
+++ b/util.c
@@ -470,12 +470,9 @@ typedef struct { char *LL, *RR; } stack_node; /* Stack structure for L,l,R,r */
((*cmp)(b,c,d)<0 ? b : ((*cmp)(a,c,d)<0 ? c : a)) : \
((*cmp)(b,c,d)>0 ? b : ((*cmp)(a,c,d)<0 ? a : c)))
-void ruby_qsort (base, nel, size, cmp, d)
- void* base;
- const int nel;
- const int size;
- int (*cmp)();
- void *d;
+void
+ruby_qsort(void* base, const int nel, const int size,
+ int (*cmp)(const void*, const void*, void*), void *d)
{
register char *l, *r, *m; /* l,r:left,right group m:median point */
register int t, eq_l, eq_r; /* eq_l: all items in left group are equal to S */