mirror of
https://github.com/VARCem/MiniVHD.git
synced 2026-09-23 07:15:01 +00:00
Fix GCC errors and warnings
This commit is contained in:
@@ -25,7 +25,8 @@ typedef struct MVHDGeom {
|
||||
uint8_t spt;
|
||||
} MVHDGeom;
|
||||
|
||||
typedef struct MVHDMeta {
|
||||
typedef struct MVHDMeta MVHDMeta;
|
||||
struct MVHDMeta {
|
||||
FILE* f;
|
||||
char* filename;
|
||||
struct MVHDMeta* parent;
|
||||
@@ -37,7 +38,7 @@ typedef struct MVHDMeta {
|
||||
int (*read_sectors)(MVHDMeta* vhdm, int offset, int num_sectors, void* out_buff);
|
||||
int (*write_sectors)(MVHDMeta* vhdm, int offset, int num_sectors, void* in_buff);
|
||||
int (*format_sectors)(MVHDMeta* vhdm, int offset, int num_sectors);
|
||||
} MVHDMeta;
|
||||
};
|
||||
|
||||
MVHDMeta* mvhd_open(const char* path, int* err);
|
||||
MVHDMeta* mvhd_create_fixed(const char* path, MVHDGeom geom, int* err);
|
||||
|
||||
@@ -68,7 +68,4 @@ void mvhd_buffer_to_header(MVHDSparseHeader* header, uint8_t* buffer);
|
||||
void mvhd_footer_to_buffer(MVHDFooter* footer, uint8_t* buffer);
|
||||
void mvhd_header_to_buffer(MVHDSparseHeader* header, uint8_t* buffer);
|
||||
void mvhd_generate_uuid(uint8_t *uuid);
|
||||
int mvhd_fixed_read(MVHDMeta* vhdm, int offset, int num_sectors, void* out_buff);
|
||||
int mvhd_sparse_read(MVHDMeta* vhdm, int offset, int num_sectors, void* out_buff);
|
||||
int mvhd_diff_read(MVHDMeta* vhdm, int offset, int num_sectors, void* out_buff);
|
||||
#endif
|
||||
9
src/minivhd_io.h
Normal file
9
src/minivhd_io.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef MINIVHD_IO_H
|
||||
#define MINIVHD_IO_H
|
||||
#include "minivhd.h"
|
||||
|
||||
int mvhd_fixed_read(MVHDMeta* vhdm, int offset, int num_sectors, void* out_buff);
|
||||
int mvhd_sparse_read(MVHDMeta* vhdm, int offset, int num_sectors, void* out_buff);
|
||||
int mvhd_diff_read(MVHDMeta* vhdm, int offset, int num_sectors, void* out_buff);
|
||||
|
||||
#endif
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <string.h>
|
||||
#include "bswap.h"
|
||||
#include "minivhd_internal.h"
|
||||
#include "minivhd_io.h"
|
||||
#include "minivhd.h"
|
||||
|
||||
static bool mvhd_file_is_vhd(FILE* f);
|
||||
@@ -181,6 +182,7 @@ MVHDMeta* mvhd_open(const char* path, int* err) {
|
||||
*err = bat_err;
|
||||
goto cleanup_file;
|
||||
}
|
||||
mvhd_calc_sparse_values(vhdm);
|
||||
|
||||
} else if (vhdm->footer.disk_type != MVHD_TYPE_FIXED) {
|
||||
*err = MVHD_ERR_TYPE;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#ifdef HAVE_UUID_H
|
||||
#include <uuid/uuid.h>
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user