PandA-2024.02
examples
function_pointers
bsearch
musl
bsearch-specialized.c
Go to the documentation of this file.
1
int
less
(
const
void
* a,
const
void
* b);
2
typedef
unsigned
int
size_t
;
3
#define NULL 0;
4
5
void
*
bsearch
(
const
void
*
key
,
const
void
*
base
,
size_t
nel,
size_t
width,
int
(*cmp)(
const
void
*,
const
void
*))
6
{
7
void
*
try
;
8
int
sign
;
9
while
(nel > 0) {
10
try
= (
char
*)base + width*(nel/2);
11
sign =
less
(key,
try
);
12
if
(!sign)
return
try
;
13
else
if
(nel == 1)
break
;
14
else
if
(sign < 0)
15
nel /= 2;
16
else
{
17
base =
try
;
18
nel -= nel/2;
19
}
20
}
21
return
NULL
;
22
}
base
char base
This version is stamped on May 10, 2016.
Definition:
nussinov.c:24
key
int key[32]
Definition:
aes.h:67
NULL
#define NULL
Definition:
bsearch-specialized.c:3
bsearch
void * bsearch(const void *__key, const void *__base, size_t __nmemb, size_t __size, int(*__compar)(const void *, const void *))
Definition:
bsearch-specialized.c:25
less
int less(const void *a, const void *b)
Definition:
less.c:4
sign
uint32_t sign
Definition:
Range_Analysis.cpp:134
size_t
unsigned int size_t
Definition:
bsearch-specialized.c:19
Generated on Mon Feb 12 2024 13:02:49 for PandA-2024.02 by
1.8.13