Fix signed/unsigned comparison warnings in core.

develop
Ben Lubar 2018-04-05 16:47:47 -05:00
parent 304e1d45f0
commit 2eec5ee78d
No known key found for this signature in database
GPG Key ID: 018BAB45DB2D2B24
3 changed files with 5 additions and 5 deletions

@ -635,7 +635,7 @@ namespace DFHack
prompt_refresh(); prompt_refresh();
break; break;
case 11: // Ctrl+k, delete from current to end of line. case 11: // Ctrl+k, delete from current to end of line.
if (raw_cursor < raw_buffer.size()) if (size_t(raw_cursor) < raw_buffer.size())
yank_buffer = raw_buffer.substr(raw_cursor); yank_buffer = raw_buffer.substr(raw_cursor);
raw_buffer.erase(raw_cursor); raw_buffer.erase(raw_cursor);
prompt_refresh(); prompt_refresh();
@ -651,7 +651,7 @@ namespace DFHack
case 20: // Ctrl+t, transpose current and previous characters case 20: // Ctrl+t, transpose current and previous characters
if (raw_buffer.size() >= 2 && raw_cursor > 0) if (raw_buffer.size() >= 2 && raw_cursor > 0)
{ {
if (raw_cursor == raw_buffer.size()) if (size_t(raw_cursor) == raw_buffer.size())
raw_cursor--; raw_cursor--;
std::swap(raw_buffer[raw_cursor - 1], raw_buffer[raw_cursor]); std::swap(raw_buffer[raw_cursor - 1], raw_buffer[raw_cursor]);
raw_cursor++; raw_cursor++;

@ -508,7 +508,7 @@ bool DFHack::Job::removePostings(df::job *job, bool remove_all)
bool removed = false; bool removed = false;
if (!remove_all) if (!remove_all)
{ {
if (job->posting_index >= 0 && job->posting_index < world->jobs.postings.size()) if (job->posting_index >= 0 && size_t(job->posting_index) < world->jobs.postings.size())
{ {
world->jobs.postings[job->posting_index]->flags.bits.dead = true; world->jobs.postings[job->posting_index]->flags.bits.dead = true;
removed = true; removed = true;

@ -511,8 +511,8 @@ void PenArray::draw(unsigned int x, unsigned int y, unsigned int width, unsigned
{ {
for (unsigned int gridy = y; gridy < y + height; gridy++) for (unsigned int gridy = y; gridy < y + height; gridy++)
{ {
if (gridx >= gps->dimx || if (gridx >= unsigned(gps->dimx) ||
gridy >= gps->dimy || gridy >= unsigned(gps->dimy) ||
gridx - x + bufx >= dimx || gridx - x + bufx >= dimx ||
gridy - y + bufy >= dimy) gridy - y + bufy >= dimy)
continue; continue;