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:
parent
d19b993024
commit
6e4b3edcfb
7 changed files with 88 additions and 156 deletions
3
image.h
3
image.h
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue