]> granicus.if.org Git - graphviz/commitdiff
Removed all _ast_int and _ast_flt defines
authorErwin Janssen <erwinjanssen@outlook.com>
Fri, 9 Dec 2016 15:07:50 +0000 (16:07 +0100)
committerErwin Janssen <erwinjanssen@outlook.com>
Wed, 21 Dec 2016 13:54:24 +0000 (14:54 +0100)
The defines _ast_int and _ast_flt used to be generated, but were now defined
in ast_common.h. Most of these defines were not used either, only _ast_intmax_t
and _ast_fltmax_t were used to define another define in sfio.h. Instead, we now
directly use the values `long long` and `long double` to set the defines in
sfio.h and we can safely remove the _ast_int and _ast_flt defines.

ast_common.h.in
features/common
lib/sfio/features/common
lib/sfio/sfio.h
lib/vmalloc/features/common
windows/include/ast_common.h

index d07350051700a825810fc82d818fe8bbb58e6d46..97d3d82168829731f1ead28cb8befa0c29c2c968 100644 (file)
 typedef int ssize_t;
 #endif
 
-/* FIXME - need proper configure tests for these */
-#define _ast_int1_t             char
-#define _ast_int2_t             short
-#define _ast_int4_t             int
-#define _ast_int8_t             long long
-#define _ast_intmax_t           _ast_int8_t
-#define _ast_intswap            7
-
-#define _ast_flt4_t             float
-#define _ast_flt8_t             double
-#define _ast_flt12_t            long double
-#define _ast_fltmax_t           _ast_flt12_t
-/* */
-
 #ifndef va_listref
 #define va_listref(p) (p)      /* pass va_list to varargs function */
 #define va_listval(p) (p)      /* retrieve va_list from va_arg(ap,va_listarg) */
index 8c6446c921a24b8bc29baf3561bb8ecf5dac6047..5221b6c7f084954344769aefeaf026898d25d623 100644 (file)
@@ -106,144 +106,6 @@ cat{
        #endif
 }end
 
