diff --git a/src/file_xm.c b/src/file_xm.c index 49325923..f33172ef 100644 --- a/src/file_xm.c +++ b/src/file_xm.c @@ -211,11 +211,9 @@ static int parse_instruments(file_recovery_t *fr, uint16_t instrs) } /*@ - @ requires \valid(fr); - @ requires valid_file_recovery(fr); - @ requires \separated(fr, fr->handle, fr->extension, &errno, &Frama_C_entropy_source); @ requires fr->file_check == &file_check_xm; - @ ensures \valid(fr->handle); + @ requires valid_file_check_param(fr); + @ ensures valid_file_check_result(fr); @ assigns *fr->handle, fr->file_size, fr->offset_error; @ assigns Frama_C_entropy_source, errno; @*/ @@ -261,13 +259,9 @@ static void file_check_xm(file_recovery_t *fr) } /*@ - @ requires buffer_size > 0; - @ requires \valid_read(buffer+(0..buffer_size-1)); - @ requires valid_file_recovery(file_recovery); - @ requires \valid(file_recovery_new); - @ requires file_recovery_new->blocksize > 0; @ requires separation: \separated(&file_hint_xm, buffer+(..), file_recovery, file_recovery_new); - @ ensures \result!=0 ==> valid_file_recovery(file_recovery_new); + @ requires valid_header_check_param(buffer, buffer_size, safe_header_only, file_recovery, file_recovery_new); + @ ensures valid_header_check_result(\result, file_recovery_new); @ assigns *file_recovery_new; @*/ static int header_check_xm(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new)