diff options
Diffstat (limited to 'src/tools/romcmp.cpp')
-rw-r--r-- | src/tools/romcmp.cpp | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/src/tools/romcmp.cpp b/src/tools/romcmp.cpp index 4d89718abe9..a6919631cd8 100644 --- a/src/tools/romcmp.cpp +++ b/src/tools/romcmp.cpp @@ -393,11 +393,11 @@ static float filecompare(const fileinfo *file1,const fileinfo *file2,int mode1,i static void readfile(const char *path,fileinfo *file) { - file_error filerr; + osd_file::error filerr; UINT64 filesize; UINT32 actual; char fullname[256]; - osd_file *f = nullptr; + osd_file::ptr f; if (path) { @@ -414,22 +414,19 @@ static void readfile(const char *path,fileinfo *file) return; } - filerr = osd_open(fullname, OPEN_FLAG_READ, &f, &filesize); - if (filerr != FILERR_NONE) + filerr = osd_file::open(fullname, OPEN_FLAG_READ, f, filesize); + if (filerr != osd_file::error::NONE) { - printf("%s: error %d\n", fullname, filerr); + printf("%s: error %d\n", fullname, int(filerr)); return; } - filerr = osd_read(f, file->buf, 0, file->size, &actual); - if (filerr != FILERR_NONE) + filerr = f->read(file->buf, 0, file->size, actual); + if (filerr != osd_file::error::NONE) { - printf("%s: error %d\n", fullname, filerr); - osd_close(f); + printf("%s: error %d\n", fullname, int(filerr)); return; } - - osd_close(f); } @@ -493,20 +490,20 @@ static int load_files(int i, int *found, const char *path) /* if not, try to open as a ZIP file */ else { - zip_file *zip; - const zip_file_header* zipent; - zip_error ziperr; + zip_file::ptr zip; + const zip_file::file_header* zipent; + zip_file::error ziperr; /* wasn't a directory, so try to open it as a zip file */ - ziperr = zip_file_open(path, &zip); - if (ziperr != ZIPERR_NONE) + ziperr = zip_file::open(path, zip); + if (ziperr != zip_file::error::NONE) { printf("Error, cannot open zip file '%s' !\n", path); return 1; } /* load all files in zip file */ - for (zipent = zip_file_first_file(zip); zipent != nullptr; zipent = zip_file_next_file(zip)) + for (zipent = zip->first_file(); zipent != nullptr; zipent = zip->next_file()) { int size; @@ -529,7 +526,7 @@ static int load_files(int i, int *found, const char *path) printf("%s: out of memory!\n",file->name); else { - if (zip_file_decompress(zip, (char *)file->buf, file->size) != ZIPERR_NONE) + if (zip->decompress(file->buf, file->size) != zip_file::error::NONE) { free(file->buf); file->buf = nullptr; @@ -545,7 +542,6 @@ static int load_files(int i, int *found, const char *path) found[i]++; } } - zip_file_close(zip); } return 0; } @@ -747,6 +743,6 @@ int CLIB_DECL main(int argc,char *argv[]) } } - zip_file_cache_clear(); + zip_file::cache_clear(); return 0; } |