]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Use 'long int', 'short int', 'unsigned int'
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 30 Mar 2004 07:55:25 +0000 (07:55 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 30 Mar 2004 07:55:25 +0000 (07:55 +0000)
etc. consistently instead of 'long', 'short', 'unsigned' etc.

ChangeLog
doc/autoconf.texi
lib/autoconf/c.m4
lib/autoconf/functions.m4
lib/autoconf/headers.m4
lib/autoconf/types.m4
tests/semantics.at

index 3120c9bd4d3054eaefb3d2bf6cc1a6b726556aee..936235452cbe2928fb7e3a01c6ddd78ad0dd878e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2004-03-29  Paul Eggert  <eggert@twinsun.com>
+
+       * doc/autoconf.texi (Particular Headers, Particular Types, Generic
+       Types, Specific Compiler Characteristics, System Services,
+       Obsolete Macros): Use 'long int', 'short int', 'unsigned int'
+       etc. consistently instead of 'long', 'short', 'unsigned' etc.
+       * lib/autoconf/c.m4 (AC_LANG_INT_SAVE(C), AC_C_BIGENDIAN): Likewise.
+       * lib/autoconf/functions.m4 (AC_FUNC_MMAP, AC_FUNC_SELECT_ARGTYPES):
+       Likewise.
+       * lib/autoconf/headers.m4 (AC_HEADER_SYS_WAIT): Likewise.
+       * lib/autoconf/types.m4 (AC_TYPE_GETGROUPS, AC_TYPE_SIZE_T,
+       AC_TYPE_OFF_T): Likewise.
+       * tests/semantics.at (AC_CHECK_TYPES: backward compatibility):
+       Likewise.
+
+       * tests/foreign.at (Libtool): Create an empty aclocal.m4, to
+       pacify libtool 1.5.2.  Fix quoting problems in sed command.
+
 2004-03-28  Paul Eggert  <eggert@twinsun.com>
 
        * doc/autoconf.texi (Particular Structures): AC_STRUCT_TIMEZONE
index 6426ddf4008e7a90f674679e008833dbadec5bea..701569dd742a4d2cd6213e4bedde5f8727b8088a 100644 (file)
@@ -4784,7 +4784,7 @@ example:
 # include <sys/wait.h>
 #endif
 #ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
 #endif
 #ifndef WIFEXITED
 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
@@ -5188,7 +5188,7 @@ Equivalent to @samp{AC_CHECK_TYPE(mode_t, int)}.
 @defmac AC_TYPE_OFF_T
 @acindex{TYPE_OFF_T}
 @cvindex off_t
-Equivalent to @samp{AC_CHECK_TYPE(off_t, long)}.
+Equivalent to @samp{AC_CHECK_TYPE(off_t, long int)}.
 @end defmac
 
 @defmac AC_TYPE_PID_T
@@ -5221,7 +5221,7 @@ hup_handler ()
 @defmac AC_TYPE_SIZE_T
 @acindex{TYPE_SIZE_T}
 @cvindex size_t
-Equivalent to @samp{AC_CHECK_TYPE(size_t, unsigned)}.
+Equivalent to @samp{AC_CHECK_TYPE(size_t, unsigned int)}.
 @end defmac
 
 @defmac AC_TYPE_UID_T
@@ -5257,7 +5257,7 @@ it is executed when one of the types is not found.
 This macro uses m4 lists:
 @example
 AC_CHECK_TYPES(ptrdiff_t)
-AC_CHECK_TYPES([unsigned long long, uintmax_t])
+AC_CHECK_TYPES([unsigned long long int, uintmax_t])
 @end example
 
 @end defmac
@@ -5308,14 +5308,14 @@ Some compilers exhibit different behaviors.
 Autoconf relies on a trick to extract one bit of information from the C
 compiler: using negative array sizes.  For instance the following
 excerpt of a C source demonstrates how to test whether @samp{int}s are 4
-bytes long:
+bytes wide:
 
 @example
 int
 main (void)
 @{
   static int test_array [sizeof (int) == 4 ? 1 : -1];
-  test_array [0] = 0
+  test_array [0] = 0;
   return 0;
 @}
 @end example
@@ -5332,7 +5332,7 @@ cc: "conftest.c": error 1879: Variable-length arrays cannot \
 @end example
 
 Autoconf works around this problem by casting @code{sizeof (int)} to
-@code{long} before comparing it.
+@code{long int} before comparing it.
 @end table
 
 @node Generic Compiler Characteristics
@@ -6176,10 +6176,10 @@ Large-file support can be disabled by configuring with the
 @option{--disable-largefile} option.
 
 If you use this macro, check that your program works even when
-@code{off_t} is longer than @code{long}, since this is common when
+@code{off_t} is wider than @code{long int}, since this is common when
 large-file support is enabled.  For example, it is not correct to print
 an arbitrary @code{off_t} value @code{X} with @code{printf ("%ld",
-(long) X)}.
+(long int) X)}.
 
 The LFS introduced the @code{fseeko} and @code{ftello} functions to
 replace their C counterparts @code{fseek} and @code{ftell} that do not
