From 3ed1526afe849e0eea5561af360255e490161a5a Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Mon, 1 Feb 2021 19:48:10 +0100 Subject: [PATCH] Remove some unused configuration macros. * Don't test stack direction. * Don't test endianness of chars. * Assume HAVE_LONGLONG. --- CMakeLists.txt | 9 ++------- autoconf/intparam.c | 30 ------------------------------ include/cln/intparam.h.cmake | 3 --- m4/intparam.m4 | 11 ----------- 4 files changed, 2 insertions(+), 51 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d2c176f..3db9926 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,13 +91,10 @@ if (GMP_FOUND) endif(GMP_FOUND) -check_type_size("long long" LONGLONG) -if (HAVE_LONGLONG) - set(SIZEOF_LONGLONG ${LONGLONG}) -endif() check_type_size("short" SIZEOF_SHORT) check_type_size("int" SIZEOF_INT) check_type_size("long" SIZEOF_LONG) +check_type_size("long long" SIZEOF_LONGLONG) check_type_size("void *" SIZEOF_VOIDP) check_type_align("void *" ALIGNOF_VOIDP) @@ -107,10 +104,8 @@ math(EXPR x "${SIZEOF_SHORT} * ${cl_char_bitsize}") set(cl_short_bitsize ${x} CACHE INTERNAL "short_bitsize") math(EXPR cl_int_bitsize "${SIZEOF_INT} * ${cl_char_bitsize}") math(EXPR cl_long_bitsize "${SIZEOF_LONG} * ${cl_char_bitsize}") +math(EXPR cl_long_long_bitsize "${SIZEOF_LONGLONG} * ${cl_char_bitsize}") math(EXPR cl_pointer_bitsize "${SIZEOF_VOIDP} * ${cl_char_bitsize}") -if (HAVE_LONGLONG) - math(EXPR cl_long_long_bitsize "${SIZEOF_LONGLONG} * ${cl_char_bitsize}") -endif() check_include_file("unistd.h" HAVE_UNISTD_H) diff --git a/autoconf/intparam.c b/autoconf/intparam.c index 66cce71..d086f88 100644 --- a/autoconf/intparam.c +++ b/autoconf/intparam.c @@ -502,7 +502,6 @@ void main9(void) { else \ { printf("#error \"Endianness makes no sense for type %s !!\"\n",typestr); } \ } - get_endian(uchar,"unsigned char",uchar_bitsize); get_endian(ushort,"unsigned short",ushort_bitsize); get_endian(uint,"unsigned int",uint_bitsize); get_endian(ulong,"unsigned long",ulong_bitsize); @@ -510,34 +509,6 @@ void main9(void) { printf("\n"); } -long get_stack_direction(void) - { char dummy; - static char* dummyaddr = (char*)0; - if (!(dummyaddr == (char*)0)) - { return (&dummy) - dummyaddr; } - else - { dummyaddr = &dummy; - { long result = get_stack_direction(); - /* The next assignment avoids tail recursion elimination (IRIX 6.4 CC). */ - dummyaddr = (char*)0; - return result; - } } - } - -void main10(void) - { long stack_direction = get_stack_direction(); - if (stack_direction > 0) - { printf("/* Stack grows up, ca. %ld bytes per function call. */\n",(long)stack_direction); - printf("#define stack_grows_up\n"); - } - else if (stack_direction < 0) - { printf("/* Stack grows down, ca. %ld bytes per function call. */\n",-(long)stack_direction); - printf("#define stack_grows_down\n"); - } - else - printf("#error \"Unknown stack model -- incorrect C semantics!!\"\n"); - } - int main(int argc, char *argv[]) { if (freopen(argc==1 ? "conftest.h" : argv[1], "w", stdout) == NULL) return 1; main1(); @@ -549,7 +520,6 @@ int main(int argc, char *argv[]) main7(); main8(); main9(); - main10(); if (ferror(stdout) || fclose(stdout)) return 1; return 0; } diff --git a/include/cln/intparam.h.cmake b/include/cln/intparam.h.cmake index cea812b..262e52e 100644 --- a/include/cln/intparam.h.cmake +++ b/include/cln/intparam.h.cmake @@ -2,11 +2,8 @@ #define short_bitsize @cl_short_bitsize@ #define int_bitsize @cl_int_bitsize@ #define long_bitsize @cl_long_bitsize@ -// #ifdef HAVE_LONGLONG #define long_long_bitsize @cl_long_long_bitsize@ -// #endif #define pointer_bitsize @cl_pointer_bitsize@ -#define stack_grows_down #cmakedefine short_little_endian #cmakedefine int_little_endian #cmakedefine long_little_endian diff --git a/m4/intparam.m4 b/m4/intparam.m4 index 2619013..5d7d00f 100644 --- a/m4/intparam.m4 +++ b/m4/intparam.m4 @@ -222,17 +222,6 @@ AC_DEFUN([CL_INTPARAM_CROSS], echo "#error \"Type long long is stored in memory in an obscure manner!!\"" ;; esac - echo - case $host_cpu in - hppa) - echo "/* Stack grows up. */" - echo "#define stack_grows_up" - ;; - *) - echo "/* Stack grows down. */" - echo "#define stack_grows_down" - ;; - esac } > "$cl_machine_file_h" ]) -- 2.46.1