From: Andre Noll Date: Sat, 14 Aug 2021 21:07:11 +0000 (+0200) Subject: mp4: Drop return value from membuffer_write() and friends. X-Git-Tag: v0.7.1~7^2~68 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=93d7c4bf859117e8003e30e557159efe5f735d82;p=paraslash.git mp4: Drop return value from membuffer_write() and friends. This function always returns the value it received via the last argument. Pointless. --- diff --git a/mp4.c b/mp4.c index 869a6f6d..c0efc4fa 100644 --- a/mp4.c +++ b/mp4.c @@ -1154,7 +1154,8 @@ static struct membuffer *membuffer_create(void) return buf; } -static unsigned membuffer_write(struct membuffer *buf, const void *ptr, unsigned bytes) +static void membuffer_write(struct membuffer *buf, const void *ptr, + unsigned bytes) { unsigned dest_size = buf->written + bytes; @@ -1168,19 +1169,18 @@ static unsigned membuffer_write(struct membuffer *buf, const void *ptr, unsigned if (ptr) memcpy((char *) buf->data + buf->written, ptr, bytes); buf->written += bytes; - return bytes; } -static unsigned membuffer_write_atom_name(struct membuffer *buf, const char *data) +static void membuffer_write_atom_name(struct membuffer *buf, const char *data) { - return membuffer_write(buf, data, 4) == 4 ? 1 : 0; + membuffer_write(buf, data, 4); } -static unsigned membuffer_write_int32(struct membuffer *buf, uint32_t data) +static void membuffer_write_int32(struct membuffer *buf, uint32_t data) { uint8_t temp[4]; write_u32_be(temp, data); - return membuffer_write(buf, temp, 4); + membuffer_write(buf, temp, 4); } static void membuffer_write_std_tag(struct membuffer *buf, const char *name, @@ -1279,9 +1279,7 @@ static bool membuffer_transfer_from_file(struct membuffer *buf, struct mp4 *src, void *bufptr; oldsize = membuffer_get_size(buf); - if (membuffer_write(buf, 0, bytes) != bytes) - return false; - + membuffer_write(buf, 0, bytes); bufptr = membuffer_get_ptr(buf); if (bufptr == 0) return false;