From 1b03efee58ee4c825b278a7bcb4ac80e41e7c18a Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 11 Oct 2005 12:30:48 +0000 Subject: * 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 --- util.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'util.c') 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 */ -- cgit v1.2.3