summaryrefslogtreecommitdiff
path: root/Build/source/libs/pixman/pixman-src/pixman/pixman-mmx.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/pixman/pixman-src/pixman/pixman-mmx.c')
-rw-r--r--Build/source/libs/pixman/pixman-src/pixman/pixman-mmx.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/Build/source/libs/pixman/pixman-src/pixman/pixman-mmx.c b/Build/source/libs/pixman/pixman-src/pixman/pixman-mmx.c
index dec39743242..d7cf2659dfd 100644
--- a/Build/source/libs/pixman/pixman-src/pixman/pixman-mmx.c
+++ b/Build/source/libs/pixman/pixman-src/pixman/pixman-mmx.c
@@ -387,8 +387,10 @@ in_over (__m64 src, __m64 srca, __m64 mask, __m64 dest)
static force_inline __m64 ldq_u(__m64 *p)
{
#ifdef USE_X86_MMX
- /* x86's alignment restrictions are very relaxed. */
- return *(__m64 *)p;
+ /* x86's alignment restrictions are very relaxed, but that's no excuse */
+ __m64 r;
+ memcpy(&r, p, sizeof(__m64));
+ return r;
#elif defined USE_ARM_IWMMXT
int align = (uintptr_t)p & 7;
__m64 *aligned_p;
@@ -407,7 +409,9 @@ static force_inline uint32_t ldl_u(const uint32_t *p)
{
#ifdef USE_X86_MMX
/* x86's alignment restrictions are very relaxed. */
- return *p;
+ uint32_t r;
+ memcpy(&r, p, sizeof(uint32_t));
+ return r;
#else
struct __una_u32 { uint32_t x __attribute__((packed)); };
const struct __una_u32 *ptr = (const struct __una_u32 *) p;
@@ -3950,7 +3954,7 @@ mmx_fetch_a8 (pixman_iter_t *iter, const uint32_t *mask)
while (w && (((uintptr_t)dst) & 15))
{
- *dst++ = *(src++) << 24;
+ *dst++ = (uint32_t)*(src++) << 24;
w--;
}
@@ -3977,7 +3981,7 @@ mmx_fetch_a8 (pixman_iter_t *iter, const uint32_t *mask)
while (w)
{
- *dst++ = *(src++) << 24;
+ *dst++ = (uint32_t)*(src++) << 24;
w--;
}