aboutsummaryrefslogtreecommitdiffstats
path: root/pack.c
diff options
context:
space:
mode:
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/pack.c b/pack.c
index e18455c..1d225cb 100644
--- a/pack.c
+++ b/pack.c
@@ -12,21 +12,21 @@
#include "pack.h"
#include "trace.h"
-static void write_val(unsigned char *buf, size_t size, enum pack_endian e, uintmax_t val)
+static void write_val(unsigned char *dest, size_t size, enum pack_endian e, uintmax_t val)
{
for (size_t i = 0; i < size; i++)
- buf[i] = (val >> (e == PACK_ENDIAN_LITTLE ? i : size - i - 1) * 8) & 0xff;
+ dest[i] = (val >> (e == PACK_ENDIAN_LITTLE ? i : size - i - 1) * 8) & 0xff;
}
-enum pack_status pack(void *buf_, size_t size, const char *fmt, ...)
+enum pack_status pack(void *dest_, size_t size, const char *fmt, ...)
{
enum pack_endian endianness = PACK_ENDIAN_BIG;
- unsigned char *buf = buf_;
+ unsigned char *dest = dest_;
enum pack_status ret = PACK_OK;
size_t offset = 0;
va_list ap;
- tr_call("pack(%p, %" PRIuSIZE ", %s, ...)", (void *)buf, size, fmt);
+ tr_call("pack(%p, %" PRIuSIZE ", %s, ...)", (void *)dest, size, fmt);
va_start(ap, fmt);
@@ -62,7 +62,7 @@ enum pack_status pack(void *buf_, size_t size, const char *fmt, ...)
v.unsigned_ = n;
}
tr_debug("val.u: %" PRIuMAX, v.unsigned_);
- write_val(&buf[offset], s, endianness, v.unsigned_);
+ write_val(&dest[offset], s, endianness, v.unsigned_);
offset += s;
}