From 4a9c5ff63b7752b6c4210e6f0748558581aa3845 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Tue, 21 Jul 2020 23:59:05 +0200 Subject: [PATCH] use uint16_t instead of magic ifdefs, leaving support for bit type in there incase we support it some day --- test/val/add2.c | 29 +++++++---------------------- test/val/compare4.c | 20 +++++--------------- test/val/rotate3.c | 19 +++++-------------- test/val/rotate4.c | 19 +++++-------------- test/val/rotate5.c | 19 +++++-------------- test/val/rotate6.c | 19 +++++-------------- test/val/rotate7.c | 19 +++---------------- test/val/sub1.c | 18 ++++++------------ 8 files changed, 41 insertions(+), 121 deletions(-) diff --git a/test/val/add2.c b/test/val/add2.c index 90f0f4175..6fc23e5da 100644 --- a/test/val/add2.c +++ b/test/val/add2.c @@ -6,33 +6,18 @@ #include #include +#include + +/* #define SUPPORT_BIT_TYPES */ unsigned char success=0; unsigned char failures=0; unsigned char dummy=0; -#ifdef SIZEOF_INT_16BIT -#if defined(__LINUX__) || defined(LINUX) -unsigned short aint0 = 0; -unsigned short aint1 = 0; -unsigned short aint2 = 0; -unsigned short aint3 = 0; - -#else -unsigned int aint0 = 0; -unsigned int aint1 = 0; -unsigned int aint2 = 0; -unsigned int aint3 = 0; - -#endif - -#else -unsigned int aint0 = 0; -unsigned int aint1 = 0; -unsigned int aint2 = 0; -unsigned int aint3 = 0; - -#endif +uint16_t aint0 = 0; +uint16_t aint1 = 0; +uint16_t aint2 = 0; +uint16_t aint3 = 0; unsigned char achar0 = 0; unsigned char achar1 = 0; diff --git a/test/val/compare4.c b/test/val/compare4.c index 47948c3a3..8e3baad5d 100644 --- a/test/val/compare4.c +++ b/test/val/compare4.c @@ -6,11 +6,14 @@ #include #include +#include /* compare4.c */ +/*#define SUPPORT_BIT_TYPES */ + /*#define COMPARE_OUT_OF_RANGE 1*/ unsigned char success = 0; @@ -20,22 +23,9 @@ unsigned char dummy = 0; #ifdef SUPPORT_BIT_TYPES bit bit0 = 0; #endif -#ifdef SIZEOF_INT_16BIT -#if defined(__LINUX__) || defined(LINUX) -short int0 = 0; -short int1 = 0; -#else -int int0 = 0; -int int1 = 0; - -#endif - -#else -int int0 = 0; -int int1 = 0; - -#endif +int16_t int0 = 0; +int16_t int1 = 0; signed char char0 = 0; signed char char1 = 0; diff --git a/test/val/rotate3.c b/test/val/rotate3.c index 21b2dc370..8ac2581e9 100644 --- a/test/val/rotate3.c +++ b/test/val/rotate3.c @@ -6,6 +6,9 @@ #include #include +#include + +/* #define SUPPORT_BIT_TYPES */ unsigned char success=0; unsigned char failures=0; @@ -14,22 +17,10 @@ unsigned char dummy=0; #ifdef SUPPORT_BIT_TYPES bit bit0 = 0; #endif -#ifdef SIZEOF_INT_16BIT -#if defined(__LINUX__) || defined(LINUX) -unsigned short aint0 = 0; -unsigned short aint1 = 0; -#else -unsigned int aint0 = 0; -unsigned int aint1 = 0; +uint16_t aint0 = 0; +uint16_t aint1 = 0; -#endif - -#else -unsigned int aint0 = 0; -unsigned int aint1 = 0; - -#endif unsigned char achar0 = 0; unsigned char achar1 = 0; unsigned char achar2 = 0; diff --git a/test/val/rotate4.c b/test/val/rotate4.c index 09b1ebf4c..4b50b0d1c 100644 --- a/test/val/rotate4.c +++ b/test/val/rotate4.c @@ -6,6 +6,9 @@ #include #include +#include + +/* #define SUPPORT_BIT_TYPES */ unsigned char success=0; unsigned char failures=0; @@ -14,22 +17,10 @@ unsigned char dummy=0; #ifdef SUPPORT_BIT_TYPES bit bit0 = 0; #endif -#ifdef SIZEOF_INT_16BIT -#if defined(__LINUX__) || defined(LINUX) -unsigned short aint0 = 0; -unsigned short aint1 = 0; -#else -unsigned int aint0 = 0; -unsigned int aint1 = 0; +uint16_t aint0 = 0; +uint16_t aint1 = 0; -#endif - -#else -unsigned int aint0 = 0; -unsigned int aint1 = 0; - -#endif unsigned char uchar0 = 0; unsigned char uchar1 = 0; unsigned char uchar2 = 0; diff --git a/test/val/rotate5.c b/test/val/rotate5.c index 501e2e567..9de897321 100644 --- a/test/val/rotate5.c +++ b/test/val/rotate5.c @@ -6,6 +6,9 @@ #include #include +#include + +/* #define SUPPORT_BIT_TYPES */ unsigned char success=0; unsigned char failures=0; @@ -14,22 +17,10 @@ unsigned char dummy=0; #ifdef SUPPORT_BIT_TYPES bit bit0 = 0; #endif -#ifdef SIZEOF_INT_16BIT -#if defined(__LINUX__) || defined(LINUX) -signed short aint0 = 0; -signed short aint1 = 0; -#else -signed int aint0 = 0; -signed int aint1 = 0; +int16_t aint0 = 0; +int16_t aint1 = 0; -#endif - -#else -signed int aint0 = 0; -signed int aint1 = 0; - -#endif signed char achar0 = 0; signed char achar1 = 0; signed char achar2 = 0; diff --git a/test/val/rotate6.c b/test/val/rotate6.c index 9109e124e..93a770d99 100644 --- a/test/val/rotate6.c +++ b/test/val/rotate6.c @@ -6,6 +6,9 @@ #include #include +#include + +/* #define SUPPORT_BIT_TYPES */ unsigned char success=0; unsigned char failures=0; @@ -14,22 +17,10 @@ unsigned char dummy=0; #ifdef SUPPORT_BIT_TYPES bit bit0 = 0; #endif -#ifdef SIZEOF_INT_16BIT -#if defined(__LINUX__) || defined(LINUX) -signed short aint0 = 0; -signed short aint1 = 0; -#else -signed int aint0 = 0; -signed int aint1 = 0; +int16_t aint0 = 0; +int16_t aint1 = 0; -#endif - -#else -signed int aint0 = 0; -signed int aint1 = 0; - -#endif signed char achar0 = 0; signed char achar1 = 0; signed char achar2 = 0; diff --git a/test/val/rotate7.c b/test/val/rotate7.c index 2b30b86dd..4a044c16a 100644 --- a/test/val/rotate7.c +++ b/test/val/rotate7.c @@ -6,27 +6,14 @@ #include #include +#include unsigned char success=0; unsigned char failures=0; unsigned char dummy=0; -#ifdef SIZEOF_INT_16BIT -#if defined(__LINUX__) || defined(LINUX) -signed short aint0 = 0; -signed short aint1 = 0; - -#else -signed int aint0 = 0; -signed int aint1 = 0; - -#endif - -#else -signed int aint0 = 0; -signed int aint1 = 0; - -#endif +int16_t aint0 = 0; +int16_t aint1 = 0; /* signed char achar0 = 0; diff --git a/test/val/sub1.c b/test/val/sub1.c index f1ae9394f..5dbba97df 100644 --- a/test/val/sub1.c +++ b/test/val/sub1.c @@ -6,6 +6,10 @@ #include #include +#include + +/* #define SUPPORT_BIT_TYPES */ +/* #define SUPPORT_BIT_ARITHMETIC */ unsigned char success=0; unsigned char failures=0; @@ -28,19 +32,9 @@ bit bit11 = 0; #endif -#ifdef SIZEOF_INT_16BIT -#if defined(__LINUX__) || defined(LINUX) -unsigned short aint0 = 0; -unsigned short aint1 = 0; -#else -unsigned int aint0 = 0; -unsigned int aint1 = 0; -#endif +uint16_t aint0 = 0; +uint16_t aint1 = 0; -#else -unsigned int aint0 = 0; -unsigned int aint1 = 0; -#endif unsigned char achar0 = 0; unsigned char achar1 = 0; unsigned char achar2 = 0;