| 2309 | } |
| 2310 | |
| 2311 | int searchbinary(struct address_value *buffer,char *data,int64_t array_length) { |
| 2312 | int64_t half,min,max,current; |
| 2313 | int r = 0,rcmp; |
| 2314 | min = 0; |
| 2315 | current = 0; |
| 2316 | max = array_length; |
| 2317 | half = array_length; |
| 2318 | while(!r && half >= 1) { |
| 2319 | half = (max - min)/2; |
| 2320 | rcmp = memcmp(data,buffer[current+half].value,20); |
| 2321 | if(rcmp == 0) { |
| 2322 | r = 1; //Found!! |
| 2323 | } |
| 2324 | else { |
| 2325 | if(rcmp < 0) { //data < temp_read |
| 2326 | max = (max-half); |
| 2327 | } |
| 2328 | else { // data > temp_read |
| 2329 | min = (min+half); |
| 2330 | } |
| 2331 | current = min; |
| 2332 | } |
| 2333 | } |
| 2334 | return r; |
| 2335 | } |
| 2336 | |
| 2337 | #if defined(_WIN64) && !defined(__CYGWIN__) |
| 2338 | DWORD WINAPI thread_process_minikeys(LPVOID vargp) { |
no outgoing calls
no test coverage detected