diff --git a/src/cairo_context.cpp b/src/cairo_context.cpp index e2eebc217..3c8925460 100644 --- a/src/cairo_context.cpp +++ b/src/cairo_context.cpp @@ -436,7 +436,7 @@ void cairo_context::add_text(text_path const& path, 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; double x, y, angle; @@ -470,7 +470,7 @@ void cairo_context::add_text(text_path const& path, 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; double x, y, angle; diff --git a/src/font_engine_freetype.cpp b/src/font_engine_freetype.cpp index bc69e2756..c72d4b437 100644 --- a/src/font_engine_freetype.cpp +++ b/src/font_engine_freetype.cpp @@ -539,7 +539,7 @@ box2d text_renderer::prepare_glyphs(text_path const& path) bbox.xMin = bbox.yMin = 32000; // Initialize these so we can tell if we 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; double x, y, angle; diff --git a/src/jpeg_reader.cpp b/src/jpeg_reader.cpp index 254d4601f..0430ae861 100644 --- a/src/jpeg_reader.cpp +++ b/src/jpeg_reader.cpp @@ -161,7 +161,7 @@ void jpeg_reader::skip(j_decompress_ptr cinfo, long count) if (count <= 0) return; //A zero or negative skip count should be treated as a no-op. jpeg_stream_wrapper* wrap = reinterpret_cast(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(wrap->manager.bytes_in_buffer)) { wrap->manager.bytes_in_buffer -= count; wrap->manager.next_input_byte = &wrap->buffer[BUF_SIZE - wrap->manager.bytes_in_buffer]; diff --git a/src/png_reader.cpp b/src/png_reader.cpp index 1762fd524..00584c617 100644 --- a/src/png_reader.cpp +++ b/src/png_reader.cpp @@ -114,7 +114,8 @@ void png_reader::png_read_data(png_structp png_ptr, png_bytep data, png_size_ { input_stream * fin = reinterpret_cast(png_get_io_ptr(png_ptr)); fin->read(reinterpret_cast(data), length); - if (fin->gcount() != length) + std::streamsize read_count = fin->gcount(); + if (read_count < 0 || static_cast(read_count) != length) { png_error(png_ptr, "Read Error"); }