diff --git a/src/cairo_context.cpp b/src/cairo_context.cpp index cf04116f3..413f76032 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 9917de86c..75669d5f3 100644 --- a/src/font_engine_freetype.cpp +++ b/src/font_engine_freetype.cpp @@ -545,7 +545,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 36aa63ac4..705f8e010 100644 --- a/src/jpeg_reader.cpp +++ b/src/jpeg_reader.cpp @@ -162,7 +162,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 4a732b109..f328c7475 100644 --- a/src/png_reader.cpp +++ b/src/png_reader.cpp @@ -112,7 +112,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"); }