* commit 'eb458905797166ac6385dd5fcc8ed7083c0906fa': android_memset.c: Use sanitized shifts
This commit is contained in:
commit
b622e63c3d
1 changed files with 2 additions and 2 deletions
|
|
@ -49,7 +49,7 @@ void android_memset16(uint16_t* dst, uint16_t value, size_t size)
|
||||||
}
|
}
|
||||||
/* dst is now 32-bit-aligned */
|
/* dst is now 32-bit-aligned */
|
||||||
/* fill body with 32-bit pairs */
|
/* fill body with 32-bit pairs */
|
||||||
uint32_t value32 = (value << 16) | value;
|
uint32_t value32 = (((uint32_t)value) << 16) | ((uint32_t)value);
|
||||||
android_memset32((uint32_t*) dst, value32, size<<1);
|
android_memset32((uint32_t*) dst, value32, size<<1);
|
||||||
if (size & 1) {
|
if (size & 1) {
|
||||||
dst[size-1] = value; /* fill unpaired last elem */
|
dst[size-1] = value; /* fill unpaired last elem */
|
||||||
|
|
@ -76,7 +76,7 @@ void android_memset32(uint32_t* dst, uint32_t value, size_t size)
|
||||||
}
|
}
|
||||||
/* dst is now 64-bit aligned */
|
/* dst is now 64-bit aligned */
|
||||||
/* fill body with 64-bit pairs */
|
/* fill body with 64-bit pairs */
|
||||||
uint64_t value64 = (((uint64_t)value)<<32) | value;
|
uint64_t value64 = (((uint64_t)value) << 32) | ((uint64_t)value);
|
||||||
uint64_t* dst64 = (uint64_t*)dst;
|
uint64_t* dst64 = (uint64_t*)dst;
|
||||||
|
|
||||||
while (size >= 12) {
|
while (size >= 12) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue