| 2327 | } |
| 2328 | |
| 2329 | int searchbinary(struct address_value *buffer,char *data,int64_t array_length) { |
| 2330 | int64_t half,min,max,current; |
| 2331 | int r = 0,rcmp; |
| 2332 | min = 0; |
| 2333 | current = 0; |
| 2334 | max = array_length; |
| 2335 | half = array_length; |
| 2336 | while(!r && half >= 1) { |
| 2337 | half = (max - min)/2; |
| 2338 | rcmp = memcmp(data,buffer[current+half].value,20); |
| 2339 | if(rcmp == 0) { |
| 2340 | r = 1; //Found!! |
| 2341 | } |
| 2342 | else { |
| 2343 | if(rcmp < 0) { //data < temp_read |
| 2344 | max = (max-half); |
| 2345 | } |
| 2346 | else { // data > temp_read |
| 2347 | min = (min+half); |
| 2348 | } |
| 2349 | current = min; |
| 2350 | } |
| 2351 | } |
| 2352 | return r; |
| 2353 | } |
| 2354 | |
| 2355 | #if defined(_WIN64) && !defined(__CYGWIN__) |
| 2356 | DWORD WINAPI thread_process_minikeys(LPVOID vargp) { |
no outgoing calls
no test coverage detected