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;
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,
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;