mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +01:00
dwebp: correct sign in format strings
width / height are unsigned; fixes a warning with msvs /analyze:
C6340: Mismatch on sign: 'const unsigned int' passed as _Param_(4) when
some signed type is required in call to 'fprintf'.
(cherry picked from commit 47d26be760
)
Change-Id: I5f1fad4c93745baf17d70178a5e66579ccd2b155
This commit is contained in:
parent
b61ce861f3
commit
90f1ec58a9
@ -244,10 +244,10 @@ static int WritePPM(FILE* fout, const WebPDecBuffer* const buffer, int alpha) {
|
||||
uint32_t y;
|
||||
|
||||
if (alpha) {
|
||||
fprintf(fout, "P7\nWIDTH %d\nHEIGHT %d\nDEPTH 4\nMAXVAL 255\n"
|
||||
fprintf(fout, "P7\nWIDTH %u\nHEIGHT %u\nDEPTH 4\nMAXVAL 255\n"
|
||||
"TUPLTYPE RGB_ALPHA\nENDHDR\n", width, height);
|
||||
} else {
|
||||
fprintf(fout, "P6\n%d %d\n255\n", width, height);
|
||||
fprintf(fout, "P6\n%u %u\n255\n", width, height);
|
||||
}
|
||||
for (y = 0; y < height; ++y) {
|
||||
if (fwrite(rgb + y * stride, width, bytes_per_px, fout) != bytes_per_px) {
|
||||
@ -404,7 +404,7 @@ static int WriteAlphaPlane(FILE* fout, const WebPDecBuffer* const buffer) {
|
||||
const int a_stride = buffer->u.YUVA.a_stride;
|
||||
uint32_t y;
|
||||
assert(a != NULL);
|
||||
fprintf(fout, "P5\n%d %d\n255\n", width, height);
|
||||
fprintf(fout, "P5\n%u %u\n255\n", width, height);
|
||||
for (y = 0; y < height; ++y) {
|
||||
if (fwrite(a + y * a_stride, width, 1, fout) != 1) {
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user