Fix CppCheck in dir_hierarchy.h and dir_hierarchy.cc

/libretroshare/src/file_sharing/dir_hierarchy.cc:883: warning:
Cppcheck(unreadVariable): Variable 'nunknown' is modified but its new
value is never used.
/libretroshare/src/file_sharing/dir_hierarchy.h:71: warning:
Cppcheck(noExplicitConstructor): Class 'DirEntry' has a constructor with
1 argument that is not explicit.
/libretroshare/src/file_sharing/dir_hierarchy.cc:1056: warning:
Cppcheck(noExplicitConstructor): Class 'read_error' has a constructor
with 1 argument that is not explicit.
This commit is contained in:
Phenom 2017-07-21 12:18:42 +02:00 committed by csoler
parent b42694165a
commit 1456bdd641
2 changed files with 5 additions and 2 deletions

View File

@ -887,7 +887,10 @@ void InternalFileHierarchyStorage::print() const
std::cerr << "(EE) Error: unknown type node found!" << std::endl;
}
std::cerr << "Total nodes: " << mNodes.size() << " (" << nfiles << " files, " << ndirs << " dirs, " << nempty << " empty slots)" << std::endl;
std::cerr << "Total nodes: " << mNodes.size() << " (" << nfiles << " files, " << ndirs << " dirs, " << nempty << " empty slots";
if (nunknown > 0) std::cerr << ", " << nunknown << " unknown";
std::cerr << ")" << std::endl;
recursPrint(0,DirectoryStorage::EntryIndex(0));

View File

@ -68,7 +68,7 @@ public:
class DirEntry: public FileStorageNode
{
public:
DirEntry(const std::string& name) : dir_name(name), dir_modtime(0),dir_most_recent_time(0),dir_update_time(0) {}
explicit DirEntry(const std::string& name) : dir_name(name), dir_modtime(0),dir_most_recent_time(0),dir_update_time(0) {}
virtual ~DirEntry() {}
virtual uint32_t type() const { return FileStorageNode::TYPE_DIR ; }