Fixed integer signed comparison warning

This commit is contained in:
Francesco Abbate 2020-06-06 19:03:41 +02:00
parent 646a594e89
commit 8e796831f2
1 changed files with 6 additions and 4 deletions

View File

@ -413,6 +413,7 @@ namespace agg
{ {
int i; int i;
const int8u* buf = (const int8u*)bitmap.buffer; const int8u* buf = (const int8u*)bitmap.buffer;
const int bitmap_rows = bitmap.rows, bitmap_width = bitmap.width;
int pitch = bitmap.pitch; int pitch = bitmap.pitch;
sl.reset(x, x + bitmap.width); sl.reset(x, x + bitmap.width);
storage.prepare(); storage.prepare();
@ -422,12 +423,12 @@ namespace agg
y += bitmap.rows; y += bitmap.rows;
pitch = -pitch; pitch = -pitch;
} }
for(i = 0; i < bitmap.rows; i++) for(i = 0; i < bitmap_rows; i++)
{ {
sl.reset_spans(); sl.reset_spans();
bitset_iterator bits(buf, 0); bitset_iterator bits(buf, 0);
int j; int j;
for(j = 0; j < bitmap.width; j++) for(j = 0; j < bitmap_width; j++)
{ {
if(bits.bit()) sl.add_cell(x + j, cover_full); if(bits.bit()) sl.add_cell(x + j, cover_full);
++bits; ++bits;
@ -454,6 +455,7 @@ namespace agg
{ {
int i, j; int i, j;
const int8u* buf = (const int8u*)bitmap.buffer; const int8u* buf = (const int8u*)bitmap.buffer;
const int bitmap_rows = bitmap.rows, bitmap_width = bitmap.width;
int pitch = bitmap.pitch; int pitch = bitmap.pitch;
sl.reset(x, x + bitmap.width); sl.reset(x, x + bitmap.width);
storage.prepare(); storage.prepare();
@ -463,11 +465,11 @@ namespace agg
y += bitmap.rows; y += bitmap.rows;
pitch = -pitch; pitch = -pitch;
} }
for(i = 0; i < bitmap.rows; i++) for(i = 0; i < bitmap_rows; i++)
{ {
sl.reset_spans(); sl.reset_spans();
const int8u* p = buf; const int8u* p = buf;
for(j = 0; j < bitmap.width; j++) for(j = 0; j < bitmap_width; j++)
{ {
if(*p) sl.add_cell(x + j, ras.apply_gamma(*p)); if(*p) sl.add_cell(x + j, ras.apply_gamma(*p));
++p; ++p;