Commit c8a88a76 authored by Johann's avatar Johann

Explicitly discard fwrite/fread return values

Using if(); triggers an empty body warning with clang

Change-Id: I0fa2ee676400a974b40f8eaafca9ae668107eebb
parent cd0bf0e4
......@@ -48,8 +48,8 @@ for(plane=0; plane < 3; plane++) {
unsigned char *buf =img->planes[plane];
for(y=0; y < (plane ? (img->d_h + 1) >> 1 : img->d_h); y++) {
if(fwrite(buf, 1, (plane ? (img->d_w + 1) >> 1 : img->d_w),
outfile));
(void) fwrite(buf, 1, (plane ? (img->d_w + 1) >> 1 : img->d_w),
outfile);
buf += img->stride[plane];
}
}
......
......@@ -85,7 +85,7 @@ static void write_ivf_file_header(FILE *outfile,
mem_put_le32(header+24, frame_cnt); /* length */
mem_put_le32(header+28, 0); /* unused */
if(fwrite(header, 1, 32, outfile));
(void) fwrite(header, 1, 32, outfile);
}
......@@ -103,7 +103,7 @@ static void write_ivf_frame_header(FILE *outfile,
mem_put_le32(header+4, pts&0xFFFFFFFF);
mem_put_le32(header+8, pts >> 32);
if(fwrite(header, 1, 12, outfile));
(void) fwrite(header, 1, 12, outfile);
}
int main(int argc, char **argv) {
......
......@@ -61,8 +61,8 @@ if(vpx_codec_encode(&codec, frame_avail? &raw : NULL, frame_cnt,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_FRAME
case VPX_CODEC_CX_FRAME_PKT:
write_ivf_frame_header(outfile, pkt);
if(fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
outfile));
(void) fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
outfile);
break;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_FRAME
......
......@@ -853,7 +853,8 @@ skip_motion_search:
else
recon_file = fopen(filename, "ab");
if(fwrite(lst_yv12->buffer_alloc, lst_yv12->frame_size, 1, recon_file));
(void) fwrite(lst_yv12->buffer_alloc, lst_yv12->frame_size, 1,
recon_file);
fclose(recon_file);
}
......
......@@ -164,7 +164,7 @@ static void write_ivf_file_header(FILE *outfile,
mem_put_le32(header+24, frame_cnt); /* length */
mem_put_le32(header+28, 0); /* unused */
if(fwrite(header, 1, 32, outfile));
(void) fwrite(header, 1, 32, outfile);
}
static void write_ivf_frame_header(FILE *outfile,
......@@ -181,7 +181,7 @@ static void write_ivf_frame_header(FILE *outfile,
mem_put_le32(header+4, pts&0xFFFFFFFF);
mem_put_le32(header+8, pts >> 32);
if(fwrite(header, 1, 12, outfile));
(void) fwrite(header, 1, 12, outfile);
}
int main(int argc, char **argv)
......@@ -410,8 +410,8 @@ int main(int argc, char **argv)
switch(pkt[i]->kind) {
case VPX_CODEC_CX_FRAME_PKT:
write_ivf_frame_header(outfile[i], pkt[i]);
if(fwrite(pkt[i]->data.frame.buf, 1, pkt[i]->data.frame.sz,
outfile[i]));
(void) fwrite(pkt[i]->data.frame.buf, 1,
pkt[i]->data.frame.sz, outfile[i]);
break;
case VPX_CODEC_PSNR_PKT:
if (show_psnr)
......
......@@ -93,7 +93,7 @@ static void write_ivf_file_header(FILE *outfile,
mem_put_le32(header+24, frame_cnt); /* length */
mem_put_le32(header+28, 0); /* unused */
if(fwrite(header, 1, 32, outfile));
(void) fwrite(header, 1, 32, outfile);
}
......@@ -111,7 +111,7 @@ static void write_ivf_frame_header(FILE *outfile,
mem_put_le32(header+4, pts&0xFFFFFFFF);
mem_put_le32(header+8, pts >> 32);
if(fwrite(header, 1, 12, outfile));
(void) fwrite(header, 1, 12, outfile);
}
static int mode_to_num_layers[9] = {2, 2, 3, 3, 3, 3, 5, 2, 3};
......@@ -530,8 +530,8 @@ int main(int argc, char **argv) {
i<cfg.ts_number_layers; i++)
{
write_ivf_frame_header(outfile[i], pkt);
if (fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
outfile[i]));
(void) fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
outfile[i]);
frames_in_layer[i]++;
}
break;
......@@ -562,4 +562,3 @@ int main(int argc, char **argv) {
return EXIT_SUCCESS;
}
......@@ -356,7 +356,7 @@ void out_put(void *out, const uint8_t *buf, unsigned int len, int do_md5)
}
else
{
if(fwrite(buf, 1, len, out));
(void) fwrite(buf, 1, len, out);
}
}
......
......@@ -245,7 +245,7 @@ void stats_write(stats_io_t *stats, const void *pkt, size_t len)
{
if (stats->file)
{
if(fwrite(pkt, 1, len, stats->file));
(void) fwrite(pkt, 1, len, stats->file);
}
else
{
......@@ -338,7 +338,7 @@ static int read_frame(struct input_state *input, vpx_image_t *img)
* write_ivf_frame_header() for documentation on the frame header
* layout.
*/
if(fread(junk, 1, IVF_FRAME_HDR_SZ, f));
(void) fread(junk, 1, IVF_FRAME_HDR_SZ, f);
}
for (plane = 0; plane < 3; plane++)
......@@ -468,7 +468,7 @@ static void write_ivf_file_header(FILE *outfile,
mem_put_le32(header + 24, frame_cnt); /* length */
mem_put_le32(header + 28, 0); /* unused */
if(fwrite(header, 1, 32, outfile));
(void) fwrite(header, 1, 32, outfile);
}
......@@ -486,14 +486,14 @@ static void write_ivf_frame_header(FILE *outfile,
mem_put_le32(header + 4, pts & 0xFFFFFFFF);
mem_put_le32(header + 8, pts >> 32);
if(fwrite(header, 1, 12, outfile));
(void) fwrite(header, 1, 12, outfile);
}
static void write_ivf_frame_size(FILE *outfile, size_t size)
{
char header[4];
mem_put_le32(header, size);
fwrite(header, 1, 4, outfile);
(void) fwrite(header, 1, 4, outfile);
}
......@@ -541,7 +541,7 @@ struct EbmlGlobal
void Ebml_Write(EbmlGlobal *glob, const void *buffer_in, unsigned long len)
{
if(fwrite(buffer_in, 1, len, glob->stream));
(void) fwrite(buffer_in, 1, len, glob->stream);
}
#define WRITE_BUFFER(s) \
......@@ -2259,8 +2259,8 @@ static void get_cx_data(struct stream_state *stream,
}
}
fwrite(pkt->data.frame.buf, 1,
pkt->data.frame.sz, stream->file);
(void) fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
stream->file);
}
stream->nbytes += pkt->data.raw.sz;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment