1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-04 02:41:19 +00:00

Use signed variables to match an API

This commit is contained in:
Andrei Kortunov 2024-07-01 20:50:58 +04:00
parent a9108a743d
commit dc7407a34c

View File

@ -212,7 +212,7 @@ void CSVWorld::ScriptSubView::useHint(const std::string& hint)
if (hint.empty()) if (hint.empty())
return; return;
unsigned line = 0, column = 0; int line = 0, column = 0;
char c; char c;
std::istringstream stream(hint.c_str() + 1); std::istringstream stream(hint.c_str() + 1);
switch (hint[0]) switch (hint[0])
@ -222,8 +222,8 @@ void CSVWorld::ScriptSubView::useHint(const std::string& hint)
{ {
QModelIndex index = mModel->getModelIndex(getUniversalId().getId(), mColumn); QModelIndex index = mModel->getModelIndex(getUniversalId().getId(), mColumn);
QString source = mModel->data(index).toString(); QString source = mModel->data(index).toString();
unsigned stringSize = source.length(); int stringSize = static_cast<int>(source.length());
unsigned pos, dummy; int pos, dummy;
if (!(stream >> c >> dummy >> pos)) if (!(stream >> c >> dummy >> pos))
return; return;
@ -234,7 +234,7 @@ void CSVWorld::ScriptSubView::useHint(const std::string& hint)
pos = stringSize; pos = stringSize;
} }
for (unsigned i = 0; i <= pos; ++i) for (int i = 0; i <= pos; ++i)
{ {
if (source[i] == '\n') if (source[i] == '\n')
{ {