@@ -13444,7 +13444,7 @@ This use of @code{AC_CHECK_TYPE} is obsolete and discouraged; see
 @ref{Generic Types}, for the description of the current macro.
 
 If the type @var{type} is not defined, define it to be the C (or C++)
-builtin type @var{default}, e.g., @samp{short} or @samp{unsigned}.
+builtin type @var{default}, e.g., @samp{short int} or @samp{unsigned int}.
 
 This macro is equivalent to:
 
index eddba0f8b85873fb3aab8cc63315fe1d8714fade..249653ede18c4d52b9e8a65cc0a2c6d14eb6eb52 100644 (file)
@@ -242,8 +242,8 @@ test_array @<:@0@:>@ = 0
 # But we include them only after the EXPRESSION has been evaluated.
 m4_define([AC_LANG_INT_SAVE(C)],
 [AC_LANG_PROGRAM([$1
-long longval () { return $2; }
-unsigned long ulongval () { return $2; }
+long int longval () { return $2; }
+unsigned long int ulongval () { return $2; }
 @%:@include <stdio.h>
 @%:@include <stdlib.h>],
 [
@@ -252,14 +252,14 @@ unsigned long ulongval () { return $2; }
     exit (1);
   if (($2) < 0)
     {
-      long i = longval ();
+      long int i = longval ();
       if (i != ($2))
        exit (1);
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
+      unsigned long int i = ulongval ();
       if (i != ($2))
        exit (1);
       fprintf (f, "%lu\n", i);
@@ -966,22 +966,22 @@ main ()
   /* Are we little or big endian?  From Harbison&Steele.  */
   union
   {
-    long l;
-    char c[sizeof (long)];
+    long int l;
+    char c[sizeof (long int)];
   } u;
   u.l = 1;
-  exit (u.c[sizeof (long) - 1] == 1);
+  exit (u.c[sizeof (long int) - 1] == 1);
 }]])],
              [ac_cv_c_bigendian=no],
              [ac_cv_c_bigendian=yes],
 [# try to guess the endianness by grepping values into an object file
   ac_cv_c_bigendian=unknown
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-[[short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+[[short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
 void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
-short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
 void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }]],
 [[ _ascii (); _ebcdic (); ]])],
 [if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
index f87eaaf1064f6c768feaab29b2a38eda86d981a6..861183ccfeeaed1ebdb9e2dcce718d09f113b362 100644 (file)
@@ -1,6 +1,6 @@
 # This file is part of Autoconf.                       -*- Autoconf -*-
 # Checking for functions.
-# Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -1227,7 +1227,7 @@ main ()
   data2 = (char *) malloc (2 * pagesize);
   if (!data2)
     exit (1);
-  data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1);
+  data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1);
   if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
                     MAP_PRIVATE | MAP_FIXED, fd, 0L))
     exit (1);
