Skip to content

Commit

Permalink
Replace C-style casts with static_cast
Browse files Browse the repository at this point in the history
  • Loading branch information
voidanix committed Jun 17, 2022
1 parent 7371552 commit 9e28cce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/engine/command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2797,7 +2797,7 @@ void explodelist(const char *s, vector<char *> &elems, int limit)
void explodelist(const char *s, std::vector<std::string> &elems, int limit)
{
const char *start, *end;
while((limit < 0 || elems.size() < (size_t)(limit)) && parselist(s, start, end))
while((limit < 0 || elems.size() < static_cast<size_t>(limit)) && parselist(s, start, end))
elems.emplace_back(std::string(start, end-start));
}

Expand Down
2 changes: 1 addition & 1 deletion src/shared/tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const bool inrange(std::vector<T> vec, size_t i) {

template<class T>
const bool inrange(std::vector<T> vec, int i) {
return i >= 0 && i < (int)(vec.size());
return i >= 0 && i < static_cast<int>(vec.size());
}

// easy safe strings
Expand Down

0 comments on commit 9e28cce

Please sign in to comment.