summaryrefslogtreecommitdiffstats
path: root/src/phbf.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2016-08-20 09:26:23 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2016-08-20 09:26:23 +0200
commitd705bac84f34e4c8d587fb86af794525bc130757 (patch)
tree6a595dc12fe2ab713fdade7fab0b18d7dd77684b /src/phbf.c
parent828ec27071759b86d3c99468851db0c53e54976e (diff)
Replace td_list_entry by td_list_(first|prev|next|last)_entry to improve readability
Diffstat (limited to 'src/phbf.c')
-rw-r--r--src/phbf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/phbf.c b/src/phbf.c
index 1165557..5d501a3 100644
--- a/src/phbf.c
+++ b/src/phbf.c
@@ -590,15 +590,17 @@ static bf_status_t photorec_bf_frag(struct ph_param *params, file_recovery_t *fi
extrablock_offset=0;
if(!td_list_empty(&file_recovery->location.list))
{
- const alloc_list_t *element=td_list_entry_const(file_recovery->location.list.prev, const alloc_list_t, list);
+ const alloc_list_t *element=td_list_last_entry(&file_recovery->location.list, alloc_list_t, list);
extrablock_offset=element->end/blocksize*blocksize;
}
/* Get the corresponding search_place */
- extractblock_search_space=td_list_entry(list_search_space->list.next, alloc_data_t, list);
+ extractblock_search_space=td_list_first_entry(&list_search_space->list, alloc_data_t, list);
while(extractblock_search_space != list_search_space &&
!(extractblock_search_space->start <= extrablock_offset &&
extrablock_offset <= extractblock_search_space->end))
- extractblock_search_space=td_list_entry(extractblock_search_space->list.next, alloc_data_t, list);
+ {
+ extractblock_search_space=td_list_next_entry(extractblock_search_space, list);
+ }
/* Update extractblock_search_space & extrablock_offset */
get_next_sector(list_search_space, &extractblock_search_space, &extrablock_offset, blocksize);
/* */