History

Use 'ptrdiff_t' instead of 'int' for pointer offset parameters

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'.

Jonathan Wright committed 5 years ago

Commit dbda0321 parent 35bce931 file · +8 −6Browse files

Unified · Split

vpx_dsp/arm/mem_neon.h+8−6
@@ -113,7 +113,8 @@ static INLINE void uint32_to_mem(uint8_t *buf, uint32_t a) { · 112 unmodified lines
113113 }
114114
115115 // 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) {
117118 uint32_t a;
118119 uint32x2_t a_u32 = vdup_n_u32(0);
119120 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
126127 }
127128
128129 // 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,
130131 const uint8x8_t a) {
131132 const uint32x2_t a_u32 = vreinterpret_u32_u8(a);
132133 if (stride == 4) {
@@ -139,7 +140,8 @@ static INLINE void store_unaligned_u8(uint8_t *buf, int stride, · 6 unmodified lines
139140 }
140141
141142 // 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) {
143145 uint32_t a;
144146 uint32x4_t a_u32 = vdupq_n_u32(0);
145147 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
159161 }
160162
161163 // 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,
163165 const uint8x16_t a) {
164166 const uint32x4_t a_u32 = vreinterpretq_u32_u8(a);
165167 if (stride == 4) {
@@ -176,7 +178,7 @@ static INLINE void store_unaligned_u8q(uint8_t *buf, int stride, · 10 unmodified lines
176178 }
177179
178180 // 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) {
180182 uint32x2_t a = vdup_n_u32(0);
181183
182184 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
189191 }
190192
191193 // 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) {
193195 uint32x2_t a_u32 = vreinterpret_u32_u8(a);
194196
195197 assert(!((intptr_t)buf % sizeof(uint32_t)));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t