Author: sginsberg
Date: Thu Aug 6 17:27:23 2009
New Revision: 42429
URL:
http://svn.reactos.org/svn/reactos?rev=42429&view=rev
Log:
- Don't rely on the default calling convention being cdecl for function pointers
Modified:
trunk/reactos/lib/sdk/crt/search/bsearch.c
trunk/reactos/lib/sdk/crt/search/lfind.c
trunk/reactos/lib/sdk/crt/search/lsearch.c
trunk/reactos/lib/sdk/crt/stdlib/qsort.c
Modified: trunk/reactos/lib/sdk/crt/search/bsearch.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/search/bsearch…
==============================================================================
--- trunk/reactos/lib/sdk/crt/search/bsearch.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/search/bsearch.c [iso-8859-1] Thu Aug 6 17:27:23 2009
@@ -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;
Modified: trunk/reactos/lib/sdk/crt/search/lfind.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/search/lfind.c…
==============================================================================
--- trunk/reactos/lib/sdk/crt/search/lfind.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/search/lfind.c [iso-8859-1] Thu Aug 6 17:27:23 2009
@@ -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;
Modified: trunk/reactos/lib/sdk/crt/search/lsearch.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/search/lsearch…
==============================================================================
--- trunk/reactos/lib/sdk/crt/search/lsearch.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/search/lsearch.c [iso-8859-1] Thu Aug 6 17:27:23 2009
@@ -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);
Modified: trunk/reactos/lib/sdk/crt/stdlib/qsort.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdlib/qsort.c…
==============================================================================
--- trunk/reactos/lib/sdk/crt/stdlib/qsort.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/stdlib/qsort.c [iso-8859-1] Thu Aug 6 17:27:23 2009
@@ -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 @@
* @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;