diff --git a/src/jpeg_reader.cpp b/src/jpeg_reader.cpp index f7a491307..5af08699e 100644 --- a/src/jpeg_reader.cpp +++ b/src/jpeg_reader.cpp @@ -162,7 +162,8 @@ 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 > 0u + && static_cast(count) < 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]; @@ -190,7 +191,7 @@ void jpeg_reader::attach_stream (j_decompress_ptr cinfo, input_stream* in) cinfo->src = (struct jpeg_source_mgr *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(jpeg_stream_wrapper)); } - jpeg_reader::jpeg_stream_wrapper * src = reinterpret_cast (cinfo->src); + typename jpeg_reader::jpeg_stream_wrapper * src = reinterpret_cast (cinfo->src); src->manager.init_source = init_source; src->manager.fill_input_buffer = fill_input_buffer; src->manager.skip_input_data = skip; diff --git a/src/png_reader.cpp b/src/png_reader.cpp index fa0ec9821..91d0d4f46 100644 --- a/src/png_reader.cpp +++ b/src/png_reader.cpp @@ -110,7 +110,7 @@ void png_reader::png_read_data(png_structp png_ptr, png_bytep data, png_size_ { ifstream * fin = reinterpret_cast(png_get_io_ptr(png_ptr)); fin->read(reinterpret_cast(data), length); - if (fin->gcount() != length) + if (fin->gcount() != static_cast(length)) { png_error(png_ptr, "Read Error"); }