- Don't rely on the default calling convention being cdecl for function pointers

svn path=/trunk/; revision=42429
This commit is contained in:
Stefan Ginsberg 2009-08-06 15:27:23 +00:00
parent 1a3dc30655
commit 60bf2397d9
4 changed files with 5 additions and 5 deletions

View file

@ -6,7 +6,7 @@
*/
void *
bsearch(const void *key, const void *base0, size_t nelem,
size_t size, int (*cmp)(const void *ck, const void *ce))
size_t size, int (__cdecl *cmp)(const void *ck, const void *ce))
{
char *base = (char *)base0;
int lim, cmpval;

View file

@ -5,7 +5,7 @@
* @implemented
*/
void *_lfind(const void *key, const void *base, unsigned int *nelp,
unsigned int width, int (*compar)(const void *, const void *))
unsigned int width, int (__cdecl *compar)(const void *, const void *))
{
char* char_base = (char*)base;
unsigned int i;

View file

@ -6,7 +6,7 @@
* @implemented
*/
void *_lsearch(const void *key, void *base, unsigned int *nelp, unsigned int width,
int (*compar)(const void *, const void *))
int (__cdecl *compar)(const void *, const void *))
{
void *ret_find = _lfind(key,base,nelp,width,compar);

View file

@ -50,7 +50,7 @@
*/
static void
qst(size_t size, int (*compar)(const void*, const void*), char *base, char *max)
qst(size_t size, int (__cdecl *compar)(const void*, const void*), char *base, char *max)
{
char c, *i, *j, *jj;
int ii;
@ -176,7 +176,7 @@ qst(size_t size, int (*compar)(const void*, const void*), char *base, char *max)
* @implemented
*/
void
qsort(void *base0, size_t n, size_t size, int (*compar)(const void*, const void*))
qsort(void *base0, size_t n, size_t size, int (__cdecl *compar)(const void*, const void*))
{
char *base = (char *)base0;
char c, *i, *j, *lo, *hi;