From 0f03cc378e6ce48f17a20e409f93bfc11345a6ed Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 16 May 2017 20:14:22 +0200 Subject: Fix errors and warnings and make the code cleaner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blind-rewrite-head.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/blind-rewrite-head.c') diff --git a/src/blind-rewrite-head.c b/src/blind-rewrite-head.c index 894e431..ca31006 100644 --- a/src/blind-rewrite-head.c +++ b/src/blind-rewrite-head.c @@ -1,10 +1,5 @@ /* See LICENSE file for copyright and license details. */ -#include "stream.h" -#include "util.h" - -#include -#include -#include +#include "common.h" USAGE("[-h] file [(frames | 'auto') [(width | 'same') (height | 'same') [format | 'same']]]") @@ -40,7 +35,7 @@ rewrite(struct stream *stream, int frames_auto) eprintf("%s: video is too long\n", stream->file); if ((size_t)headlen > stream->headlen) - if (ftruncate(stream->fd, length + headlen)) + if (ftruncate(stream->fd, (off_t)length + (off_t)headlen)) eprintf("ftruncate %s:", stream->file); data = mmap(0, length + (size_t)headlen, PROT_READ | PROT_WRITE, MAP_SHARED, stream->fd, 0); @@ -52,7 +47,7 @@ rewrite(struct stream *stream, int frames_auto) munmap(data, length + (size_t)headlen); if ((size_t)headlen < stream->headlen) - if (ftruncate(stream->fd, length + headlen)) + if (ftruncate(stream->fd, (off_t)length + (off_t)headlen)) eprintf("ftruncate %s:", stream->file); } -- cgit v1.2.3-70-g09d2