X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Ftypes%2Finteger.c;h=5b56227d85d4d0ccfbd323aa52d3804c31d3682b;hp=b5c59ddea1bf4dc9704e096f53c6e5cdc5cc0c74;hb=9b0422a038d313a812e1c862122ec1f2b70add9a;hpb=670977d3f384db208f375255a83060d90075d626 diff --git a/formats/ctf/types/integer.c b/formats/ctf/types/integer.c index b5c59dde..5b56227d 100644 --- a/formats/ctf/types/integer.c +++ b/formats/ctf/types/integer.c @@ -3,7 +3,9 @@ * * Integers read/write functions. * - * Copyright 2010 - Mathieu Desnoyers + * Copyright 2010-2011 EfficiOS Inc. and Linux Foundation + * + * Author: Mathieu Desnoyers * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -20,7 +22,7 @@ #include #include #include -#include +#include /* * The aligned read/write functions are expected to be faster than the @@ -101,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: @@ -110,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: @@ -119,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: @@ -180,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: