Skip to content

Commit

Permalink
Clean up unused code and fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rikyoz committed Oct 15, 2023
1 parent 79069f9 commit bfd9448
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/bitoutputarchive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ BitOutputArchive::BitOutputArchive( const BitAbstractArchiveCreator& creator, co
return;
}

if ( inArc.empty() ) { // No input file specified, so we are creating a totally new archive!
if ( inArc.empty() ) { // No input file specified, so we are creating a totally new archive.
return;
}

Expand Down
4 changes: 0 additions & 4 deletions src/internal/cfileinstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
#include "internal/cfileinstream.hpp"
#include "internal/stringutil.hpp"

#if defined( _WIN32 ) && defined( __GLIBCXX__ ) && defined( _WIO_DEFINED )
#include "internal/fsutil.hpp"
#endif

namespace bit7z {

CFileInStream::CFileInStream( const fs::path& filePath ) : CStdInStream( mFileStream ), mBuffer{} {
Expand Down
6 changes: 1 addition & 5 deletions src/internal/cfileoutstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@
#include "internal/cfileoutstream.hpp"
#include "internal/stringutil.hpp"

#if defined( _WIN32 ) && defined( __GLIBCXX__ ) && defined( _WIO_DEFINED )
#include "internal/fsutil.hpp"
#endif

namespace bit7z {

CFileOutStream::CFileOutStream( fs::path filePath, bool createAlways )
: CStdOutStream( mFileStream ), mFilePath{ std::move( filePath ) }, mBuffer{} {
std::error_code error;
if ( !createAlways && fs::exists( mFilePath, error ) ) {
if ( !error ) {
// the call to fs::exists succeeded, but the filePath exists, and this is an error!
// The call to fs::exists succeeded, but the filePath exists, and this is an error.
error = std::make_error_code( std::errc::file_exists );
}
throw BitException( "Failed to create the output file", error, path_to_tstring( mFilePath ) );
Expand Down
4 changes: 0 additions & 4 deletions src/internal/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@

#include "internal/com.hpp"

#if defined( _WIN32 ) && defined( BIT7Z_AUTO_PREFIX_LONG_PATHS )
#include "internal/fsutil.hpp"
#endif

namespace bit7z {

constexpr inline auto check_overflow( int64_t position, int64_t offset ) noexcept -> bool {
Expand Down

0 comments on commit bfd9448

Please sign in to comment.