[cpp] Fix more warnings.

This commit is contained in:
Mario Zechner 2022-11-03 16:56:14 +01:00
parent 4a89b2b84d
commit fc43e988d0

View File

@ -108,21 +108,21 @@ struct SimpleString {
while (isspace((unsigned char) *start) && start < end) while (isspace((unsigned char) *start) && start < end)
start++; start++;
if (start == end) { if (start == end) {
length = end - start; length = (int)(end - start);
return *this; return *this;
} }
end--; end--;
while (((unsigned char) *end == '\r') && end >= start) while (((unsigned char) *end == '\r') && end >= start)
end--; end--;
end++; end++;
length = end - start; length = (int)(end - start);
return *this; return *this;
} }
int indexOf(char needle) { int indexOf(char needle) {
char *c = start; char *c = start;
while (c < end) { while (c < end) {
if (*c == needle) return c - start; if (*c == needle) return (int)(c - start);
c++; c++;
} }
return -1; return -1;
@ -131,7 +131,7 @@ struct SimpleString {
int indexOf(char needle, int at) { int indexOf(char needle, int at) {
char *c = start + at; char *c = start + at;
while (c < end) { while (c < end) {
if (*c == needle) return c - start; if (*c == needle) return (int)(c - start);
c++; c++;
} }
return -1; return -1;
@ -150,7 +150,7 @@ struct SimpleString {
SimpleString result; SimpleString result;
result.start = start + s; result.start = start + s;
result.end = end; result.end = end;
result.length = result.end - result.start; result.length = (int)(result.end - result.start);
return result; return result;
} }
@ -286,7 +286,7 @@ void Atlas::load(const char *begin, int length, const char *dir, bool createText
} else { } else {
page->texturePath = String(path, true); page->texturePath = String(path, true);
} }
page->index = _pages.size(); page->index = (int)_pages.size();
_pages.add(page); _pages.add(page);
} else { } else {
AtlasRegion *region = new (__FILE__, __LINE__) AtlasRegion(); AtlasRegion *region = new (__FILE__, __LINE__) AtlasRegion();