diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-10-02 12:43:18 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-10-02 12:43:18 +0200 |
commit | e9aa47200ea8c0907537483a7a7c5292b6238d6f (patch) | |
tree | e233d7300fe604613bbc4f5a178f8f3f78d86d91 | |
parent | c7d4858e3adbd27f47461f7f105bbff95dcdf3b3 (diff) |
fix aliasing error for parsing message float data
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rwxr-xr-x | data/gen-code.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/data/gen-code.pl b/data/gen-code.pl index 5245bde..f45d28a 100755 --- a/data/gen-code.pl +++ b/data/gen-code.pl @@ -19,7 +19,7 @@ my %tlv_get = ( guint32 => "le32_to_cpu(*(uint32_t *) get_next(4))", gint64 => "le64_to_cpu(*(uint64_t *) get_next(8))", guint64 => "le64_to_cpu(*(uint64_t *) get_next(8))", - gfloat => "({ uint32_t data = le32_to_cpu(*(uint32_t *) get_next(4)); *((float *) &data); })" + gfloat => "({ uint32_t data = le32_to_cpu(*(uint32_t *) get_next(4)); float _val; memcpy(&_val, &data, sizeof(_val)); _val; })" ); my %tlv_get_be = ( |