@@ -1345,7 +1345,7 @@ AC_DEFUN([AC_FUNC_SELECT_ARGTYPES],
 AC_CACHE_CHECK([types of arguments for select],
 [ac_cv_func_select_args],
 [for ac_arg234 in 'fd_set *' 'int *' 'void *'; do
- for ac_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
+ for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do
   for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do
    AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM(
@@ -1671,7 +1671,7 @@ AC_DEFUN([AC_FUNC_UTIME_NULL],
 AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
 [[struct stat s, t;
   exit (!(stat ("conftest.data", &s) == 0
-         && utime ("conftest.data", (long *)0) == 0
+         && utime ("conftest.data", 0) == 0
          && stat ("conftest.data", &t) == 0
          && t.st_mtime >= s.st_mtime
          && t.st_mtime - s.st_mtime < 120));]])],
index 8d902489d5bba51c8b094559ebe91a0d8c2cfdcf..4f9b84e290242d4ca51c665ad790654be16afe4d 100644 (file)
@@ -629,7 +629,7 @@ AC_DEFUN([AC_HEADER_SYS_WAIT],
 [AC_LANG_PROGRAM([#include <sys/types.h>
 #include <sys/wait.h>
 #ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
 #endif
 #ifndef WIFEXITED
 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
index 9c265c829f70a7237e6ad10ad3748cabc0c95463..34cc528d352c253d06ad20bdf970cd087e137833 100644 (file)
@@ -263,7 +263,7 @@ main ()
 {
   gid_t gidset[NGID];
   int i, n;
-  union { gid_t gval; long lval; }  val;
+  union { gid_t gval; long int lval; }  val;
 
   val.lval = -1;
   for (i = 0; i < NGID; i++)
@@ -271,7 +271,8 @@ main ()
   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
                 gidset);
   /* Exit non-zero if getgroups seems to require an array of ints.  This
-     happens when gid_t is short but getgroups modifies an array of ints.  */
+     happens when gid_t is short int but getgroups modifies an array
+     of ints.  */
   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
 }]])],
               [ac_cv_type_getgroups=gid_t],
@@ -333,13 +334,13 @@ fi
 
 
 AN_IDENTIFIER([size_t], [AC_TYPE_SIZE_T])
-AC_DEFUN([AC_TYPE_SIZE_T], [AC_CHECK_TYPE(size_t, unsigned)])
+AC_DEFUN([AC_TYPE_SIZE_T], [AC_CHECK_TYPE(size_t, unsigned int)])
 
 AN_IDENTIFIER([pid_t], [AC_TYPE_PID_T])
 AC_DEFUN([AC_TYPE_PID_T],  [AC_CHECK_TYPE(pid_t,  int)])
 
 AN_IDENTIFIER([off_t], [AC_TYPE_OFF_T])
-AC_DEFUN([AC_TYPE_OFF_T],  [AC_CHECK_TYPE(off_t,  long)])
+AC_DEFUN([AC_TYPE_OFF_T],  [AC_CHECK_TYPE(off_t,  long int)])
 
 AN_IDENTIFIER([mode_t], [AC_TYPE_MODE_T])
 AC_DEFUN([AC_TYPE_MODE_T], [AC_CHECK_TYPE(mode_t, int)])
index dbff9395ffc9d6242a74daf0f76cc48527819b68..038bd3cd73397900059aa037d85f7ae54afdb617 100644 (file)
@@ -340,7 +340,7 @@ define([_AC_CHECK_TYPE_OLD], [OLD])
 #(cut-from-here
 AC_CHECK_TYPE(ptrdiff_t)
 AC_CHECK_TYPE(ptrdiff_t, int)
-AC_CHECK_TYPE(quad, long long)
+AC_CHECK_TYPE(quad, long long int)
 AC_CHECK_TYPE(table_42, [int[42]])
 # Nice machine!
 AC_CHECK_TYPE(uint8_t, uint65536_t)