Fix openmax issue with casting pointers to uint32.
R=andrew@webrtc.org, rtoy@google.com
Review URL: https://webrtc-codereview.appspot.com/12249004
git-svn-id: http://webrtc.googlecode.com/svn/deps/third_party/openmax@6019 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/dl/sp/src/arm/omxSP_FFTInit_C_FC32.c b/dl/sp/src/arm/omxSP_FFTInit_C_FC32.c
index 4a68b6f..a6b6014 100644
--- a/dl/sp/src/arm/omxSP_FFTInit_C_FC32.c
+++ b/dl/sp/src/arm/omxSP_FFTInit_C_FC32.c
@@ -11,12 +11,13 @@
* complex float instead of SC32.
*/
+#include <stdint.h>
+
#include "dl/api/arm/armOMX.h"
#include "dl/api/omxtypes.h"
#include "dl/sp/api/armSP.h"
#include "dl/sp/api/omxSP.h"
-
/**
* Function: omxSP_FFTInit_C_FC32
*
@@ -76,14 +77,14 @@
pTwiddle = (OMX_FC32 *) (sizeof(ARMsFFTSpec_FC32) + (OMX_S8*) pFFTSpec);
/* Align to 32 byte boundary */
- pTmp = ((OMX_U32) pTwiddle) & 31;
+ pTmp = ((uintptr_t) pTwiddle) & 31;
if (pTmp)
pTwiddle = (OMX_FC32*) ((OMX_S8*)pTwiddle + (32 - pTmp));
pBuf = (OMX_FC32*) (sizeof(OMX_FC32) * (3 * N / 4) + (OMX_S8*) pTwiddle);
/* Align to 32 byte boundary */
- pTmp = ((OMX_U32)pBuf) & 31;
+ pTmp = ((uintptr_t)pBuf) & 31;
if (pTmp)
pBuf = (OMX_FC32*) ((OMX_S8*)pBuf + (32 - pTmp));
diff --git a/dl/sp/src/arm/omxSP_FFTInit_C_SC16.c b/dl/sp/src/arm/omxSP_FFTInit_C_SC16.c
index 0a23b8b..69840fc 100644
--- a/dl/sp/src/arm/omxSP_FFTInit_C_SC16.c
+++ b/dl/sp/src/arm/omxSP_FFTInit_C_SC16.c
@@ -25,12 +25,13 @@
* Initializes the specification structures required
*/
+ #include <stdint.h>
+
#include "dl/api/arm/armOMX.h"
#include "dl/api/omxtypes.h"
#include "dl/sp/api/armSP.h"
#include "dl/sp/api/omxSP.h"
-
/**
* Function: omxSP_FFTInit_C_SC16
*
@@ -90,7 +91,7 @@
(sizeof(ARMsFFTSpec_SC16) + (OMX_S8*) pFFTSpec);
/* Align to 32 byte boundary */
- pTmp = ((OMX_U32)pTwiddle)&31; /* (OMX_U32)pTwiddle % 32 */
+ pTmp = ((uintptr_t)pTwiddle)&31; /* (uintptr_t)pTwiddle % 32 */
if(pTmp != 0)
pTwiddle = (OMX_SC16*) ((OMX_S8*)pTwiddle + (32-pTmp));
@@ -98,7 +99,7 @@
(sizeof(OMX_SC16) * (3*N/4) + (OMX_S8*) pTwiddle);
/* Align to 32 byte boundary */
- pTmp = ((OMX_U32)pBuf)&31; /* (OMX_U32)pBuf % 32 */
+ pTmp = ((uintptr_t)pBuf)&31; /* (uintptr_t)pBuf % 32 */
if(pTmp != 0)
pBuf = (OMX_SC16*) ((OMX_S8*)pBuf + (32-pTmp));
diff --git a/dl/sp/src/arm/omxSP_FFTInit_C_SC32.c b/dl/sp/src/arm/omxSP_FFTInit_C_SC32.c
index 0b4b537..085fdd1 100644
--- a/dl/sp/src/arm/omxSP_FFTInit_C_SC32.c
+++ b/dl/sp/src/arm/omxSP_FFTInit_C_SC32.c
@@ -25,12 +25,13 @@
* Initializes the specification structures required
*/
+ #include <stdint.h>
+
#include "dl/api/arm/armOMX.h"
#include "dl/api/omxtypes.h"
#include "dl/sp/api/armSP.h"
#include "dl/sp/api/omxSP.h"
-
/**
* Function: omxSP_FFTInit_C_SC32
*
@@ -89,7 +90,7 @@
(sizeof(ARMsFFTSpec_SC32) + (OMX_S8*) pFFTSpec);
/* Align to 32 byte boundary */
- pTmp = ((OMX_U32)pTwiddle)&31; /* (OMX_U32)pTwiddle % 32 */
+ pTmp = ((uintptr_t)pTwiddle)&31; /* (uintptr_t)pTwiddle % 32 */
if(pTmp != 0)
pTwiddle = (OMX_SC32*) ((OMX_S8*)pTwiddle + (32-pTmp));
diff --git a/dl/sp/src/arm/omxSP_FFTInit_R_F32.c b/dl/sp/src/arm/omxSP_FFTInit_R_F32.c
index b506783..a7c1383 100644
--- a/dl/sp/src/arm/omxSP_FFTInit_R_F32.c
+++ b/dl/sp/src/arm/omxSP_FFTInit_R_F32.c
@@ -11,6 +11,8 @@
* instead of S32.
*/
+#include <stdint.h>
+
#include "dl/api/arm/armOMX.h"
#include "dl/api/omxtypes.h"
#include "dl/sp/api/armSP.h"
@@ -77,14 +79,14 @@
pTwiddle = (OMX_FC32 *) (sizeof(ARMsFFTSpec_R_SC32) + (OMX_S8*) pFFTSpec);
/* Align to 32 byte boundary */
- pTmp = ((OMX_U32)pTwiddle) & 31;
+ pTmp = ((uintptr_t)pTwiddle) & 31;
if (pTmp)
pTwiddle = (OMX_FC32*) ((OMX_S8*)pTwiddle + (32 - pTmp));
pBuf = (OMX_F32*) (sizeof(OMX_FC32)*(5*N/8) + (OMX_S8*) pTwiddle);
/* Align to 32 byte boundary */
- pTmp = ((OMX_U32)pBuf)&31; /* (OMX_U32)pBuf % 32 */
+ pTmp = ((uintptr_t)pBuf)&31; /* (uintptr_t)pBuf % 32 */
if (pTmp)
pBuf = (OMX_F32*) ((OMX_S8*)pBuf + (32 - pTmp));
diff --git a/dl/sp/src/arm/omxSP_FFTInit_R_S16.c b/dl/sp/src/arm/omxSP_FFTInit_R_S16.c
index e3fc271..9ce6499 100644
--- a/dl/sp/src/arm/omxSP_FFTInit_R_S16.c
+++ b/dl/sp/src/arm/omxSP_FFTInit_R_S16.c
@@ -20,6 +20,8 @@
* (c) Copyright 2007-2008 ARM Limited. All Rights Reserved.
*/
+#include <stdint.h>
+
#include "dl/api/arm/armOMX.h"
#include "dl/api/omxtypes.h"
#include "dl/sp/api/armSP.h"
@@ -74,7 +76,7 @@
pTwiddle = (OMX_SC16*) (sizeof(ARMsFFTSpec_R_SC16) + (OMX_S8*)pFFTSpec);
/* Align to 32 byte boundary */
- pTmp = ((OMX_U32)pTwiddle)&31; /* (OMX_U32)pTwiddle % 32 */
+ pTmp = ((uintptr_t)pTwiddle)&31; /* (uintptr_t)pTwiddle % 32 */
if(pTmp != 0) {
pTwiddle = (OMX_SC16*) ((OMX_S8*)pTwiddle + (32 - pTmp));
}
diff --git a/dl/sp/src/arm/omxSP_FFTInit_R_S16S32.c b/dl/sp/src/arm/omxSP_FFTInit_R_S16S32.c
index 9a66430..d3fd23f 100644
--- a/dl/sp/src/arm/omxSP_FFTInit_R_S16S32.c
+++ b/dl/sp/src/arm/omxSP_FFTInit_R_S16S32.c
@@ -25,13 +25,13 @@
* Initialize the real forward-FFT specification information struct.
*/
+#include <stdint.h>
+
#include "dl/api/arm/armOMX.h"
#include "dl/api/omxtypes.h"
#include "dl/sp/api/armSP.h"
#include "dl/sp/api/omxSP.h"
-
-
/**
* Function: omxSP_FFTInit_R_S16_S32
*
@@ -96,7 +96,7 @@
(sizeof(ARMsFFTSpec_R_SC32) + (OMX_S8*) pFFTSpec);
/* Align to 32 byte boundary */
- pTmp = ((OMX_U32)pTwiddle)&31; /* (OMX_U32)pTwiddle % 32 */
+ pTmp = ((uintptr_t)pTwiddle)&31; /* (OMX_U32)pTwiddle % 32 */
if(pTmp != 0)
pTwiddle = (OMX_SC32*) ((OMX_S8*)pTwiddle + (32-pTmp));
@@ -105,7 +105,7 @@
(sizeof(OMX_SC32) * (5*N/8) + (OMX_S8*) pTwiddle);
/* Align to 32 byte boundary */
- pTmp = ((OMX_U32)pBuf)&31; /* (OMX_U32)pBuf % 32 */
+ pTmp = ((uintptr_t)pBuf)&31; /* (OMX_U32)pBuf % 32 */
if(pTmp != 0)
pBuf = (OMX_S32*) ((OMX_S8*)pBuf + (32-pTmp));
diff --git a/dl/sp/src/arm/omxSP_FFTInit_R_S32.c b/dl/sp/src/arm/omxSP_FFTInit_R_S32.c
index d55ab06..9f8a080 100644
--- a/dl/sp/src/arm/omxSP_FFTInit_R_S32.c
+++ b/dl/sp/src/arm/omxSP_FFTInit_R_S32.c
@@ -25,13 +25,13 @@
* Initialize the real forward-FFT specification information struct.
*/
+#include <stdint.h>
+
#include "dl/api/arm/armOMX.h"
#include "dl/api/omxtypes.h"
#include "dl/sp/api/armSP.h"
#include "dl/sp/api/omxSP.h"
-
-
/**
* Function: omxSP_FFTInit_R_S32
*
@@ -95,7 +95,7 @@
(sizeof(ARMsFFTSpec_R_SC32) + (OMX_S8*) pFFTSpec);
/* Align to 32 byte boundary */
- pTmp = ((OMX_U32)pTwiddle)&31; /* (OMX_U32)pTwiddle % 32 */
+ pTmp = ((uintptr_t)pTwiddle)&31; /* (uintptr_t)pTwiddle % 32 */
if(pTmp != 0)
pTwiddle = (OMX_SC32*) ((OMX_S8*)pTwiddle + (32-pTmp));
diff --git a/dl/sp/src/x86/omxSP_FFTFwd_RToCCS_F32_Sfs.c b/dl/sp/src/x86/omxSP_FFTFwd_RToCCS_F32_Sfs.c
index a881fdc..3d3c9d2 100644
--- a/dl/sp/src/x86/omxSP_FFTFwd_RToCCS_F32_Sfs.c
+++ b/dl/sp/src/x86/omxSP_FFTFwd_RToCCS_F32_Sfs.c
@@ -9,11 +9,13 @@
*
*/
+#include <stdbool.h>
+#include <stdint.h>
+
#include "dl/api/omxtypes.h"
#include "dl/sp/api/omxSP.h"
#include "dl/sp/api/x86SP.h"
#include "dl/sp/src/x86/x86SP_SSE_Math.h"
-#include <stdbool.h>
extern OMX_F32* x86SP_F32_radix2_kernel_OutOfPlace(
const OMX_F32 *src,
@@ -182,7 +184,7 @@
const X86FFTSpec_R_FC32 *pFFTStruct = (const X86FFTSpec_R_FC32*) pFFTSpec;
// Input must be 32 byte aligned
- if (!pSrc || !pDst || (OMX_INT)pSrc & 31 || (OMX_INT)pDst & 31)
+ if (!pSrc || !pDst || (const uintptr_t)pSrc & 31 || (uintptr_t)pDst & 31)
return OMX_Sts_BadArgErr;
n = pFFTStruct->N;
diff --git a/dl/sp/src/x86/omxSP_FFTInit_R_F32.c b/dl/sp/src/x86/omxSP_FFTInit_R_F32.c
index 564f166..89c316c 100644
--- a/dl/sp/src/x86/omxSP_FFTInit_R_F32.c
+++ b/dl/sp/src/x86/omxSP_FFTInit_R_F32.c
@@ -11,6 +11,8 @@
* instead of S32.
*/
+#include <stdint.h>
+
#include "dl/api/omxtypes.h"
#include "dl/sp/api/omxSP.h"
#include "dl/sp/api/x86SP.h"
@@ -64,14 +66,14 @@
pTwiddle = (OMX_F32*) (sizeof(X86FFTSpec_R_FC32) + (OMX_S8*) pFFTSpec);
// Align to 32 byte boundary.
- pTmp = ((OMX_U32)pTwiddle) & 31;
+ pTmp = ((uintptr_t)pTwiddle) & 31;
if (pTmp)
pTwiddle = (OMX_F32*) ((OMX_S8*)pTwiddle + (32 - pTmp));
pBuf = (OMX_F32*) (sizeof(OMX_F32) * (N << 1) + (OMX_S8*) pTwiddle);
// Align to 32 byte boundary.
- pTmp = ((OMX_U32)pBuf) & 31;
+ pTmp = ((uintptr_t)pBuf) & 31;
if (pTmp)
pBuf = (OMX_F32*) ((OMX_S8*)pBuf + (32 - pTmp));
diff --git a/dl/sp/src/x86/omxSP_FFTInv_CCSToR_F32_Sfs.c b/dl/sp/src/x86/omxSP_FFTInv_CCSToR_F32_Sfs.c
index 0edc076..d5c3010 100644
--- a/dl/sp/src/x86/omxSP_FFTInv_CCSToR_F32_Sfs.c
+++ b/dl/sp/src/x86/omxSP_FFTInv_CCSToR_F32_Sfs.c
@@ -9,11 +9,13 @@
*
*/
+#include <stdbool.h>
+#include <stdint.h>
+
#include "dl/api/omxtypes.h"
#include "dl/sp/api/omxSP.h"
#include "dl/sp/api/x86SP.h"
#include "dl/sp/src/x86/x86SP_SSE_Math.h"
-#include <stdbool.h>
extern OMX_F32* x86SP_F32_radix2_kernel_OutOfPlace(
const OMX_F32 *src,
@@ -179,7 +181,7 @@
const X86FFTSpec_R_FC32 *pFFTStruct = (const X86FFTSpec_R_FC32*) pFFTSpec;
// Input must be 32 byte aligned
- if (!pSrc || !pDst || (OMX_INT)pSrc & 31 || (OMX_INT)pDst & 31)
+ if (!pSrc || !pDst || (const uintptr_t)pSrc & 31 || (uintptr_t)pDst & 31)
return OMX_Sts_BadArgErr;
n = pFFTStruct->N;
diff --git a/dl/sp/src/x86/x86SP_SSE_Math.h b/dl/sp/src/x86/x86SP_SSE_Math.h
index eb0112c..27f9e5f 100644
--- a/dl/sp/src/x86/x86SP_SSE_Math.h
+++ b/dl/sp/src/x86/x86SP_SSE_Math.h
@@ -36,7 +36,7 @@
} VC;
/* out = a * b */
-static inline void VC_MUL(VC *out, VC *a, VC *b) {
+static __inline void VC_MUL(VC *out, VC *a, VC *b) {
out->real = _mm_sub_ps(_mm_mul_ps(a->real, b->real),
_mm_mul_ps(a->imag, b->imag));
out->imag = _mm_add_ps(_mm_mul_ps(a->real, b->imag),