Use the size_t type instead of "unsigned long" for variables that hold the result of a find() call
This commit is contained in:
parent
07d836da64
commit
77d984cb45
|
@ -26,7 +26,7 @@ class ArgumentAssignable: public Argument {
|
||||||
vector<string_view> values;
|
vector<string_view> values;
|
||||||
public:
|
public:
|
||||||
static string_view getValueFor(const string_view& str) {
|
static string_view getValueFor(const string_view& str) {
|
||||||
unsigned long definePos = str.find_last_of('=') + 1;
|
const size_t definePos = str.find_last_of('=') + 1;
|
||||||
return str.size() > definePos ? str.substr(definePos) : string_view();
|
return str.size() > definePos ? str.substr(definePos) : string_view();
|
||||||
}
|
}
|
||||||
ArgumentAssignable(string name, const span<string_view>& possibleValues): Argument(move(name)), values() {
|
ArgumentAssignable(string name, const span<string_view>& possibleValues): Argument(move(name)), values() {
|
||||||
|
|
|
@ -64,11 +64,11 @@ int main(int argc, char* argv[]) {
|
||||||
try {
|
try {
|
||||||
resultingPair.first = compile(fileName);
|
resultingPair.first = compile(fileName);
|
||||||
} catch (const Yerbacon::Exception& error) {
|
} catch (const Yerbacon::Exception& error) {
|
||||||
unsigned long lastSlash = 0;
|
size_t lastSlash = 0;
|
||||||
const unsigned long position1 = fileName.find_last_of('/');
|
const size_t position1 = fileName.find_last_of('/');
|
||||||
if (cmp_not_equal(position1, string_view::npos)) lastSlash = position1;
|
if (cmp_not_equal(position1, string_view::npos)) lastSlash = position1;
|
||||||
if constexpr(filesystem::path::preferred_separator != '/') {
|
if constexpr(filesystem::path::preferred_separator != '/') {
|
||||||
const unsigned long position2 = fileName.find_last_of(filesystem::path::preferred_separator);
|
const size_t position2 = fileName.find_last_of(filesystem::path::preferred_separator);
|
||||||
if (cmp_not_equal(position2, string_view::npos)) {
|
if (cmp_not_equal(position2, string_view::npos)) {
|
||||||
lastSlash = max(lastSlash, position2);
|
lastSlash = max(lastSlash, position2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue