From: Bruno Haible Date: Tue, 30 Jan 2007 01:07:22 +0000 (+0000) Subject: Stylistic change: Use '#if HAVE_*' instead of '#ifdef HAVE_*'. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac5d57a6683bc6f146b28d2c84e1fdbf80877e06;p=pspp Stylistic change: Use '#if HAVE_*' instead of '#ifdef HAVE_*'. --- diff --git a/ChangeLog b/ChangeLog index 5ed8f7803c..eae0abcf56 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-01-29 Bruno Haible + + * lib/allocsa.h: Use '#if HAVE_*' instead of '#ifdef HAVE_*'. + * lib/execute.c: Likewise. + * lib/pipe.c: Likewise. + * lib/printf-args.h: Likewise. + * lib/printf-args.c: Likewise. + * lib/printf-parse.c: Likewise. + * lib/vasnprintf.c: Likewise. + 2007-01-29 Eric Blake * lib/memrchr.c: Assume unconditionally, to pull in diff --git a/lib/allocsa.h b/lib/allocsa.h index 0fd46a8e6a..3337110eb6 100644 --- a/lib/allocsa.h +++ b/lib/allocsa.h @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003-2006 Free Software Foundation, Inc. + Copyright (C) 2003-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify @@ -106,17 +106,17 @@ enum among all elementary types. */ sa_alignment_long = sa_alignof (long), sa_alignment_double = sa_alignof (double), -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT sa_alignment_longlong = sa_alignof (long long), #endif -#ifdef HAVE_LONG_DOUBLE +#if HAVE_LONG_DOUBLE sa_alignment_longdouble = sa_alignof (long double), #endif sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1) -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT | (sa_alignment_longlong - 1) #endif -#ifdef HAVE_LONG_DOUBLE +#if HAVE_LONG_DOUBLE | (sa_alignment_longdouble - 1) #endif ) + 1, diff --git a/lib/execute.c b/lib/execute.c index ea9388034b..57664feacd 100644 --- a/lib/execute.c +++ b/lib/execute.c @@ -1,5 +1,5 @@ /* Creation of autonomous subprocesses. - Copyright (C) 2001-2004, 2006 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -46,17 +46,17 @@ #else /* Unix API. */ -# ifdef HAVE_POSIX_SPAWN +# if HAVE_POSIX_SPAWN # include # else -# ifdef HAVE_VFORK_H +# if HAVE_VFORK_H # include # endif # endif #endif -#ifndef HAVE_ENVIRON_DECL +#if ! HAVE_ENVIRON_DECL extern char **environ; #endif diff --git a/lib/pipe.c b/lib/pipe.c index 521872be6d..a2f89a758b 100644 --- a/lib/pipe.c +++ b/lib/pipe.c @@ -1,5 +1,5 @@ /* Creation of subprocesses, communicating via pipes. - Copyright (C) 2001-2004, 2006 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -45,17 +45,17 @@ #else /* Unix API. */ -# ifdef HAVE_POSIX_SPAWN +# if HAVE_POSIX_SPAWN # include # else -# ifdef HAVE_VFORK_H +# if HAVE_VFORK_H # include # endif # endif #endif -#ifndef HAVE_ENVIRON_DECL +#if ! HAVE_ENVIRON_DECL extern char **environ; #endif diff --git a/lib/printf-args.c b/lib/printf-args.c index 358801c97b..2259d53e5e 100644 --- a/lib/printf-args.c +++ b/lib/printf-args.c @@ -1,5 +1,5 @@ /* Decomposed printf argument list. - Copyright (C) 1999, 2002-2003, 2005-2006 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2003, 2005-2007 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 @@ -56,7 +56,7 @@ printf_fetchargs (va_list args, arguments *a) case TYPE_ULONGINT: ap->a.a_ulongint = va_arg (args, unsigned long int); break; -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: ap->a.a_longlongint = va_arg (args, long long int); break; @@ -67,7 +67,7 @@ printf_fetchargs (va_list args, arguments *a) case TYPE_DOUBLE: ap->a.a_double = va_arg (args, double); break; -#ifdef HAVE_LONG_DOUBLE +#if HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: ap->a.a_longdouble = va_arg (args, long double); break; @@ -75,7 +75,7 @@ printf_fetchargs (va_list args, arguments *a) case TYPE_CHAR: ap->a.a_char = va_arg (args, int); break; -#ifdef HAVE_WINT_T +#if HAVE_WINT_T case TYPE_WIDE_CHAR: /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by default argument promotions", this is not the case in mingw32, @@ -94,7 +94,7 @@ printf_fetchargs (va_list args, arguments *a) if (ap->a.a_string == NULL) ap->a.a_string = "(NULL)"; break; -#ifdef HAVE_WCHAR_T +#if HAVE_WCHAR_T case TYPE_WIDE_STRING: ap->a.a_wide_string = va_arg (args, const wchar_t *); /* A null pointer is an invalid argument for "%ls", but in practice @@ -128,7 +128,7 @@ printf_fetchargs (va_list args, arguments *a) case TYPE_COUNT_LONGINT_POINTER: ap->a.a_count_longint_pointer = va_arg (args, long int *); break; -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT case TYPE_COUNT_LONGLONGINT_POINTER: ap->a.a_count_longlongint_pointer = va_arg (args, long long int *); break; diff --git a/lib/printf-args.h b/lib/printf-args.h index 5759da0ee9..74a18d9bf3 100644 --- a/lib/printf-args.h +++ b/lib/printf-args.h @@ -1,5 +1,5 @@ /* Decomposed printf argument list. - Copyright (C) 1999, 2002-2003, 2006 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2003, 2006-2007 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 @@ -22,12 +22,12 @@ #include /* Get wchar_t. */ -#ifdef HAVE_WCHAR_T +#if HAVE_WCHAR_T # include #endif /* Get wint_t. */ -#ifdef HAVE_WINT_T +#if HAVE_WINT_T # include #endif @@ -47,20 +47,20 @@ typedef enum TYPE_UINT, TYPE_LONGINT, TYPE_ULONGINT, -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT TYPE_LONGLONGINT, TYPE_ULONGLONGINT, #endif TYPE_DOUBLE, -#ifdef HAVE_LONG_DOUBLE +#if HAVE_LONG_DOUBLE TYPE_LONGDOUBLE, #endif TYPE_CHAR, -#ifdef HAVE_WINT_T +#if HAVE_WINT_T TYPE_WIDE_CHAR, #endif TYPE_STRING, -#ifdef HAVE_WCHAR_T +#if HAVE_WCHAR_T TYPE_WIDE_STRING, #endif TYPE_POINTER, @@ -68,7 +68,7 @@ typedef enum TYPE_COUNT_SHORT_POINTER, TYPE_COUNT_INT_POINTER, TYPE_COUNT_LONGINT_POINTER -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT , TYPE_COUNT_LONGLONGINT_POINTER #endif } arg_type; @@ -87,21 +87,21 @@ typedef struct unsigned int a_uint; long int a_longint; unsigned long int a_ulongint; -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT long long int a_longlongint; unsigned long long int a_ulonglongint; #endif float a_float; double a_double; -#ifdef HAVE_LONG_DOUBLE +#if HAVE_LONG_DOUBLE long double a_longdouble; #endif int a_char; -#ifdef HAVE_WINT_T +#if HAVE_WINT_T wint_t a_wide_char; #endif const char* a_string; -#ifdef HAVE_WCHAR_T +#if HAVE_WCHAR_T const wchar_t* a_wide_string; #endif void* a_pointer; @@ -109,7 +109,7 @@ typedef struct short * a_count_short_pointer; int * a_count_int_pointer; long int * a_count_longint_pointer; -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT long long int * a_count_longlongint_pointer; #endif } diff --git a/lib/printf-parse.c b/lib/printf-parse.c index 9a86f7738e..f5cdb6e5b5 100644 --- a/lib/printf-parse.c +++ b/lib/printf-parse.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 1999-2000, 2002-2003, 2006 Free Software Foundation, Inc. + Copyright (C) 1999-2000, 2002-2003, 2006-2007 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 @@ -326,7 +326,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) flags += 8; cp++; } -#ifdef HAVE_INTMAX_T +#if HAVE_INTMAX_T else if (*cp == 'j') { if (sizeof (intmax_t) > sizeof (long)) @@ -382,7 +382,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) switch (c) { case 'd': case 'i': -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT /* If 'long long' exists and is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_LONGLONGINT; @@ -400,7 +400,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) type = TYPE_INT; break; case 'o': case 'u': case 'x': case 'X': -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT /* If 'long long' exists and is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_ULONGLONGINT; @@ -419,7 +419,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) break; case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': -#ifdef HAVE_LONG_DOUBLE +#if HAVE_LONG_DOUBLE if (flags >= 16 || (flags & 4)) type = TYPE_LONGDOUBLE; else @@ -428,7 +428,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) break; case 'c': if (flags >= 8) -#ifdef HAVE_WINT_T +#if HAVE_WINT_T type = TYPE_WIDE_CHAR; #else goto error; @@ -436,7 +436,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) else type = TYPE_CHAR; break; -#ifdef HAVE_WINT_T +#if HAVE_WINT_T case 'C': type = TYPE_WIDE_CHAR; c = 'c'; @@ -444,7 +444,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) #endif case 's': if (flags >= 8) -#ifdef HAVE_WCHAR_T +#if HAVE_WCHAR_T type = TYPE_WIDE_STRING; #else goto error; @@ -452,7 +452,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) else type = TYPE_STRING; break; -#ifdef HAVE_WCHAR_T +#if HAVE_WCHAR_T case 'S': type = TYPE_WIDE_STRING; c = 's'; @@ -462,7 +462,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) type = TYPE_POINTER; break; case 'n': -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT /* If 'long long' exists and is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_COUNT_LONGLONGINT_POINTER; diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index 0fe2aada9f..67406ae860 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 1999, 2002-2006 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2007 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 @@ -49,8 +49,8 @@ /* Checked size_t computations. */ #include "xsize.h" -#ifdef HAVE_WCHAR_T -# ifdef HAVE_WCSLEN +#if HAVE_WCHAR_T +# if HAVE_WCSLEN # define local_wcslen wcslen # else /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid @@ -248,7 +248,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar case TYPE_COUNT_LONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longint_pointer = length; break; -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT case TYPE_COUNT_LONGLONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length; break; @@ -322,7 +322,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar { case 'd': case 'i': case 'u': -# ifdef HAVE_LONG_LONG_INT +# if HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT @@ -352,7 +352,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar break; case 'o': -# ifdef HAVE_LONG_LONG_INT +# if HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT @@ -380,7 +380,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar break; case 'x': case 'X': -# ifdef HAVE_LONG_LONG_INT +# if HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT @@ -408,7 +408,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar break; case 'f': case 'F': -# ifdef HAVE_LONG_DOUBLE +# if HAVE_LONG_DOUBLE if (type == TYPE_LONGDOUBLE) tmp_length = (unsigned int) (LDBL_MAX_EXP @@ -437,7 +437,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar break; case 'c': -# if defined HAVE_WINT_T && !WIDE_CHAR_VERSION +# if HAVE_WINT_T && !WIDE_CHAR_VERSION if (type == TYPE_WIDE_CHAR) tmp_length = MB_CUR_MAX; else @@ -446,7 +446,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar break; case 's': -# ifdef HAVE_WCHAR_T +# if HAVE_WCHAR_T if (type == TYPE_WIDE_STRING) { tmp_length = @@ -527,7 +527,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar switch (type) { -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: case TYPE_ULONGLONGINT: *p++ = 'l'; @@ -535,15 +535,15 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar #endif case TYPE_LONGINT: case TYPE_ULONGINT: -#ifdef HAVE_WINT_T +#if HAVE_WINT_T case TYPE_WIDE_CHAR: #endif -#ifdef HAVE_WCHAR_T +#if HAVE_WCHAR_T case TYPE_WIDE_STRING: #endif *p++ = 'l'; break; -#ifdef HAVE_LONG_DOUBLE +#if HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: *p++ = 'L'; break; @@ -681,7 +681,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar SNPRINTF_BUF (arg); } break; -#ifdef HAVE_LONG_LONG_INT +#if HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: { long long int arg = a.arg[dp->arg_index].a.a_longlongint; @@ -701,7 +701,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar SNPRINTF_BUF (arg); } break; -#ifdef HAVE_LONG_DOUBLE +#if HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: { long double arg = a.arg[dp->arg_index].a.a_longdouble; @@ -715,7 +715,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar SNPRINTF_BUF (arg); } break; -#ifdef HAVE_WINT_T +#if HAVE_WINT_T case TYPE_WIDE_CHAR: { wint_t arg = a.arg[dp->arg_index].a.a_wide_char; @@ -729,7 +729,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar SNPRINTF_BUF (arg); } break; -#ifdef HAVE_WCHAR_T +#if HAVE_WCHAR_T case TYPE_WIDE_STRING: { const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;