- Timestamp:
- 05/04/08 14:29:02 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/reglookup-recover.c
r112 r113 418 418 419 419 420 bool removeRange(range_list* rl, uint32 rm_idx, uint32 offset, uint32 length) 421 { 422 const range_list_element* cur_elem = range_list_get(rl, rm_idx); 423 420 bool removeRange(range_list* rl, uint32 offset, uint32 length) 421 { 422 int32 rm_idx; 423 const range_list_element* cur_elem; 424 425 rm_idx = range_list_find(rl, offset); 426 if(rm_idx < 0) 427 return false; 428 429 cur_elem = range_list_get(rl, rm_idx); 424 430 if(cur_elem == NULL) 425 431 { … … 481 487 } 482 488 483 if(!removeRange(unalloc_cells, i,key->offset, key->cell_size))489 if(!removeRange(unalloc_cells, key->offset, key->cell_size)) 484 490 return 30; 485 491 } … … 499 505 const range_list_element* cur_elem; 500 506 uint32 i, j, num_keys, off, values_length, max_length; 501 int32 idx;502 507 503 508 num_keys=range_list_size(unalloc_keys); … … 529 534 if(nk->values != NULL) 530 535 { 531 idx = range_list_find(unalloc_cells, off); 532 if(idx < 0) 536 if(!range_list_has_range(unalloc_cells, off, nk->cell_size)) 533 537 { /* We've parsed a values-list which isn't in the unallocated list, 534 538 * so prune it. … … 553 557 if(values_length != (values_length & 0xFFFFFFF8)) 554 558 values_length = (values_length & 0xFFFFFFF8) + 8; 555 if(!removeRange(unalloc_cells, idx, off, values_length)) 559 560 if(!removeRange(unalloc_cells, off, values_length)) 556 561 return 20; 557 562 … … 560 565 if(nk->values[j] != NULL) 561 566 { 562 i dx = range_list_find(unalloc_cells, nk->values[j]->offset);563 if(idx < 0)567 if(!range_list_has_range(unalloc_cells, nk->values[j]->offset, 568 nk->values[j]->cell_size)) 564 569 { /* We've parsed a value which isn't in the unallocated list, 565 570 * so prune it. … … 575 580 * and inspect data. 576 581 */ 577 if(!removeRange(unalloc_cells, idx,nk->values[j]->offset,582 if(!removeRange(unalloc_cells, nk->values[j]->offset, 578 583 nk->values[j]->cell_size)) 579 584 return 21; 580 585 581 586 /* Don't bother pruning or removing from unalloc_cells if 582 * there is no data, if it is storedthe offset.587 * there is no data, or it is stored in the offset. 583 588 */ 584 589 if(nk->values[j]->data != NULL && !nk->values[j]->data_in_offset) 585 590 { 586 591 off = nk->values[j]->data_off+REGF_BLOCKSIZE; 587 i dx = range_list_find(unalloc_cells, off);588 if(idx < 0)592 if(!range_list_has_range(unalloc_cells, off, 593 nk->values[j]->data_size)) 589 594 { /* We've parsed a data cell which isn't in the unallocated 590 595 * list, so prune it. … … 595 600 else 596 601 { /*A data record was recovered. Remove from unalloc_cells.*/ 597 if(!removeRange(unalloc_cells, idx, off,602 if(!removeRange(unalloc_cells, off, 598 603 nk->values[j]->data_size)) 599 604 return 22; … … 638 643 } 639 644 640 if(!removeRange(unalloc_cells, i,vk->offset, vk->cell_size))645 if(!removeRange(unalloc_cells, vk->offset, vk->cell_size)) 641 646 return 30; 642 647 } … … 672 677 } 673 678 674 if(!removeRange(unalloc_cells, i,sk->offset, sk->cell_size))679 if(!removeRange(unalloc_cells, sk->offset, sk->cell_size)) 675 680 return 30; 676 681 }
Note: See TracChangeset
for help on using the changeset viewer.