From 42fbb9c3967fcda37f2d9ae17d5796a79cf027b9 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 13 Mar 2016 13:54:57 +1100 Subject: Make osd_file a polymorphic class that's held with smart pointers Make avi_file a class that's held with smart pointers, encapsulate various AVI I/O structures Make zip_file and _7z_file classes rather than having free functions everywhere Hide zip/7z class implementation behind an interface, no longer need to call close() to send back to the cache Don't dump as much crap in global namespace Add solaris PTY implementation Improve variable expansion for SDL OSD - supports ~/$FOO/${BAR} syntax Rearrange stuff so the same things are in file module for all OSDs Move file stuff into its own module 7z/zip open and destruct are still not thread-safe due to lack of interlocks around cache access Directory functions still need to be moved to file module SDL OSD may not initialise WinSock on Windows --- src/tools/split.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/tools/split.cpp') diff --git a/src/tools/split.cpp b/src/tools/split.cpp index f942e1481c2..5151229edd8 100644 --- a/src/tools/split.cpp +++ b/src/tools/split.cpp @@ -69,7 +69,7 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi void *splitbuffer = nullptr; int index, partnum; UINT64 totallength; - file_error filerr; + osd_file::error filerr; int error = 1; // convert split size to MB @@ -82,7 +82,7 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi // open the file for read filerr = util::core_file::open(filename, OPEN_FLAG_READ, infile); - if (filerr != FILERR_NONE) + if (filerr != osd_file::error::NONE) { fprintf(stderr, "Fatal error: unable to open file '%s'\n", filename); goto cleanup; @@ -120,7 +120,7 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi // create the split file filerr = util::core_file::open(splitfilename.c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_NO_BOM, splitfile); - if (filerr != FILERR_NONE) + if (filerr != osd_file::error::NONE) { fprintf(stderr, "Fatal error: unable to create split file '%s'\n", splitfilename.c_str()); goto cleanup; @@ -156,7 +156,7 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi // create it filerr = util::core_file::open(outfilename.c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, outfile); - if (filerr != FILERR_NONE) + if (filerr != osd_file::error::NONE) { printf("\n"); fprintf(stderr, "Fatal error: unable to create output file '%s'\n", outfilename.c_str()); @@ -219,7 +219,7 @@ static int join_file(const char *filename, const char *outname, int write_output std::string basepath; util::core_file::ptr outfile, infile, splitfile; void *splitbuffer = nullptr; - file_error filerr; + osd_file::error filerr; UINT32 splitsize; char buffer[256]; int error = 1; @@ -227,7 +227,7 @@ static int join_file(const char *filename, const char *outname, int write_output // open the file for read filerr = util::core_file::open(filename, OPEN_FLAG_READ, splitfile); - if (filerr != FILERR_NONE) + if (filerr != osd_file::error::NONE) { fprintf(stderr, "Fatal error: unable to open file '%s'\n", filename); goto cleanup; @@ -268,7 +268,7 @@ static int join_file(const char *filename, const char *outname, int write_output { // don't overwrite the original! filerr = util::core_file::open(outfilename.c_str(), OPEN_FLAG_READ, outfile); - if (filerr == FILERR_NONE) + if (filerr == osd_file::error::NONE) { outfile.reset(); fprintf(stderr, "Fatal error: output file '%s' already exists\n", outfilename.c_str()); @@ -277,7 +277,7 @@ static int join_file(const char *filename, const char *outname, int write_output // open the output for write filerr = util::core_file::open(outfilename.c_str(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, outfile); - if (filerr != FILERR_NONE) + if (filerr != osd_file::error::NONE) { fprintf(stderr, "Fatal error: unable to create file '%s'\n", outfilename.c_str()); goto cleanup; @@ -306,7 +306,7 @@ static int join_file(const char *filename, const char *outname, int write_output // read the file's contents infilename.insert(0, basepath); filerr = util::core_file::load(infilename.c_str(), &splitbuffer, length); - if (filerr != FILERR_NONE) + if (filerr != osd_file::error::NONE) { printf("\n"); fprintf(stderr, "Fatal error: unable to load file '%s'\n", infilename.c_str()); -- cgit v1.2.3-70-g09d2