+ fix warnings when compiling with g++ 4.2.1 on os x

This commit is contained in:
artemp 2013-04-22 11:36:37 +01:00
parent 3f6abd3362
commit 4dd31056fc
2 changed files with 4 additions and 3 deletions

View file

@ -162,7 +162,8 @@ 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.
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 > 0u
&& static_cast<unsigned long>(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<T>::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<jpeg_reader::jpeg_stream_wrapper*> (cinfo->src);
typename jpeg_reader::jpeg_stream_wrapper * src = reinterpret_cast<typename jpeg_reader::jpeg_stream_wrapper*> (cinfo->src);
src->manager.init_source = init_source;
src->manager.fill_input_buffer = fill_input_buffer;
src->manager.skip_input_data = skip;

View file

@ -110,7 +110,7 @@ void png_reader<T>::png_read_data(png_structp png_ptr, png_bytep data, png_size_
{
ifstream * fin = reinterpret_cast<ifstream*>(png_get_io_ptr(png_ptr));
fin->read(reinterpret_cast<char*>(data), length);
if (fin->gcount() != length)
if (fin->gcount() != static_cast<std::streamsize>(length))
{
png_error(png_ptr, "Read Error");
}