]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
config: remove the check for and use of SIZEOF_SHORT
authorDaniel Stenberg <daniel@haxx.se>
Thu, 11 Aug 2022 07:07:06 +0000 (09:07 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 11 Aug 2022 07:07:06 +0000 (09:07 +0200)
shorts are 2 bytes on all platforms curl runs and have ever run on.

Closes #9291

12 files changed:
CMakeLists.txt
configure.ac
lib/config-amigaos.h
lib/config-dos.h
lib/config-mac.h
lib/config-os400.h
lib/config-plan9.h
lib/config-riscos.h
lib/config-win32.h
lib/config-win32ce.h
lib/curl_config.h.cmake
tests/libtest/lib557.c

index fce08996a1741fd4639386cdd2a970616a4712dd..06a0a8558c1915c4508d46f0683c5b0135427d5d 100644 (file)
@@ -1003,7 +1003,6 @@ check_type_size(size_t  SIZEOF_SIZE_T)
 check_type_size(ssize_t  SIZEOF_SSIZE_T)
 check_type_size("long long"  SIZEOF_LONG_LONG)
 check_type_size("long"  SIZEOF_LONG)
-check_type_size("short"  SIZEOF_SHORT)
 check_type_size("int"  SIZEOF_INT)
 check_type_size("__int64"  SIZEOF___INT64)
 check_type_size("time_t"  SIZEOF_TIME_T)
index 44bf42b9d7e1577e2938c70237ce2c523ffa5431..981bb26a40766b619a7a67328fa99f91cf8d3caa 100644 (file)
@@ -3293,7 +3293,6 @@ CURL_VERIFY_RUNTIMELIBS
 CURL_SIZEOF(size_t)
 CURL_SIZEOF(long)
 CURL_SIZEOF(int)
-CURL_SIZEOF(short)
 CURL_SIZEOF(time_t)
 CURL_SIZEOF(off_t)
 
index 1615a1c53b69dc472ef45b563268dff855a69878..409dd787013ab05117fb4e8891551a7f4a2d1f66 100644 (file)
@@ -71,7 +71,6 @@
 #define NEED_MALLOC_H 1
 
 #define SIZEOF_INT 4
-#define SIZEOF_SHORT 2
 #define SIZEOF_SIZE_T 4
 
 #define USE_MANUAL 1
index 2aadc4172c30e1adff5ed2b4e4342dbc2d018654..859dc387a1a80f8617bbb84f337fbc9e01b47bb4 100644 (file)
@@ -80,7 +80,6 @@
 
 #define SIZEOF_INT             4
 #define SIZEOF_LONG            4
-#define SIZEOF_SHORT           2
 #define SIZEOF_SIZE_T          4
 #define SIZEOF_CURL_OFF_T      4
 #define STDC_HEADERS           1
index 4928866b15cd2123de43c2aff21d5071152c00b9..ed07019e6bfe3f022ad279b4945a125ec5486f3e 100644 (file)
@@ -76,7 +76,6 @@
 #define HAVE_IOCTL_FIONBIO      1
 
 #define SIZEOF_INT              4
-#define SIZEOF_SHORT            2
 #define SIZEOF_SIZE_T           4
 
 #define HAVE_RECV 1
index 205432fad69e97ffedc2b0fc1345f61299a7350d..2eef1a0c1b8029dd0d4875da1f74e5463c6da539 100644 (file)
 /* The size of a `long long', as computed by sizeof. */
 #define SIZEOF_LONG_LONG        8
 
-/* The size of `short', as computed by sizeof. */
-#define SIZEOF_SHORT            2
-
 /* The size of `long', as computed by sizeof. */
 #define SIZEOF_LONG             4
 
index 4e4a4bd30265b5ebb5a4a56c2b63c98bfc3d14b6..b9b7b964308252d018797000926064854d032255 100644 (file)
@@ -48,7 +48,6 @@
 #error not implement
 #else
 #define SIZEOF_INT 4
-#define SIZEOF_SHORT 2
 #define SIZEOF_LONG 4
 #define SIZEOF_OFF_T 8
 #define SIZEOF_CURL_OFF_T 4 /* curl_off_t = timediff_t = int */
index 71a67b0e16b58d5d30a18113e23c51b8918c3aa1..d6c81f3eb952852daea2fd647df6748a51058024 100644 (file)
 /* The size of `long long', as computed by sizeof. */
 #undef SIZEOF_LONG_LONG
 
-/* The size of `short', as computed by sizeof. */
-#define SIZEOF_SHORT 2
-
 /* The size of `size_t', as computed by sizeof. */
 #define SIZEOF_SIZE_T 4
 
index 83484ddbede8df2c44849a141a86df964af3256a..0ac529d25017dc1537e78df9a97eea0b6e4e7a35 100644 (file)
 /* Define to the size of `long long', as computed by sizeof. */
 /* #define SIZEOF_LONG_LONG 8 */
 
-/* Define to the size of `short', as computed by sizeof. */
-#define SIZEOF_SHORT 2
-
 /* Define to the size of `long', as computed by sizeof. */
 #define SIZEOF_LONG 4
 
index ede63c94dbd69b4fb9d92d0b6e72d6aafcf92001..308bfe9e0aca3e85e8822559bea24c8bbd079651 100644 (file)
 /* The size of `long long', as computed by sizeof. */
 /* #define SIZEOF_LONG_LONG 8 */
 
-/* The size of `short', as computed by sizeof. */
-#define SIZEOF_SHORT 2
-
 /* Define to the size of `long', as computed by sizeof. */
 #define SIZEOF_LONG 4
 
index 8cf1da600e3d41daae4d6027202761b307337724..d1ea23f51cf34196a833f3948ec4fa49e24aceb3 100644 (file)
 /* The size of `int', as computed by sizeof. */
 ${SIZEOF_INT_CODE}
 
-/* The size of `short', as computed by sizeof. */
-${SIZEOF_SHORT_CODE}
-
 /* The size of `long', as computed by sizeof. */
 ${SIZEOF_LONG_CODE}
 
index d9f5c4e63bd20b731475ef501faa9815ab6b6305..578ab713b3ddb2b648247f211ca1668eda23fee6 100644 (file)
@@ -127,25 +127,6 @@ static int test_unsigned_short_formatting(void)
   int num_ushort_tests = 0;
   int failed = 0;
 
-#if (SIZEOF_SHORT == 1)
-
-  i = 1; us_test[i].num = 0xFFU; us_test[i].expected = "256";
-  i++; us_test[i].num = 0xF0U; us_test[i].expected = "240";
-  i++; us_test[i].num = 0x0FU; us_test[i].expected = "15";
-
-  i++; us_test[i].num = 0xE0U; us_test[i].expected = "224";
-  i++; us_test[i].num = 0x0EU; us_test[i].expected = "14";
-
-  i++; us_test[i].num = 0xC0U; us_test[i].expected = "192";
-  i++; us_test[i].num = 0x0CU; us_test[i].expected = "12";
-
-  i++; us_test[i].num = 0x01U; us_test[i].expected = "1";
-  i++; us_test[i].num = 0x00U; us_test[i].expected = "0";
-
-  num_ushort_tests = i;
-
-#elif (SIZEOF_SHORT == 2)
-
   i = 1; us_test[i].num = 0xFFFFU; us_test[i].expected = "65535";
   i++; us_test[i].num = 0xFF00U; us_test[i].expected = "65280";
   i++; us_test[i].num = 0x00FFU; us_test[i].expected = "255";
@@ -165,42 +146,6 @@ static int test_unsigned_short_formatting(void)
 
   num_ushort_tests = i;
 
-#elif (SIZEOF_SHORT == 4)
-
-  i = 1; us_test[i].num = 0xFFFFFFFFU; us_test[i].expected = "4294967295";
-  i++; us_test[i].num = 0xFFFF0000U; us_test[i].expected = "4294901760";
-  i++; us_test[i].num = 0x0000FFFFU; us_test[i].expected = "65535";
-
-  i++; us_test[i].num = 0xFF000000U; us_test[i].expected = "4278190080";
-  i++; us_test[i].num = 0x00FF0000U; us_test[i].expected = "16711680";
-  i++; us_test[i].num = 0x0000FF00U; us_test[i].expected = "65280";
-  i++; us_test[i].num = 0x000000FFU; us_test[i].expected = "255";
-
-  i++; us_test[i].num = 0xF0000000U; us_test[i].expected = "4026531840";
-  i++; us_test[i].num = 0x0F000000U; us_test[i].expected = "251658240";
-  i++; us_test[i].num = 0x00F00000U; us_test[i].expected = "15728640";
-  i++; us_test[i].num = 0x000F0000U; us_test[i].expected = "983040";
-  i++; us_test[i].num = 0x0000F000U; us_test[i].expected = "61440";
-  i++; us_test[i].num = 0x00000F00U; us_test[i].expected = "3840";
-  i++; us_test[i].num = 0x000000F0U; us_test[i].expected = "240";
-  i++; us_test[i].num = 0x0000000FU; us_test[i].expected = "15";
-
-  i++; us_test[i].num = 0xC0000000U; us_test[i].expected = "3221225472";
-  i++; us_test[i].num = 0x0C000000U; us_test[i].expected = "201326592";
-  i++; us_test[i].num = 0x00C00000U; us_test[i].expected = "12582912";
-  i++; us_test[i].num = 0x000C0000U; us_test[i].expected = "786432";
-  i++; us_test[i].num = 0x0000C000U; us_test[i].expected = "49152";
-  i++; us_test[i].num = 0x00000C00U; us_test[i].expected = "3072";
-  i++; us_test[i].num = 0x000000C0U; us_test[i].expected = "192";
-  i++; us_test[i].num = 0x0000000CU; us_test[i].expected = "12";
-
-  i++; us_test[i].num = 0x00000001U; us_test[i].expected = "1";
-  i++; us_test[i].num = 0x00000000U; us_test[i].expected = "0";
-
-  num_ushort_tests = i;
-
-#endif
-
   for(i = 1; i <= num_ushort_tests; i++) {
 
     for(j = 0; j<BUFSZ; j++)
@@ -234,33 +179,6 @@ static int test_signed_short_formatting(void)
   int num_sshort_tests = 0;
   int failed = 0;
 
-#if (SIZEOF_SHORT == 1)
-
-  i = 1; ss_test[i].num = 0x7F; ss_test[i].expected = "127";
-
-  i++; ss_test[i].num = 0x70; ss_test[i].expected = "112";
-  i++; ss_test[i].num = 0x07; ss_test[i].expected = "7";
-
-  i++; ss_test[i].num = 0x50; ss_test[i].expected = "80";
-  i++; ss_test[i].num = 0x05; ss_test[i].expected = "5";
-
-  i++; ss_test[i].num = 0x01; ss_test[i].expected = "1";
-  i++; ss_test[i].num = 0x00; ss_test[i].expected = "0";
-
-  i++; ss_test[i].num = -0x7F -1; ss_test[i].expected = "-128";
-
-  i++; ss_test[i].num = -0x70 -1; ss_test[i].expected = "-113";
-  i++; ss_test[i].num = -0x07 -1; ss_test[i].expected = "-8";
-
-  i++; ss_test[i].num = -0x50 -1; ss_test[i].expected = "-81";
-  i++; ss_test[i].num = -0x05 -1; ss_test[i].expected = "-6";
-
-  i++; ss_test[i].num =  0x00 -1; ss_test[i].expected = "-1";
-
-  num_sshort_tests = i;
-
-#elif (SIZEOF_SHORT == 2)
-
   i = 1; ss_test[i].num = 0x7FFF; ss_test[i].expected = "32767";
   i++; ss_test[i].num = 0x7FFE; ss_test[i].expected = "32766";
   i++; ss_test[i].num = 0x7FFD; ss_test[i].expected = "32765";
@@ -302,75 +220,6 @@ static int test_signed_short_formatting(void)
 
   num_sshort_tests = i;
 
-#elif (SIZEOF_SHORT == 4)
-
-  i = 1; ss_test[i].num = 0x7FFFFFFF; ss_test[i].expected = "2147483647";
-  i++; ss_test[i].num = 0x7FFFFFFE; ss_test[i].expected = "2147483646";
-  i++; ss_test[i].num = 0x7FFFFFFD; ss_test[i].expected = "2147483645";
-  i++; ss_test[i].num = 0x7FFF0000; ss_test[i].expected = "2147418112";
-  i++; ss_test[i].num = 0x00007FFF; ss_test[i].expected = "32767";
-
-  i++; ss_test[i].num = 0x7F000000; ss_test[i].expected = "2130706432";
-  i++; ss_test[i].num = 0x007F0000; ss_test[i].expected = "8323072";
-  i++; ss_test[i].num = 0x00007F00; ss_test[i].expected = "32512";
-  i++; ss_test[i].num = 0x0000007F; ss_test[i].expected = "127";
-
-  i++; ss_test[i].num = 0x70000000; ss_test[i].expected = "1879048192";
-  i++; ss_test[i].num = 0x07000000; ss_test[i].expected = "117440512";
-  i++; ss_test[i].num = 0x00700000; ss_test[i].expected = "7340032";
-  i++; ss_test[i].num = 0x00070000; ss_test[i].expected = "458752";
-  i++; ss_test[i].num = 0x00007000; ss_test[i].expected = "28672";
-  i++; ss_test[i].num = 0x00000700; ss_test[i].expected = "1792";
-  i++; ss_test[i].num = 0x00000070; ss_test[i].expected = "112";
-  i++; ss_test[i].num = 0x00000007; ss_test[i].expected = "7";
-
-  i++; ss_test[i].num = 0x50000000; ss_test[i].expected = "1342177280";
-  i++; ss_test[i].num = 0x05000000; ss_test[i].expected = "83886080";
-  i++; ss_test[i].num = 0x00500000; ss_test[i].expected = "5242880";
-  i++; ss_test[i].num = 0x00050000; ss_test[i].expected = "327680";
-  i++; ss_test[i].num = 0x00005000; ss_test[i].expected = "20480";
-  i++; ss_test[i].num = 0x00000500; ss_test[i].expected = "1280";
-  i++; ss_test[i].num = 0x00000050; ss_test[i].expected = "80";
-  i++; ss_test[i].num = 0x00000005; ss_test[i].expected = "5";
-
-  i++; ss_test[i].num = 0x00000001; ss_test[i].expected = "1";
-  i++; ss_test[i].num = 0x00000000; ss_test[i].expected = "0";
-
-  i++; ss_test[i].num = -0x7FFFFFFF -1; ss_test[i].expected = "-2147483648";
-  i++; ss_test[i].num = -0x7FFFFFFE -1; ss_test[i].expected = "-2147483647";
-  i++; ss_test[i].num = -0x7FFFFFFD -1; ss_test[i].expected = "-2147483646";
-  i++; ss_test[i].num = -0x7FFF0000 -1; ss_test[i].expected = "-2147418113";
-  i++; ss_test[i].num = -0x00007FFF -1; ss_test[i].expected = "-32768";
-
-  i++; ss_test[i].num = -0x7F000000 -1; ss_test[i].expected = "-2130706433";
-  i++; ss_test[i].num = -0x007F0000 -1; ss_test[i].expected = "-8323073";
-  i++; ss_test[i].num = -0x00007F00 -1; ss_test[i].expected = "-32513";
-  i++; ss_test[i].num = -0x0000007F -1; ss_test[i].expected = "-128";
-
-  i++; ss_test[i].num = -0x70000000 -1; ss_test[i].expected = "-1879048193";
-  i++; ss_test[i].num = -0x07000000 -1; ss_test[i].expected = "-117440513";
-  i++; ss_test[i].num = -0x00700000 -1; ss_test[i].expected = "-7340033";
-  i++; ss_test[i].num = -0x00070000 -1; ss_test[i].expected = "-458753";
-  i++; ss_test[i].num = -0x00007000 -1; ss_test[i].expected = "-28673";
-  i++; ss_test[i].num = -0x00000700 -1; ss_test[i].expected = "-1793";
-  i++; ss_test[i].num = -0x00000070 -1; ss_test[i].expected = "-113";
-  i++; ss_test[i].num = -0x00000007 -1; ss_test[i].expected = "-8";
-
-  i++; ss_test[i].num = -0x50000000 -1; ss_test[i].expected = "-1342177281";
-  i++; ss_test[i].num = -0x05000000 -1; ss_test[i].expected = "-83886081";
-  i++; ss_test[i].num = -0x00500000 -1; ss_test[i].expected = "-5242881";
-  i++; ss_test[i].num = -0x00050000 -1; ss_test[i].expected = "-327681";
-  i++; ss_test[i].num = -0x00005000 -1; ss_test[i].expected = "-20481";
-  i++; ss_test[i].num = -0x00000500 -1; ss_test[i].expected = "-1281";
-  i++; ss_test[i].num = -0x00000050 -1; ss_test[i].expected = "-81";
-  i++; ss_test[i].num = -0x00000005 -1; ss_test[i].expected = "-6";
-
-  i++; ss_test[i].num =  0x00000000 -1; ss_test[i].expected = "-1";
-
-  num_sshort_tests = i;
-
-#endif
-
   for(i = 1; i <= num_sshort_tests; i++) {
 
     for(j = 0; j<BUFSZ; j++)