fix several -Wsign-compare warnings
This commit is contained in:
parent
32d053abf6
commit
61dde4b093
4 changed files with 6 additions and 5 deletions
|
@ -436,7 +436,7 @@ void cairo_context::add_text(text_path const& path,
|
||||||
|
|
||||||
path.rewind();
|
path.rewind();
|
||||||
|
|
||||||
for (int iii = 0; iii < path.num_nodes(); iii++)
|
for (std::size_t iii = 0; iii < path.num_nodes(); ++iii)
|
||||||
{
|
{
|
||||||
char_info_ptr c;
|
char_info_ptr c;
|
||||||
double x, y, angle;
|
double x, y, angle;
|
||||||
|
@ -470,7 +470,7 @@ void cairo_context::add_text(text_path const& path,
|
||||||
|
|
||||||
path.rewind();
|
path.rewind();
|
||||||
|
|
||||||
for (int iii = 0; iii < path.num_nodes(); iii++)
|
for (std::size_t iii = 0; iii < path.num_nodes(); ++iii)
|
||||||
{
|
{
|
||||||
char_info_ptr c;
|
char_info_ptr c;
|
||||||
double x, y, angle;
|
double x, y, angle;
|
||||||
|
|
|
@ -545,7 +545,7 @@ box2d<double> text_renderer<T>::prepare_glyphs(text_path const& path)
|
||||||
bbox.xMin = bbox.yMin = 32000; // Initialize these so we can tell if we
|
bbox.xMin = bbox.yMin = 32000; // Initialize these so we can tell if we
|
||||||
bbox.xMax = bbox.yMax = -32000; // properly grew the bbox later
|
bbox.xMax = bbox.yMax = -32000; // properly grew the bbox later
|
||||||
|
|
||||||
for (int i = 0; i < path.num_nodes(); ++i)
|
for (std::size_t i = 0; i < path.num_nodes(); ++i)
|
||||||
{
|
{
|
||||||
char_info_ptr c;
|
char_info_ptr c;
|
||||||
double x, y, angle;
|
double x, y, angle;
|
||||||
|
|
|
@ -162,7 +162,7 @@ void jpeg_reader<T>::skip(j_decompress_ptr cinfo, long count)
|
||||||
if (count <= 0) return; //A zero or negative skip count should be treated as a no-op.
|
if (count <= 0) return; //A zero or negative skip count should be treated as a no-op.
|
||||||
jpeg_stream_wrapper* wrap = reinterpret_cast<jpeg_stream_wrapper*>(cinfo->src);
|
jpeg_stream_wrapper* wrap = reinterpret_cast<jpeg_stream_wrapper*>(cinfo->src);
|
||||||
|
|
||||||
if (wrap->manager.bytes_in_buffer > 0 && count < wrap->manager.bytes_in_buffer)
|
if (wrap->manager.bytes_in_buffer > 0 && count < static_cast<long>(wrap->manager.bytes_in_buffer))
|
||||||
{
|
{
|
||||||
wrap->manager.bytes_in_buffer -= count;
|
wrap->manager.bytes_in_buffer -= count;
|
||||||
wrap->manager.next_input_byte = &wrap->buffer[BUF_SIZE - wrap->manager.bytes_in_buffer];
|
wrap->manager.next_input_byte = &wrap->buffer[BUF_SIZE - wrap->manager.bytes_in_buffer];
|
||||||
|
|
|
@ -112,7 +112,8 @@ void png_reader<T>::png_read_data(png_structp png_ptr, png_bytep data, png_size_
|
||||||
{
|
{
|
||||||
input_stream * fin = reinterpret_cast<input_stream*>(png_get_io_ptr(png_ptr));
|
input_stream * fin = reinterpret_cast<input_stream*>(png_get_io_ptr(png_ptr));
|
||||||
fin->read(reinterpret_cast<char*>(data), length);
|
fin->read(reinterpret_cast<char*>(data), length);
|
||||||
if (fin->gcount() != length)
|
std::streamsize read_count = fin->gcount();
|
||||||
|
if (read_count < 0 || static_cast<png_size_t>(read_count) != length)
|
||||||
{
|
{
|
||||||
png_error(png_ptr, "Read Error");
|
png_error(png_ptr, "Read Error");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue