From: Mathieu Desnoyers Date: Mon, 19 Sep 2011 14:42:38 +0000 (-0400) Subject: Integer support: add missing signed casts X-Git-Tag: v0.7~7 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=27265cb3cc3df7e8c8d8f58feb531a28dcab5a49;hp=de913cfdf87242ec3ff54c72a318ebb8714e5465 Integer support: add missing signed casts Signed-off-by: Mathieu Desnoyers --- diff --git a/formats/ctf/types/integer.c b/formats/ctf/types/integer.c index 719823b9..8ce2c3fa 100644 --- a/formats/ctf/types/integer.c +++ b/formats/ctf/types/integer.c @@ -103,7 +103,7 @@ int _aligned_integer_read(struct stream_pos *ppos, v = *(const int16_t *) ctf_get_pos_addr(pos); integer_definition->value._signed = - rbo ? GUINT16_SWAP_LE_BE(v) : v; + rbo ? (int16_t) GUINT16_SWAP_LE_BE(v) : v; break; } case 32: @@ -112,7 +112,7 @@ int _aligned_integer_read(struct stream_pos *ppos, v = *(const int32_t *) ctf_get_pos_addr(pos); integer_definition->value._signed = - rbo ? GUINT32_SWAP_LE_BE(v) : v; + rbo ? (int32_t) GUINT32_SWAP_LE_BE(v) : v; break; } case 64: @@ -121,7 +121,7 @@ int _aligned_integer_read(struct stream_pos *ppos, v = *(const int64_t *) ctf_get_pos_addr(pos); integer_definition->value._signed = - rbo ? GUINT64_SWAP_LE_BE(v) : v; + rbo ? (int64_t) GUINT64_SWAP_LE_BE(v) : v; break; } default: @@ -182,12 +182,12 @@ int _aligned_integer_write(struct stream_pos *ppos, break; case 16: *(int16_t *) ctf_get_pos_addr(pos) = rbo ? - GUINT16_SWAP_LE_BE((int16_t) v) : + (int16_t) GUINT16_SWAP_LE_BE((int16_t) v) : (int16_t) v; break; case 32: *(int32_t *) ctf_get_pos_addr(pos) = rbo ? - GUINT32_SWAP_LE_BE((int32_t) v) : + (int32_t) GUINT32_SWAP_LE_BE((int32_t) v) : (int32_t) v; break; case 64: