summaryrefslogtreecommitdiffstats
path: root/kernel/kls_hdr/fmt_codec_hdr.cpp
diff options
context:
space:
mode:
authorFrançois Andriot <francois.andriot@free.fr>2015-09-14 01:29:51 +0200
committerSlávek Banko <slavek.banko@axis.cz>2015-09-14 01:29:51 +0200
commit5fdf91b73be14ea616505bdd98c8002c94804172 (patch)
tree8f5acf5afbe22241c7b2ea7703384950eac62864 /kernel/kls_hdr/fmt_codec_hdr.cpp
parent53090f76505d2109d86175f6d002b69996d90eea (diff)
downloadlibksquirrel-5fdf91b73be14ea616505bdd98c8002c94804172.tar.gz
libksquirrel-5fdf91b73be14ea616505bdd98c8002c94804172.zip
Fix build warnings
Signed-off-by: François Andriot <francois.andriot@free.fr>
Diffstat (limited to 'kernel/kls_hdr/fmt_codec_hdr.cpp')
-rw-r--r--kernel/kls_hdr/fmt_codec_hdr.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/kls_hdr/fmt_codec_hdr.cpp b/kernel/kls_hdr/fmt_codec_hdr.cpp
index 33af0a0..91f4803 100644
--- a/kernel/kls_hdr/fmt_codec_hdr.cpp
+++ b/kernel/kls_hdr/fmt_codec_hdr.cpp
@@ -136,8 +136,9 @@ s32 fmt_codec::read_scanline(RGBA *scan)
if (e != 0)
e = (e - 1) << 23;
- t = *(float *)&e;
-
+ // t = *(float *)&e;
+ /* avoid "dereferencing type-punned pointer will break strict-aliasing rules" warning */
+ memcpy(&t, &e, sizeof(t));
(scan + i)->r = u8((r / 255.0f) * t);
(scan + i)->g = u8((g / 255.0f) * t);
(scan + i)->b = u8((b / 255.0f) * t);