From fadf7e8bf9429ba26e5e0b3203933c1a64c4a14d Mon Sep 17 00:00:00 2001 From: compudj Date: Tue, 23 Aug 2005 23:00:45 +0000 Subject: [PATCH] double and float fix git-svn-id: http://ltt.polymtl.ca/svn@1067 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/ltt/event.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ltt/branches/poly/ltt/event.c b/ltt/branches/poly/ltt/event.c index 3f8dab9c..a5b04681 100644 --- a/ltt/branches/poly/ltt/event.c +++ b/ltt/branches/poly/ltt/event.c @@ -622,7 +622,8 @@ float ltt_event_get_float(LttEvent *e, LttField *f) if(reverse_byte_order == 0) return *(float *)(e->data + f->offset_root); else{ void *ptr = e->data + f->offset_root; - return *(float*)bswap_32(*(guint32*)ptr); + guint32 value = bswap_32(*(guint32*)ptr); + return *(float*)&value; } } @@ -636,7 +637,8 @@ double ltt_event_get_double(LttEvent *e, LttField *f) if(reverse_byte_order == 0) return *(double *)(e->data + f->offset_root); else { void *ptr = e->data + f->offset_root; - return *(double*)bswap_64(*(guint64*)ptr); + guint64 value = bswap_64(*(guint64*)ptr); + return *(double*)&value; } } -- 2.34.1