From: Michael Jeanson Date: Mon, 14 Dec 2020 16:20:11 +0000 (-0500) Subject: fix: remove floating-point arguments in msgpack X-Git-Tag: v2.13.0-rc1~65 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=61e631e93e512b636ea6d52796bcce1c485a551b;p=lttng-modules.git fix: remove floating-point arguments in msgpack Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers Change-Id: I6366ac303157e4ab66045b09c6f03aadee0717c8 --- diff --git a/include/lttng/msgpack.h b/include/lttng/msgpack.h index e5c011ea..5db7c424 100644 --- a/include/lttng/msgpack.h +++ b/include/lttng/msgpack.h @@ -49,7 +49,6 @@ int lttng_msgpack_write_unsigned_integer( struct lttng_msgpack_writer *writer, uint64_t value); int lttng_msgpack_write_signed_integer( struct lttng_msgpack_writer *writer, int64_t value); -int lttng_msgpack_write_double(struct lttng_msgpack_writer *writer, double value); int lttng_msgpack_write_str(struct lttng_msgpack_writer *writer, const char *value); int lttng_msgpack_begin_map(struct lttng_msgpack_writer *writer, size_t count); diff --git a/src/lib/msgpack/msgpack.c b/src/lib/msgpack/msgpack.c index 16658d11..b4d9beec 100644 --- a/src/lib/msgpack/msgpack.c +++ b/src/lib/msgpack/msgpack.c @@ -144,20 +144,6 @@ static inline int lttng_msgpack_append_u64( return lttng_msgpack_append_buffer(writer, (uint8_t *) &value, sizeof(value)); } -static inline int lttng_msgpack_append_f64( - struct lttng_msgpack_writer *writer, double value) -{ - - union { - double d; - uint64_t u; - } u; - - u.d = value; - - return lttng_msgpack_append_u64(writer, u.u); -} - static inline int lttng_msgpack_append_i8( struct lttng_msgpack_writer *writer, int8_t value) { @@ -182,23 +168,6 @@ static inline int lttng_msgpack_append_i64( return lttng_msgpack_append_u64(writer, (uint64_t) value); } -static inline int lttng_msgpack_encode_f64( - struct lttng_msgpack_writer *writer, double value) -{ - int ret; - - ret = lttng_msgpack_append_u8(writer, MSGPACK_FLOAT64_ID); - if (ret) - goto end; - - ret = lttng_msgpack_append_f64(writer, value); - if (ret) - goto end; - -end: - return ret; -} - static inline int lttng_msgpack_encode_fixmap( struct lttng_msgpack_writer *writer, uint8_t count) { @@ -494,11 +463,6 @@ end: return ret; } -int lttng_msgpack_write_double(struct lttng_msgpack_writer *writer, double value) -{ - return lttng_msgpack_encode_f64(writer, value); -} - void lttng_msgpack_writer_init(struct lttng_msgpack_writer *writer, uint8_t *buffer, size_t size) {