Commit 6265dd82 authored by bbguimaraes's avatar bbguimaraes
Browse files

hcwocl: use `uintptr_t` for pointer conversions

parent 026f9321
......@@ -163,7 +163,8 @@ struct SortData
template<typename T>
T* addByteOffset(void* baseAddr, u32 offset)
{
return (T*)(((u32)baseAddr)+offset);
return static_cast<T*>(
static_cast<void*>(static_cast<char*>(baseAddr) + offset));
}
......
/*
2011 Takahiro Harada
*/
//#define CHECK_ALIGNMENT(a) CLASSERT((u32(&(a)) & 0xf) == 0);
#define CHECK_ALIGNMENT(a) a;
#include <cstdint>
#define CHECK_ALIGNMENT(a) \
CLASSERT(!reinterpret_cast<std::uintptr_t>(&(a)) & 0xf)
__inline
float4 make_float4(float x, float y, float z, float w = 0.f)
......@@ -81,7 +82,7 @@ float4 operator-(const float4& a)
__inline
float4 operator*(const float4& a, const float4& b)
{
CLASSERT((u32(&a) & 0xf) == 0);
CLASSERT((reinterpret_cast<std::uintptr_t>(&a) & 0xf) == 0);
float4 out;
out.s[0] = a.s[0]*b.s[0];
......@@ -168,7 +169,7 @@ void operator/=(float4& a, const float4& b)
__inline
void operator/=(float4& a, float b)
{
CLASSERT((u32(&a) & 0xf) == 0);
CLASSERT((reinterpret_cast<std::uintptr_t>(&a) & 0xf) == 0);
a.s[0]/=b;
a.s[1]/=b;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment