diff options
author | Damjan Marion <damarion@cisco.com> | 2018-05-30 09:26:11 +0200 |
---|---|---|
committer | Marco Varlese <marco.varlese@suse.de> | 2018-05-30 10:37:39 +0000 |
commit | ffe9d21b07ce4b607fd9a774df04f9f1f38eb197 (patch) | |
tree | f6f5163ff56d19318bb277f8b0f01cac8359ebe1 /src/vppinfra | |
parent | ed256991f326ce91dd12f6584baf81b2aa5aae4a (diff) |
vppinfra: explicitely state for signed types that they are signed
This fixes some compilation warnings with clang on AArch64.
Change-Id: Idb941944e3f199f483c80e143a9e5163a031c4aa
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra')
-rw-r--r-- | src/vppinfra/macros.c | 4 | ||||
-rw-r--r-- | src/vppinfra/types.h | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/vppinfra/macros.c b/src/vppinfra/macros.c index ce4cc9bc81b..6649277d897 100644 --- a/src/vppinfra/macros.c +++ b/src/vppinfra/macros.c @@ -144,7 +144,7 @@ clib_macro_eval (macro_main_t * mm, i8 * s, i32 complain) /* Look in value table */ if (!varvalue) { - char *tmp = clib_macro_get_value (mm, varname); + i8 *tmp = clib_macro_get_value (mm, (char *) varname); if (tmp) varvalue = (i8 *) format (0, "%s%c", tmp, 0); } @@ -152,7 +152,7 @@ clib_macro_eval (macro_main_t * mm, i8 * s, i32 complain) /* Look in environment. */ if (!varvalue) { - char *tmp = getenv (varname); + char *tmp = getenv ((char *) varname); if (tmp) varvalue = (i8 *) format (0, "%s%c", tmp, 0); } diff --git a/src/vppinfra/types.h b/src/vppinfra/types.h index f87bb48c910..5fd378314f3 100644 --- a/src/vppinfra/types.h +++ b/src/vppinfra/types.h @@ -42,8 +42,8 @@ /* Define signed and unsigned 8, 16, 32, and 64 bit types and machine signed/unsigned word for all architectures. */ -typedef char i8; -typedef short i16; +typedef signed char i8; +typedef signed short i16; /* Avoid conflicts with Linux asm/types.h when __KERNEL__ */ #if defined(CLIB_LINUX_KERNEL) @@ -59,14 +59,14 @@ typedef unsigned short u16; #if defined (__x86_64__) #ifndef __COVERITY__ -typedef int i128 __attribute__ ((mode (TI))); +typedef signed int i128 __attribute__ ((mode (TI))); typedef unsigned int u128 __attribute__ ((mode (TI))); #endif #endif #if (defined(i386) || defined(_mips) || defined(powerpc) || defined (__SPU__) || defined(__sparc__) || defined(__arm__) || defined (__xtensa__) || defined(__TMS320C6X__)) -typedef int i32; -typedef long long i64; +typedef signed int i32; +typedef signed long long i64; #ifndef CLIB_AVOID_CLASH_WITH_LINUX_TYPES typedef unsigned int u32; @@ -78,8 +78,8 @@ typedef unsigned long long u64; #define clib_address_bits _MIPS_SZPTR #elif defined(alpha) || defined(__x86_64__) || defined (__powerpc64__) || defined (__aarch64__) -typedef int i32; -typedef long i64; +typedef signed int i32; +typedef signed long i64; #define log2_uword_bits 6 #define clib_address_bits 64 |