summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoroondas Gupte <hg@boroon.dasgupta.ch>2010-10-24 16:07:43 +0200
committerBoroondas Gupte <hg@boroon.dasgupta.ch>2010-10-24 16:07:43 +0200
commit32b0747e3385c6c44f4c1f5beca063d89006453d (patch)
treed4e286f356b31f3931f7a2455de9b2a8a0c9960c
parentd40db3d8e19fdcc024ca08e901d542bf9c552458 (diff)
parente2049c332b9b834e843249c1ae0ba8542491940f (diff)
CTS-323: (part 2 of 2) Don't cast pointers to U32
-rw-r--r--doc/contributions.txt1
-rw-r--r--indra/llmath/llsimdmath.h6
-rw-r--r--indra/llmath/llvolume.cpp5
3 files changed, 8 insertions, 4 deletions
diff --git a/doc/contributions.txt b/doc/contributions.txt
index 6d93eca14c..8f2bebab07 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -152,6 +152,7 @@ Blakar Ogre
blino Nakamura
VWR-17
Boroondas Gupte
+ CTS-323
SNOW-278
SNOW-503
SNOW-510
diff --git a/indra/llmath/llsimdmath.h b/indra/llmath/llsimdmath.h
index 9377bfdb53..1be1b7a55f 100644
--- a/indra/llmath/llsimdmath.h
+++ b/indra/llmath/llsimdmath.h
@@ -41,16 +41,18 @@
#error SSE2 not enabled. LLVector4a and related class will not compile.
#endif
+#include <stdint.h>
+
template <typename T> T* LL_NEXT_ALIGNED_ADDRESS(T* address)
{
return reinterpret_cast<T*>(
- (reinterpret_cast<U32>(address) + 0xF) & ~0xF);
+ (reinterpret_cast<uintptr_t>(address) + 0xF) & ~0xF);
}
template <typename T> T* LL_NEXT_ALIGNED_ADDRESS_64(T* address)
{
return reinterpret_cast<T*>(
- (reinterpret_cast<U32>(address) + 0x3F) & ~0x3F);
+ (reinterpret_cast<uintptr_t>(address) + 0x3F) & ~0x3F);
}
#if LL_LINUX || LL_DARWIN
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index c73f0e2755..c12c62e8d9 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -35,6 +35,7 @@
#include "llmath.h"
#include <set>
+#include <stdint.h>
#include "llerror.h"
#include "llmemtype.h"
@@ -96,9 +97,9 @@ const S32 SCULPT_MIN_AREA_DETAIL = 1;
extern BOOL gDebugGL;
-void assert_aligned(void* ptr, U32 alignment)
+void assert_aligned(void* ptr, uintptr_t alignment)
{
- U32 t = (U32) ptr;
+ uintptr_t t = (uintptr_t) ptr;
if (t%alignment != 0)
{
llerrs << "WTF?" << llendl;