[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
unsigned -> unsigned int, etc.
From: |
Paul Eggert |
Subject: |
unsigned -> unsigned int, etc. |
Date: |
Mon, 29 Mar 2004 23:57:50 -0800 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
I installed this patch so that Autoconf uses type names like 'unsigned
int' consistently, as this is the usual GNU style.
2004-03-29 Paul Eggert <address@hidden>
* 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.
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.807
diff -p -u -r1.807 autoconf.texi
--- doc/autoconf.texi 28 Mar 2004 21:51:10 -0000 1.807
+++ doc/autoconf.texi 30 Mar 2004 07:46:56 -0000
@@ -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
@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
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 behavio
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-l
@end example
Autoconf works around this problem by casting @code{sizeof (int)} to
address@hidden before comparing it.
address@hidden int} before comparing it.
@end table
@node Generic Compiler Characteristics
@@ -6176,10 +6176,10 @@ Large-file support can be disabled by co
@option{--disable-largefile} option.
If you use this macro, check that your program works even when
address@hidden is longer than @code{long}, since this is common when
address@hidden 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 obso
@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: lib/autoconf/c.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/c.m4,v
retrieving revision 1.184
diff -p -u -r1.184 c.m4
--- lib/autoconf/c.m4 15 Jan 2004 18:20:52 -0000 1.184
+++ lib/autoconf/c.m4 30 Mar 2004 07:46:58 -0000
@@ -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: lib/autoconf/functions.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/functions.m4,v
retrieving revision 1.81
diff -p -u -r1.81 functions.m4
--- lib/autoconf/functions.m4 27 Oct 2003 11:12:52 -0000 1.81
+++ lib/autoconf/functions.m4 30 Mar 2004 07:46:59 -0000
@@ -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: lib/autoconf/headers.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/headers.m4,v
retrieving revision 1.38
diff -p -u -r1.38 headers.m4
--- lib/autoconf/headers.m4 30 Jan 2004 14:21:36 -0000 1.38
+++ lib/autoconf/headers.m4 30 Mar 2004 07:46:59 -0000
@@ -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: lib/autoconf/types.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/types.m4,v
retrieving revision 1.27
diff -p -u -r1.27 types.m4
--- lib/autoconf/types.m4 28 Mar 2004 21:51:10 -0000 1.27
+++ lib/autoconf/types.m4 30 Mar 2004 07:47:00 -0000
@@ -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: tests/semantics.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/semantics.at,v
retrieving revision 1.44
diff -p -u -r1.44 semantics.at
--- tests/semantics.at 15 Mar 2004 22:00:06 -0000 1.44
+++ tests/semantics.at 30 Mar 2004 07:47:02 -0000
@@ -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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- unsigned -> unsigned int, etc.,
Paul Eggert <=