Fixed variables to support 32-bit and added preset selection

This commit is contained in:
aristocratos
2021-09-18 14:42:53 +02:00
parent cffa303270
commit 33884e2bf0
8 changed files with 125 additions and 14 deletions

View File

@@ -164,7 +164,7 @@ namespace Tools {
for (size_t x = 0, last_pos = 0, i = str.size() - 1; i > 0 ; i--) {
if (wide and static_cast<unsigned char>(str.at(i)) > 0xef) {
x += 2;
last_pos = max(0ul, i - 1);
last_pos = max((size_t)0, i - 1);
}
else if ((static_cast<unsigned char>(str.at(i)) & 0xC0) != 0x80) {
x++;
@@ -264,7 +264,7 @@ namespace Tools {
string out = (not no_days and days > 0 ? to_string(days) + "d " : "")
+ (hours < 10 ? "0" : "") + to_string(hours) + ':'
+ (minutes < 10 ? "0" : "") + to_string(minutes)
+ (not no_seconds ? ':' + (seconds < 10 ? "0" : "") + to_string(seconds) : "");
+ (not no_seconds ? ":" + string(std::cmp_less(seconds, 10) ? "0" : "") + to_string(seconds) : "");
return out;
}