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 | 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 | 118 | uint32_t a; |
| 118 | 119 | uint32x2_t a_u32 = vdup_n_u32(0); |
| 119 | 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 | 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 | 131 | const uint8x8_t a) { |
| 131 | 132 | const uint32x2_t a_u32 = vreinterpret_u32_u8(a); |
| 132 | 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 | 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 | 145 | uint32_t a; |
| 144 | 146 | uint32x4_t a_u32 = vdupq_n_u32(0); |
| 145 | 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 | 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 | 165 | const uint8x16_t a) { |
| 164 | 166 | const uint32x4_t a_u32 = vreinterpretq_u32_u8(a); |
| 165 | 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 | 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 | 182 | uint32x2_t a = vdup_n_u32(0); |
| 181 | 183 | |
| 182 | 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 | 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 | 195 | uint32x2_t a_u32 = vreinterpret_u32_u8(a); |
| 194 | 196 | |
| 195 | 197 | assert(!((intptr_t)buf % sizeof(uint32_t))); |