diff --git a/src/zipios++/collcoll.cpp b/src/zipios++/collcoll.cpp index 25f784bef9..92c25af1c8 100644 --- a/src/zipios++/collcoll.cpp +++ b/src/zipios++/collcoll.cpp @@ -31,7 +31,7 @@ bool CollectionCollection::addCollection( const FileCollection &collection ) { bool CollectionCollection::addCollection( FileCollection *collection ) { if ( ! _valid ) throw InvalidStateException( "Attempt to add a FileCollection to an invalid CollectionCollection" ) ; - if ( collection == nullptr || this == collection || ! collection->isValid() ) + if ( !collection || this == collection || ! collection->isValid() ) return false ; _collections.push_back( collection ) ; return true ; @@ -87,7 +87,7 @@ istream *CollectionCollection::getInputStream( const string &entry_name, getEntry( entry_name, cep, it, matchpath ) ; - if ( cep == nullptr ) + if ( !cep ) return nullptr ; else return (*it)->getInputStream( entry_name ) ; diff --git a/src/zipios++/dircoll.cpp b/src/zipios++/dircoll.cpp index 7460e0a598..024d56ab67 100644 --- a/src/zipios++/dircoll.cpp +++ b/src/zipios++/dircoll.cpp @@ -81,7 +81,7 @@ std::istream *DirectoryCollection::getInputStream( const string &entry_name, ConstEntryPointer ent = getEntry( entry_name, matchpath ) ; - if ( ent == nullptr ) + if ( !ent ) return nullptr ; else { string real_path( _filepath + entry_name ) ; diff --git a/src/zipios++/directory.cpp b/src/zipios++/directory.cpp index 34b70d7106..6d21e72483 100644 --- a/src/zipios++/directory.cpp +++ b/src/zipios++/directory.cpp @@ -85,7 +85,7 @@ struct boost::filesystem::dir_it::representation { m_stat_p = false; dirent *rc = readdir(m_handle); - if (rc != nullptr) + if (rc) m_current = rc->d_name; else { @@ -183,14 +183,14 @@ namespace boost template <> std::string get(dir_it const &it) { struct passwd *pw = getpwuid(it.rep->get_stat().st_uid); - if (pw == nullptr) + if (!pw) throw unknown_uid(it.rep->get_stat().st_uid); return pw->pw_name; } template <> void set(dir_it const &it, std::string name) { struct passwd *pw = getpwnam(name.c_str()); - if (pw != nullptr) + if (pw) it.rep->change_owner(pw->pw_uid); else throw unknown_uname(name); @@ -201,14 +201,14 @@ namespace boost template <> std::string get(dir_it const &it) { struct group *grp = getgrgid(it.rep->get_stat().st_gid); - if (grp == nullptr) + if (!grp) throw unknown_gid(it.rep->get_stat().st_gid); return grp->gr_name; } template <> void set(dir_it const &it, std::string name) { struct group *grp = getgrnam(name.c_str()); - if (grp != nullptr) + if (grp) it.rep->change_group(grp->gr_gid); else throw unknown_gname(name); diff --git a/src/zipios++/filterinputstreambuf.cpp b/src/zipios++/filterinputstreambuf.cpp index b7dc00d6bd..5119b84f34 100644 --- a/src/zipios++/filterinputstreambuf.cpp +++ b/src/zipios++/filterinputstreambuf.cpp @@ -10,14 +10,14 @@ FilterInputStreambuf::FilterInputStreambuf( streambuf *inbuf, bool del_inbuf ) _del_inbuf( del_inbuf ) { _s_pos = 0; - if ( _inbuf == nullptr ) { + if (!_inbuf) { // throw an exception } } FilterInputStreambuf::~FilterInputStreambuf() { - if ( _del_inbuf ) + if (_del_inbuf) delete _inbuf ; } diff --git a/src/zipios++/filteroutputstreambuf.cpp b/src/zipios++/filteroutputstreambuf.cpp index 7f2ed3707a..8e6ddbae44 100644 --- a/src/zipios++/filteroutputstreambuf.cpp +++ b/src/zipios++/filteroutputstreambuf.cpp @@ -9,14 +9,14 @@ FilterOutputStreambuf::FilterOutputStreambuf( streambuf *outbuf, bool del_outbuf : _outbuf( outbuf), _del_outbuf( del_outbuf ) { - if ( _outbuf == nullptr ) { + if (!_outbuf) { // throw an exception } } FilterOutputStreambuf::~FilterOutputStreambuf() { - if ( _del_outbuf ) + if (_del_outbuf) delete _outbuf ; } diff --git a/src/zipios++/zipfile.cpp b/src/zipios++/zipfile.cpp index 3fbd1605bf..1d8a241f4a 100644 --- a/src/zipios++/zipfile.cpp +++ b/src/zipios++/zipfile.cpp @@ -73,7 +73,7 @@ istream *ZipFile::getInputStream( const string &entry_name, ConstEntryPointer ent = getEntry( entry_name, matchpath ) ; - if ( ent == nullptr ) + if ( !ent ) return nullptr ; else return new ZipInputStream( _filename,