-tst    - -DN=0 - -DN=1 - -DN=2 - -DN=3 - -DN=4 - -DN=5 - -DN=6 - -DN=7 - -DN=8 output{
-       #define _BYTESEX_H
-
-       #if _STD_
-       #include        <stddef.h>
-       #else
-       #include        <sys/types.h>
-       #endif
-
-       _BEGIN_EXTERNS_
-       extern int      printf(const char*, ...);
-       _END_EXTERNS_
-       
-       #if N == 0
-       #define _ast_int8_t     long
-       #define _ast_int8_str   "long"
-       #endif
-       #if N == 1
-       #define _ast_int8_t     long long
-       #define _ast_int8_str   "long long"
-       #endif
-       #if N == 2
-       #define _ast_int8_t     __int64_t
-       #define _ast_int8_str   "__int64_t"
-       #endif
-       #if N == 3
-       #define _ast_int8_t     _int64_t
-       #define _ast_int8_str   "_int64_t"
-       #endif
-       #if N == 4
-       #define _ast_int8_t     int64_t
-       #define _ast_int8_str   "int64_t"
-       #endif
-       #if N == 5
-       #define _ast_int8_t     __int64
-       #define _ast_int8_str   "__int64"
-       #endif
-       #if N == 6
-       #define _ast_int8_t     _int64
-       #define _ast_int8_str   "_int64"
-       #endif
-       #if N == 7
-       #define _ast_int8_t     int64
-       #define _ast_int8_str   "int64"
-       #endif
-
-       #define elementsof(x)   (sizeof(x)/sizeof(x[0]))
-       
-       static char             i_char = 1;
-       static short            i_short = 1;
-       static int              i_int = 1;
-       static long             i_long = 1;
-       #ifdef _ast_int8_t
-       static _ast_int8_t      i_long_long = 1;
-       #endif
-       
-       static struct
-       {
-               char*   name;
-               int     size;
-               char*   swap;
-       } int_type[] = 
-       {
-               "char",         sizeof(char),           (char*)&i_char,
-               "short",        sizeof(short),          (char*)&i_short,
-               "int",          sizeof(int),            (char*)&i_int,
-               "long",         sizeof(long),           (char*)&i_long,
-       #ifdef _ast_int8_t
-               _ast_int8_str,  sizeof(_ast_int8_t),    (char*)&i_long_long,
-       #endif
-       };
-       
-       static struct
-       {
-               char*   name;
-               int     size;
-       } flt_type[] = 
-       {
-               "float",        sizeof(float),
-               "double",       sizeof(double),
-       #ifdef _typ_long_double
-               "long double",  sizeof(long double),
-       #endif
-       };
-       
-       static int      int_size[] = { 1, 2, 4, 8 };
-       
-       main()
-       {
-               register int    t;
-               register int    s;
-               register int    m = 1;
-               register int    b = 1;
-               register int    w = 0;
-       
-       #ifdef _ast_int8_t
-               if (int_type[elementsof(int_type)-1].size <= 4)
-                       return 1;
-       #endif
-               for (s = 0; s < elementsof(int_size); s++)
-               {
-                       for (t = 0; t < elementsof(int_type); t++)
-                               if(int_type[t].size >= int_size[s])
-                                       break;
-                       if (t < elementsof(int_type))
-                       {
-                               m = int_size[s];
-                               printf("#define _ast_int%d_t\t\t%s\n",
-                                       m, int_type[t].name);
-                               if (m > 1)
-                               {
-                                       if (*int_type[t].swap)
-                                               w |= b;
-                                       b <<= 1;
-                               }
-                       }
-               }
-               printf("#define _ast_intmax_t           _ast_int%d_t\n", m);
-               if (m == sizeof(long))
-                       printf("#define _ast_intmax_long                1\n");
-               printf("#define _ast_intswap            %d\n", w);
-               printf("\n");
-               for (t = 0; t < elementsof(flt_type); t++)
-               {
-                       for(; t < elementsof(flt_type); t++)
-                               if(flt_type[t].size != flt_type[t + 1].size)
-                                       break;
-                       m = flt_type[t].size;
-                       printf("#define _ast_flt%d_t\t\t%s\n",
-                               flt_type[t].size, flt_type[t].name);
-               }
-               printf("#define _ast_fltmax_t           _ast_flt%d_t\n", m);
-               if (m == sizeof(double))
-                       printf("#define _ast_fltmax_double              1\n");
-               return 0;
-       }
-}end
-
 tst - -DTRY=1 - -DTRY=1 -Dvoid=char - -DTRY=2 - -DTRY=3 - -DTRY=4 output{
        #define printf  ______printf
        #ifdef __STDC__
index 72c0d80cfa3af3929b9ab96725321137c7fb9376..0d9ba75dde516b3e8c40fa21448c004c80c38518 100644 (file)
@@ -106,144 +106,6 @@ cat{
        #endif
 }end
 
-tst    - -DN=0 - -DN=1 - -DN=2 - -DN=3 - -DN=4 - -DN=5 - -DN=6 - -DN=7 - -DN=8 output{
-       #define _BYTESEX_H
-
-       #if _STD_
-       #include        <stddef.h>
-       #else
-       #include        <sys/types.h>
-       #endif
-
-       _BEGIN_EXTERNS_
-       extern int      printf(const char*, ...);
-       _END_EXTERNS_
-       
-       #if N == 0
-       #define _ast_int8_t     long
-       #define _ast_int8_str   "long"
-       #endif
-       #if N == 1
-       #define _ast_int8_t     long long
-       #define _ast_int8_str   "long long"
-       #endif
-       #if N == 2
-       #define _ast_int8_t     __int64_t
-       #define _ast_int8_str   "__int64_t"
-       #endif
-       #if N == 3
-       #define _ast_int8_t     _int64_t
-       #define _ast_int8_str   "_int64_t"
-       #endif
-       #if N == 4
-       #define _ast_int8_t     int64_t
-       #define _ast_int8_str   "int64_t"
-       #endif
-       #if N == 5
-       #define _ast_int8_t     __int64
-       #define _ast_int8_str   "__int64"
-       #endif
-       #if N == 6
-       #define _ast_int8_t     _int64
-       #define _ast_int8_str   "_int64"
-       #endif
-       #if N == 7
-       #define _ast_int8_t     int64
-       #define _ast_int8_str   "int64"
-       #endif
-
-       #define elementsof(x)   (sizeof(x)/sizeof(x[0]))
-       
-       static char             i_char = 1;
-       static short            i_short = 1;
-       static int              i_int = 1;
-       static long             i_long = 1;
-       #ifdef _ast_int8_t
-       static _ast_int8_t      i_long_long = 1;
-       #endif
-       
-       static struct
-       {
-               char*   name;
-               int     size;
-               char*   swap;
-       } int_type[] = 
-       {
-               "char",         sizeof(char),           (char*)&i_char,
-               "short",        sizeof(short),          (char*)&i_short,
-               "int",          sizeof(int),            (char*)&i_int,
-               "long",         sizeof(long),           (char*)&i_long,
-       #ifdef _ast_int8_t
-               _ast_int8_str,  sizeof(_ast_int8_t),    (char*)&i_long_long,
-       #endif
-       };
-       
-       static struct
-       {
-               char*   name;
-               int     size;
-       } flt_type[] = 
-       {
-               "float",        sizeof(float),
-               "double",       sizeof(double),
-       #ifdef _typ_long_double
-               "long double",  sizeof(long double),
-       #endif
-       };
-       
-       static int      int_size[] = { 1, 2, 4, 8 };
-       
-       main()
-       {
-               register int    t;
-               register int    s;
-               register int    m = 1;
-               register int    b = 1;
-               register int    w = 0;
-       
-       #ifdef _ast_int8_t
-               if (int_type[elementsof(int_type)-1].size <= 4)
-                       return 1;
-       #endif
-               for (s = 0; s < elementsof(int_size); s++)
-               {
-                       for (t = 0; t < elementsof(int_type); t++)
-                               if(int_type[t].size >= int_size[s])
-                                       break;
-                       if (t < elementsof(int_type))
-                       {
-                               m = int_size[s];
-                               printf("#define _ast_int%d_t\t\t%s\n",
-                                       m, int_type[t].name);
-                               if (m > 1)
-                               {
-                                       if (*int_type[t].swap)
-                                               w |= b;
-                                       b <<= 1;
-                               }
-                       }
-               }
-               printf("#define _ast_intmax_t           _ast_int%d_t\n", m);
-               if (m == sizeof(long))
-                       printf("#define _ast_intmax_long                1\n");
-               printf("#define _ast_intswap            %d\n", w);
-               printf("\n");
-               for (t = 0; t < elementsof(flt_type); t++)
-               {
-                       for(; t < elementsof(flt_type); t++)
-                               if(flt_type[t].size != flt_type[t + 1].size)
-                                       break;
-                       m = flt_type[t].size;
-                       printf("#define _ast_flt%d_t\t\t%s\n",
-                               flt_type[t].size, flt_type[t].name);
-               }
-               printf("#define _ast_fltmax_t           _ast_flt%d_t\n", m);
-               if (m == sizeof(double))
-                       printf("#define _ast_fltmax_double              1\n");
-               return 0;
-       }
-}end
-
 tst - -DTRY=1 - -DTRY=1 -Dvoid=char - -DTRY=2 - -DTRY=3 - -DTRY=4 output{
        #define printf  ______printf
        #ifdef __STDC__
index 70e6059a1ff275ec82bd579833b62ab107d827a3..acd512f00d3d838ae9c35846668cd029d1d68057 100644 (file)
@@ -93,10 +93,10 @@ extern "C" {
 /* Sfoff_t should be large enough for largest file address */
 
 
-#define Sfoff_t                _ast_intmax_t
-#define Sflong_t       _ast_intmax_t
-#define Sfulong_t      unsigned _ast_intmax_t
-#define Sfdouble_t     _ast_fltmax_t
+#define Sfoff_t                long long
+#define Sflong_t       long long
+#define Sfulong_t      unsigned long long
+#define Sfdouble_t     long double
 
        typedef struct _sfio_s Sfio_t;
 
index 72c0d80cfa3af3929b9ab96725321137c7fb9376..0d9ba75dde516b3e8c40fa21448c004c80c38518 100644 (file)
@@ -106,144 +106,6 @@ cat{
        #endif
 }end
 
-tst    - -DN=0 - -DN=1 - -DN=2 - -DN=3 - -DN=4 - -DN=5 - -DN=6 - -DN=7 - -DN=8 output{
-       #define _BYTESEX_H
-
-       #if _STD_
-       #include        <stddef.h>
-       #else
-       #include        <sys/types.h>
-       #endif
-
-       _BEGIN_EXTERNS_
-       extern int      printf(const char*, ...);
-       _END_EXTERNS_
-       
-       #if N == 0
-       #define _ast_int8_t     long
-       #define _ast_int8_str   "long"
-       #endif
-       #if N == 1
-       #define _ast_int8_t     long long
-       #define _ast_int8_str   "long long"
-       #endif
-       #if N == 2
-       #define _ast_int8_t     __int64_t
-       #define _ast_int8_str   "__int64_t"
-       #endif
-       #if N == 3
-       #define _ast_int8_t     _int64_t
-       #define _ast_int8_str   "_int64_t"
-       #endif
-       #if N == 4
-       #define _ast_int8_t     int64_t
-       #define _ast_int8_str   "int64_t"
-       #endif
-       #if N == 5
-       #define _ast_int8_t     __int64
-       #define _ast_int8_str   "__int64"
-       #endif
-       #if N == 6
-       #define _ast_int8_t     _int64
-       #define _ast_int8_str   "_int64"
-       #endif
-       #if N == 7
-       #define _ast_int8_t     int64
-       #define _ast_int8_str   "int64"
-       #endif
-
-       #define elementsof(x)   (sizeof(x)/sizeof(x[0]))
-       
-       static char             i_char = 1;
-       static short            i_short = 1;
-       static int              i_int = 1;
-       static long             i_long = 1;
-       #ifdef _ast_int8_t
-       static _ast_int8_t      i_long_long = 1;
-       #endif
-       
-       static struct
-       {
-               char*   name;
-               int     size;
-               char*   swap;
-       } int_type[] = 
-       {
-               "char",         sizeof(char),           (char*)&i_char,
-               "short",        sizeof(short),          (char*)&i_short,
-               "int",          sizeof(int),            (char*)&i_int,
-               "long",         sizeof(long),           (char*)&i_long,
-       #ifdef _ast_int8_t
-               _ast_int8_str,  sizeof(_ast_int8_t),    (char*)&i_long_long,
-       #endif
-       };
-       
-       static struct
-       {
-               char*   name;
-               int     size;
-       } flt_type[] = 
-       {
-               "float",        sizeof(float),
-               "double",       sizeof(double),
-       #ifdef _typ_long_double
-               "long double",  sizeof(long double),
-       #endif
-       };
-       
-       static int      int_size[] = { 1, 2, 4, 8 };
-       
-       main()
-       {
-               register int    t;
-               register int    s;
-               register int    m = 1;
-               register int    b = 1;
-               register int    w = 0;
-       
-       #ifdef _ast_int8_t
-               if (int_type[elementsof(int_type)-1].size <= 4)
-                       return 1;
-       #endif
-               for (s = 0; s < elementsof(int_size); s++)
-               {
-                       for (t = 0; t < elementsof(int_type); t++)
-                               if(int_type[t].size >= int_size[s])
-                                       break;
-                       if (t < elementsof(int_type))
-                       {
-                               m = int_size[s];
-                               printf("#define _ast_int%d_t\t\t%s\n",
-                                       m, int_type[t].name);
-                               if (m > 1)
-                               {
-                                       if (*int_type[t].swap)
-                                               w |= b;
-                                       b <<= 1;
-                               }
-                       }
-               }
-               printf("#define _ast_intmax_t           _ast_int%d_t\n", m);
-               if (m == sizeof(long))
-                       printf("#define _ast_intmax_long                1\n");
-               printf("#define _ast_intswap            %d\n", w);
-               printf("\n");
-               for (t = 0; t < elementsof(flt_type); t++)
-               {
-                       for(; t < elementsof(flt_type); t++)
-                               if(flt_type[t].size != flt_type[t + 1].size)
-                                       break;
-                       m = flt_type[t].size;
-                       printf("#define _ast_flt%d_t\t\t%s\n",
-                               flt_type[t].size, flt_type[t].name);
-               }
-               printf("#define _ast_fltmax_t           _ast_flt%d_t\n", m);
-               if (m == sizeof(double))
-                       printf("#define _ast_fltmax_double              1\n");
-               return 0;
-       }
-}end
-
 tst - -DTRY=1 - -DTRY=1 -Dvoid=char - -DTRY=2 - -DTRY=3 - -DTRY=4 output{
        #define printf  ______printf
        #ifdef __STDC__
index 1edac33741e8af53092ef623b6f554c75a7eca7e..ae216ea6c4b851b8aeb6c26c04ec7f9bf0cfee21 100644 (file)
 #      define _typ_ssize_t     1
 typedef int ssize_t;
 #endif
-#define _ast_int1_t            char
-#define _ast_int2_t            short
-#define _ast_int4_t            int
-#define _ast_int8_t            long long
-#define _ast_intmax_t          _ast_int8_t
-#define _ast_intswap           7
-
-#define _ast_flt4_t            float
-#define _ast_flt8_t            double
-#define _ast_flt12_t           long double
-#define _ast_fltmax_t          _ast_flt12_t
 
 #ifndef va_listref
 #define va_listref(p) (p)      /* pass va_list to varargs function */