src/file_xm.c: improve Frama-C warnings

This commit is contained in:
Christophe Grenier 2021-07-28 22:08:50 +02:00
parent 92dc91e9b1
commit fd398b75dd

View file

@ -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)