diff options
author | 2021-08-22 09:06:15 +1000 | |
---|---|---|
committer | 2021-08-22 09:06:15 +1000 | |
commit | e8bbea1fc6e94e14768509d322f6c624403ffb36 (patch) | |
tree | 74dd1606a900d83de8aecff17a6737af4113308d /src/tools/pngcmp.cpp | |
parent | e319bde5fc3696d7f48f62b15b6366c4377fe5d1 (diff) |
formats, osd, util: Started refactoring file I/O stuff. (#8456)
Added more modern generic I/O interfaces with implementation backed by stdio, osd_file and core_file, replacing io_generic. Also replaced core_file's build-in zlib compression with a filter.
unzip.cpp, un7z.cpp: Added option to supply abstract I/O interface rather than filename.
Converted osd_file, core_file, archive_file, chd_file and device_image_interface to use std::error_condition rather than their own error enums.
Allow mounting TI-99 RPK from inside archives.
Diffstat (limited to 'src/tools/pngcmp.cpp')
-rw-r--r-- | src/tools/pngcmp.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tools/pngcmp.cpp b/src/tools/pngcmp.cpp index 43fc9324a06..624023425af 100644 --- a/src/tools/pngcmp.cpp +++ b/src/tools/pngcmp.cpp @@ -73,15 +73,15 @@ static int generate_png_diff(const std::string& imgfile1, const std::string& img bitmap_argb32 finalbitmap; int width, height, maxwidth; util::core_file::ptr file; - osd_file::error filerr; + std::error_condition filerr; util::png_error pngerr; int error = 100; /* open the source image */ filerr = util::core_file::open(imgfile1, OPEN_FLAG_READ, file); - if (filerr != osd_file::error::NONE) + if (filerr) { - printf("Could not open %s (%d)\n", imgfile1.c_str(), int(filerr)); + printf("Could not open %s (%s)\n", imgfile1.c_str(), filerr.message().c_str()); goto error; } @@ -96,9 +96,9 @@ static int generate_png_diff(const std::string& imgfile1, const std::string& img /* open the source image */ filerr = util::core_file::open(imgfile2, OPEN_FLAG_READ, file); - if (filerr != osd_file::error::NONE) + if (filerr) { - printf("Could not open %s (%d)\n", imgfile2.c_str(), int(filerr)); + printf("Could not open %s (%s)\n", imgfile2.c_str(), filerr.message().c_str()); goto error; } @@ -171,9 +171,9 @@ static int generate_png_diff(const std::string& imgfile1, const std::string& img /* write the final PNG */ filerr = util::core_file::open(outfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, file); - if (filerr != osd_file::error::NONE) + if (filerr) { - printf("Could not open %s (%d)\n", outfilename.c_str(), int(filerr)); + printf("Could not open %s (%s)\n", outfilename.c_str(), filerr.message().c_str()); goto error; } pngerr = util::png_write_bitmap(*file, nullptr, finalbitmap, 0, nullptr); |