fileio: Unify whole-file reads

We do whole-file reads in a few places, so unify to a fileio_read_file()
function.

To do this, we change the type of struct image->buf to a uint8_t *.
Where we do pointer manipulation on the image buffer, we need a
temporary void * variable.

Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
This commit is contained in:
Jeremy Kerr 2012-08-03 11:12:06 +08:00
parent d19b993024
commit 6e4b3edcfb
7 changed files with 88 additions and 156 deletions

View file

@ -48,8 +48,7 @@ struct region {
};
struct image {
int fd;
void *buf;
uint8_t *buf;
size_t size;
/* Pointers to interesting parts of the image */