Coverity complained about *(ig->read_ptr++) because the result of the *
operator was ignored, which was deliberate.
I could simply had added a void cast, but given i_io_peekc(),
I could see a macro that skips the * being simpler to read, adding
i_io_nextc(), which is exposed as the nextc() method on Imager::IO
objects.
- error diffusion now validates a custom error diffusion map and reports
an error if it's bad. CID 185288.
+ - avoid discarding the value of i_io_getc() when scanning numbers in
+ pnm.c. CID 185293.
+
[1] The first two build submissions ended up at the end of a ~400
build queue, and seemed to have been cancelled by Coverity. A build
submitted on NYE went through in minutes.
i_io_getc(ig)
Imager::IO ig
+void
+i_io_nextc(ig)
+ Imager::IO ig
+
int
i_io_putc(ig, c)
Imager::IO ig
((ig)->read_ptr < (ig)->read_end ? \
*((ig)->read_ptr++) : \
i_io_getc_imp(ig))
+#define i_io_nextc(ig) \
+ ((void)((ig)->read_ptr < (ig)->read_end ? \
+ ((ig)->read_ptr++, 0) : \
+ i_io_getc_imp(ig)))
#define i_io_peekc(ig) \
((ig)->read_ptr < (ig)->read_end ? \
*((ig)->read_ptr) : \
print chr($c);
}
+=item nextc()
+
+Discard the next byte from the stream.
+
+Returns nothing.
+
=item gets()
=item gets($max_size)
return 0;
}
*i = work;
- i_io_getc(ig);
+ i_io_nextc(ig);
}
return 1;