Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2019-02-07 16:23:10 +0300
committerMartin Storsjö <martin@martin.st>2019-02-08 01:28:46 +0300
commitb1d571f1bc9b31e86cc4e09d004d86558026cde4 (patch)
tree04561f365dedeb6113c2fb43a45109180b7494b8 /tools
parent4aa735b242a72139c7816a52870658f205218674 (diff)
tools: Store return values from fread() in a size_t
In annexb_read, the res variable was used both for the return from fread() (which is size_t, unsigned) and from leb128 (which returns a signed int); remove the return value assignment altogether as it wasn't used.
Diffstat (limited to 'tools')
-rw-r--r--tools/input/annexb.c2
-rw-r--r--tools/input/ivf.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/input/annexb.c b/tools/input/annexb.c
index 5b3a986..e291490 100644
--- a/tools/input/annexb.c
+++ b/tools/input/annexb.c
@@ -103,7 +103,7 @@ static int annexb_read(AnnexbInputContext *const c, Dav1dData *const data) {
if (!ptr) return -1;
c->temporal_unit_size -= len + res;
c->frame_unit_size -= len + res;
- if ((res = fread(ptr, len, 1, c->f)) != 1) {
+ if (fread(ptr, len, 1, c->f) != 1) {
fprintf(stderr, "Failed to read frame data: %s\n", strerror(errno));
dav1d_data_unref(data);
return -1;
diff --git a/tools/input/ivf.c b/tools/input/ivf.c
index 9e9c415..5faa092 100644
--- a/tools/input/ivf.c
+++ b/tools/input/ivf.c
@@ -55,7 +55,7 @@ static int64_t rl64(const uint8_t *const p) {
static int ivf_open(IvfInputContext *const c, const char *const file,
unsigned fps[2], unsigned *const num_frames)
{
- int res;
+ size_t res;
uint8_t hdr[32];
memset(c, 0, sizeof(*c));
@@ -97,7 +97,7 @@ static int ivf_open(IvfInputContext *const c, const char *const file,
static int ivf_read(IvfInputContext *const c, Dav1dData *const buf) {
uint8_t data[8];
uint8_t *ptr;
- int res;
+ size_t res;
const int64_t off = ftello(c->f);
if ((res = fread(data, 4, 1, c->f)) != 1)