From 57c7604568b4e7cea8004346cdd9d34b9c46a6c7 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Sun, 11 Mar 2012 10:53:42 +0000 Subject: [PATCH] Fixed Android build warning --- modules/contrib/src/rgbdodometry.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/contrib/src/rgbdodometry.cpp b/modules/contrib/src/rgbdodometry.cpp index 2ec4c01..decca23 100644 --- a/modules/contrib/src/rgbdodometry.cpp +++ b/modules/contrib/src/rgbdodometry.cpp @@ -137,7 +137,8 @@ void set2shorts( int& dst, int short_v1, int short_v2 ) static inline void get2shorts( int src, int& short_v1, int& short_v2 ) { - unsigned short* ptr = reinterpret_cast(&src); + typedef union { int vint32; unsigned short vuint16[2]; } s32tou16; + const unsigned short* ptr = (reinterpret_cast(&src))->vuint16; short_v1 = ptr[0]; short_v2 = ptr[1]; } -- 2.7.4