Skip to content
This repository has been archived by the owner on Jun 22, 2019. It is now read-only.

Commit

Permalink
Convert uint to unsigned int for size comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Moridi committed May 19, 2019
1 parent ed5c243 commit e59f435
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Part-2/include/Directory-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void Directory::check_new_element_validity(std::string title)
{
constexpr int FIRST_ELEMENT = 0;

for (uint i = FIRST_ELEMENT; i < elements.size(); ++i)
for (unsigned int i = FIRST_ELEMENT; i < elements.size(); ++i)
if (elements[i]->has_same_title(title))
throw BadTitle();
}
Expand Down
6 changes: 3 additions & 3 deletions Part-2/include/file_system_interface-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ FileSystemInterface::ElementSharedPointer FileSystemInterface::get_element(int i
{
constexpr int FIRST_ELEMENT = 0;

for (uint i = FIRST_ELEMENT; i < elements.size(); ++i)
for (unsigned int i = FIRST_ELEMENT; i < elements.size(); ++i)
if (elements[i]->has_same_id(id))
return elements[i];

Expand All @@ -38,7 +38,7 @@ void FileSystemInterface::check_id_validity(int id) const
{
constexpr int FIRST_ELEMENT = 0;

for (uint i = FIRST_ELEMENT; i < elements.size(); ++i)
for (unsigned int i = FIRST_ELEMENT; i < elements.size(); ++i)
if (elements[i]->has_same_id(id))
throw IdAlreadyExists();
}
Expand All @@ -48,7 +48,7 @@ void FileSystemInterface::check_parent_id_validity(int id) const
constexpr int FIRST_ELEMENT = 0;
constexpr char DIRECTORY[] = "Directory";

for (uint i = FIRST_ELEMENT; i < elements.size(); ++i)
for (unsigned int i = FIRST_ELEMENT; i < elements.size(); ++i)
if (elements[i]->has_same_id(id))
{
if (elements[i]->get_type() != DIRECTORY)
Expand Down
2 changes: 1 addition & 1 deletion Part-2/src/Directory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void Directory::view()

cout << "Title: " << title << endl;

for (uint i = FIRST_ELEMENT; i < elements.size(); ++i)
for (unsigned int i = FIRST_ELEMENT; i < elements.size(); ++i)
cout << "Title: " << elements[i]->get_title() <<
", Type: " << elements[i]->get_type() << endl;
}
Expand Down

0 comments on commit e59f435

Please sign in to comment.