A number of the load/store functions in mem_neon.h use type 'int' for the 'stride' pointer offset parameter. This causes Clang to generate the following warning every time these functions are called with a wider type passed in for 'stride': warning: implicit conversion loses integer precision: 'ptrdiff_t' (aka 'long') to 'int' [-Wshorten-64-to-32] This patch changes all such instances of 'int' to 'ptrdiff_t'.
Unified · Split
| @@ -113,7 +113,8 @@ static INLINE void uint32_to_mem(uint8_t *buf, uint32_t a) { · 112 unmodified lines | |||
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | // Load 2 sets of 4 bytes when alignment is not guaranteed. | 115 | // Load 2 sets of 4 bytes when alignment is not guaranteed. |
| 116 | static INLINE uint8x8_t load_unaligned_u8(const uint8_t *buf, int stride) { | 116 | static INLINE uint8x8_t load_unaligned_u8(const uint8_t *buf, |
| 117 | ptrdiff_t stride) { | ||
| 117 | uint32_t a; | 118 | uint32_t a; |
| 118 | uint32x2_t a_u32 = vdup_n_u32(0); | 119 | uint32x2_t a_u32 = vdup_n_u32(0); |
| 119 | if (stride == 4) return vld1_u8(buf); | 120 | if (stride == 4) return vld1_u8(buf); |
| @@ -126,7 +127,7 @@ static INLINE uint8x8_t load_unaligned_u8(const uint8_t *buf, int stride) { · 6 unmodified lines | |||
| 126 | } | 127 | } |
| 127 | 128 | ||
| 128 | // Store 2 sets of 4 bytes when alignment is not guaranteed. | 129 | // Store 2 sets of 4 bytes when alignment is not guaranteed. |
| 129 | static INLINE void store_unaligned_u8(uint8_t *buf, int stride, | 130 | static INLINE void store_unaligned_u8(uint8_t *buf, ptrdiff_t stride, |
| 130 | const uint8x8_t a) { | 131 | const uint8x8_t a) { |
| 131 | const uint32x2_t a_u32 = vreinterpret_u32_u8(a); | 132 | const uint32x2_t a_u32 = vreinterpret_u32_u8(a); |
| 132 | if (stride == 4) { | 133 | if (stride == 4) { |
| @@ -139,7 +140,8 @@ static INLINE void store_unaligned_u8(uint8_t *buf, int stride, · 6 unmodified lines | |||
| 139 | } | 140 | } |
| 140 | 141 | ||
| 141 | // Load 4 sets of 4 bytes when alignment is not guaranteed. | 142 | // Load 4 sets of 4 bytes when alignment is not guaranteed. |
| 142 | static INLINE uint8x16_t load_unaligned_u8q(const uint8_t *buf, int stride) { | 143 | static INLINE uint8x16_t load_unaligned_u8q(const uint8_t *buf, |
| 144 | ptrdiff_t stride) { | ||
| 143 | uint32_t a; | 145 | uint32_t a; |
| 144 | uint32x4_t a_u32 = vdupq_n_u32(0); | 146 | uint32x4_t a_u32 = vdupq_n_u32(0); |
| 145 | if (stride == 4) return vld1q_u8(buf); | 147 | if (stride == 4) return vld1q_u8(buf); |
| @@ -159,7 +161,7 @@ static INLINE uint8x16_t load_unaligned_u8q(const uint8_t *buf, int stride) { · 13 unmodified lines | |||
| 159 | } | 161 | } |
| 160 | 162 | ||
| 161 | // Store 4 sets of 4 bytes when alignment is not guaranteed. | 163 | // Store 4 sets of 4 bytes when alignment is not guaranteed. |
| 162 | static INLINE void store_unaligned_u8q(uint8_t *buf, int stride, | 164 | static INLINE void store_unaligned_u8q(uint8_t *buf, ptrdiff_t stride, |
| 163 | const uint8x16_t a) { | 165 | const uint8x16_t a) { |
| 164 | const uint32x4_t a_u32 = vreinterpretq_u32_u8(a); | 166 | const uint32x4_t a_u32 = vreinterpretq_u32_u8(a); |
| 165 | if (stride == 4) { | 167 | if (stride == 4) { |
| @@ -176,7 +178,7 @@ static INLINE void store_unaligned_u8q(uint8_t *buf, int stride, · 10 unmodified lines | |||
| 176 | } | 178 | } |
| 177 | 179 | ||
| 178 | // Load 2 sets of 4 bytes when alignment is guaranteed. | 180 | // Load 2 sets of 4 bytes when alignment is guaranteed. |
| 179 | static INLINE uint8x8_t load_u8(const uint8_t *buf, int stride) { | 181 | static INLINE uint8x8_t load_u8(const uint8_t *buf, ptrdiff_t stride) { |
| 180 | uint32x2_t a = vdup_n_u32(0); | 182 | uint32x2_t a = vdup_n_u32(0); |
| 181 | 183 | ||
| 182 | assert(!((intptr_t)buf % sizeof(uint32_t))); | 184 | assert(!((intptr_t)buf % sizeof(uint32_t))); |
| @@ -189,7 +191,7 @@ static INLINE uint8x8_t load_u8(const uint8_t *buf, int stride) { · 6 unmodified lines | |||
| 189 | } | 191 | } |
| 190 | 192 | ||
| 191 | // Store 2 sets of 4 bytes when alignment is guaranteed. | 193 | // Store 2 sets of 4 bytes when alignment is guaranteed. |
| 192 | static INLINE void store_u8(uint8_t *buf, int stride, const uint8x8_t a) { | 194 | static INLINE void store_u8(uint8_t *buf, ptrdiff_t stride, const uint8x8_t a) { |
| 193 | uint32x2_t a_u32 = vreinterpret_u32_u8(a); | 195 | uint32x2_t a_u32 = vreinterpret_u32_u8(a); |
| 194 | 196 | ||
| 195 | assert(!((intptr_t)buf % sizeof(uint32_t))); | 197 | assert(!((intptr_t)buf % sizeof(uint32_t))); |