diff --git a/src/utils/proto.c b/src/utils/proto.c
index 51c2ed8c45361f4625c4e7dc6d956594d7a96a7e..beaa07e98397f18876f27952ab38ed83ff673638 100644 (file)
--- a/src/utils/proto.c
+++ b/src/utils/proto.c
* been available. */
static ssize_t
-marshal_int(char *buf, size_t buf_len, int64_t v)
+marshal_int64(char *buf, size_t buf_len, int64_t v)
{
if (buf_len >= sizeof(v)) {
#if __BYTE_ORDER != __BIG_ENDIAN
memcpy(buf, &v, sizeof(v));
}
return sizeof(v);
-} /* marshal_int */
+} /* marshal_int64 */
static ssize_t
marshal_double(char *buf, size_t buf_len, double v)
static ssize_t
marshal_datetime(char *buf, size_t buf_len, sdb_time_t v)
{
- return marshal_int(buf, buf_len, (int64_t)v);
+ return marshal_int64(buf, buf_len, (int64_t)v);
} /* marshal_datetime */
static ssize_t
return len;
if (datum->type == SDB_TYPE_INTEGER)
- n = marshal_int(buf, buf_len, datum->data.integer);
+ n = marshal_int64(buf, buf_len, datum->data.integer);
else if (datum->type == SDB_TYPE_DECIMAL)
n = marshal_double(buf, buf_len, datum->data.decimal);
else if (datum->type == SDB_TYPE_STRING)
for (i = 0; i < datum->data.array.length; ++i) {
if (type == SDB_TYPE_INTEGER) {
int64_t *v = datum->data.array.values;
- n = marshal_int(buf, buf_len, v[i]);
+ n = marshal_int64(buf, buf_len, v[i]);
}
else if (type == SDB_TYPE_DECIMAL) {
double *v = datum->data.array.values;
if (buf_len < 2 * sizeof(uint32_t))
return -1;
- tmp = sdb_proto_unmarshal_int(buf, buf_len);
+ tmp = sdb_proto_unmarshal_int32(buf, buf_len);
if (code)
*code = tmp;
- tmp = sdb_proto_unmarshal_int(buf + sizeof(uint32_t),
+ tmp = sdb_proto_unmarshal_int32(buf + sizeof(uint32_t),
buf_len - sizeof(uint32_t));
if (msg_len)
*msg_len = tmp;
} /* sdb_proto_unmarshal_header */
uint32_t
-sdb_proto_unmarshal_int(const char *buf, size_t buf_len)
+sdb_proto_unmarshal_int32(const char *buf, size_t buf_len)
{
uint32_t n;
memcpy(&n, buf, sizeof(n));
return ntohl(n);
-} /* sdb_proto_unmarshal_int */
+} /* sdb_proto_unmarshal_int32 */
/* vim: set tw=78 sw=4 ts=4 noexpandtab : */