[dpdk-dev,v3,04/24] lib/librte_eal: explicit tmp cast

Message ID 152609034233.121661.2159751753236335076.stgit@localhost.localdomain (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Andy Green May 12, 2018, 1:59 a.m. UTC
  Signed-off-by: Andy Green <andy@warmcat.com>
---
 .../common/include/arch/x86/rte_memcpy.h           |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Thomas Monjalon May 13, 2018, 4:19 p.m. UTC | #1
12/05/2018 03:59, Andy Green:
> Signed-off-by: Andy Green <andy@warmcat.com>

I know it's boring because there are a lot of things to fix for GCC 8,
but each patch should justify why the change is required, in order to keep
track in the history.
In this case, I think the compiler message would help.
Thanks
  

Patch

diff --git a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
index 5ead68ab2..f9ea0ab69 100644
--- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
+++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
@@ -597,9 +597,9 @@  __extension__ ({
         _mm_storeu_si128((__m128i *)((uint8_t *)dst + 7 * 16), _mm_alignr_epi8(xmm8, xmm7, offset));        \
         dst = (uint8_t *)dst + 128;                                                                         \
     }                                                                                                       \
-    tmp = len;                                                                                              \
+    tmp = (int)len;                                                                                         \
     len = ((len - 16 + offset) & 127) + 16 - offset;                                                        \
-    tmp -= len;                                                                                             \
+    tmp -= (int)len;                                                                                        \
     src = (const uint8_t *)src + tmp;                                                                       \
     dst = (uint8_t *)dst + tmp;                                                                             \
     if (len >= 32 + 16 - offset) {                                                                          \
@@ -613,9 +613,9 @@  __extension__ ({
             _mm_storeu_si128((__m128i *)((uint8_t *)dst + 1 * 16), _mm_alignr_epi8(xmm2, xmm1, offset));    \
             dst = (uint8_t *)dst + 32;                                                                      \
         }                                                                                                   \
-        tmp = len;                                                                                          \
+        tmp = (int)len;                                                                                     \
         len = ((len - 16 + offset) & 31) + 16 - offset;                                                     \
-        tmp -= len;                                                                                         \
+        tmp -= (int)len;                                                                                    \
         src = (const uint8_t *)src + tmp;                                                                   \
         dst = (uint8_t *)dst + tmp;                                                                         \
     }                                                                                                       \