summaryrefslogtreecommitdiffstats
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
commited54d31d6c75cf8021efe7a50cd8ef7c10c5cfb2 (patch)
tree816ef7c640e729eeb44447211cb3be2071ee86c6 /util.c
parent3d9e76cd03c116687d1a12243a4ff47c0cdb3aec (diff)
downloadruby-ed54d31d6c75cf8021efe7a50cd8ef7c10c5cfb2.tar.gz
ruby-ed54d31d6c75cf8021efe7a50cd8ef7c10c5cfb2.tar.xz
ruby-ed54d31d6c75cf8021efe7a50cd8ef7c10c5cfb2.zip
* 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: http://svn.ruby-lang.org/repos/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 1c841b346..da21ee412 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 */