summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kralevich2015-08-27 18:17:22 -0500
committerGerrit Code Review2015-08-27 18:17:22 -0500
commitf4355868cbce0713331bbb04b063515d6de4c795 (patch)
tree0ee4f9e9e7510dfc258d2de34156c4756abd04c6
parent4f8d5b01281e751168718c7b0a74db34352aaf1e (diff)
parentc348a88376c1bfbb86ca47eeca9b253558e6c926 (diff)
downloadplatform-system-core-f4355868cbce0713331bbb04b063515d6de4c795.tar.gz
platform-system-core-f4355868cbce0713331bbb04b063515d6de4c795.tar.xz
platform-system-core-f4355868cbce0713331bbb04b063515d6de4c795.zip
Merge "android_memset.c: Use sanitized shifts"
-rw-r--r--libcutils/arch-mips/android_memset.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcutils/arch-mips/android_memset.c b/libcutils/arch-mips/android_memset.c
index 4164c2a45..c0fe3d1e6 100644
--- a/libcutils/arch-mips/android_memset.c
+++ b/libcutils/arch-mips/android_memset.c
@@ -49,7 +49,7 @@ void android_memset16(uint16_t* dst, uint16_t value, size_t size)
49 } 49 }
50 /* dst is now 32-bit-aligned */ 50 /* dst is now 32-bit-aligned */
51 /* fill body with 32-bit pairs */ 51 /* fill body with 32-bit pairs */
52 uint32_t value32 = (value << 16) | value; 52 uint32_t value32 = (((uint32_t)value) << 16) | ((uint32_t)value);
53 android_memset32((uint32_t*) dst, value32, size<<1); 53 android_memset32((uint32_t*) dst, value32, size<<1);
54 if (size & 1) { 54 if (size & 1) {
55 dst[size-1] = value; /* fill unpaired last elem */ 55 dst[size-1] = value; /* fill unpaired last elem */
@@ -76,7 +76,7 @@ void android_memset32(uint32_t* dst, uint32_t value, size_t size)
76 } 76 }
77 /* dst is now 64-bit aligned */ 77 /* dst is now 64-bit aligned */
78 /* fill body with 64-bit pairs */ 78 /* fill body with 64-bit pairs */
79 uint64_t value64 = (((uint64_t)value)<<32) | value; 79 uint64_t value64 = (((uint64_t)value) << 32) | ((uint64_t)value);
80 uint64_t* dst64 = (uint64_t*)dst; 80 uint64_t* dst64 = (uint64_t*)dst;
81 81
82 while (size >= 12) { 82 while (size >= 12) {