- Don't rely on the default calling convention being cdecl for function pointers
[reactos.git] / reactos / lib / sdk / crt / search / lfind.c
1 #include <stdlib.h>
2 #include <search.h>
3
4 /*
5 * @implemented
6 */
7 void *_lfind(const void *key, const void *base, unsigned int *nelp,
8 unsigned int width, int (__cdecl *compar)(const void *, const void *))
9 {
10 char* char_base = (char*)base;
11 unsigned int i;
12
13 for (i = 0; i < *nelp; i++) {
14 if (compar(key, char_base) == 0)
15 return char_base;
16 char_base += width;
17 }
18 return NULL;
19 }
20
21