]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Use bool where appropriate.
authorBruno Haible <bruno@clisp.org>
Tue, 12 Feb 2002 12:35:06 +0000 (12:35 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 23:20:09 +0000 (01:20 +0200)
lib/ChangeLog
lib/c-ctype.c
lib/c-ctype.h
lib/tmpdir.c
lib/tmpdir.h
lib/vasprintf.c
src/ChangeLog
src/message.c
src/message.h

index 6977e75dcf313198d1d2240721445f9399a6d533..a19f5a7fff8b428f4d97b7cb28ac1b2a81a65ae8 100644 (file)
@@ -1,3 +1,14 @@
+2002-02-09  Bruno Haible  <bruno@clisp.org>
+
+       * c-ctype.h (c_is*): Change return type to bool.
+       * c-ctype.c (c_is*): Likewise.
+
+       * tmpdir.h (path_search): Change last argument's type to bool.
+       * tmpdir.c (path_search): Likewise.
+       (direxists): Change return type to bool.
+
+       * vasprintf.c (int_vasprintf): Change total_width to size_t.
+
 2002-02-11  Bruno Haible  <bruno@clisp.org>
 
        * config.charset: Add support for NetBSD.
index f1c5a0e92491045aeafe36e7410db230275cfc68..f918dc6d6b9a3e1666037f4dc5a46103bd72d735 100644 (file)
@@ -1,6 +1,6 @@
 /* Character handling in C locale.
 
-   Copyright 2000, 2001 Free Software Foundation, Inc.
+   Copyright 2000-2002 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
@@ -37,14 +37,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* The function isascii is not locale dependent. Its use in EBCDIC is
    questionable. */
-int
+bool
 c_isascii (c)
      int c;
 {
   return ((c & ~0x7f) == 0);
 }
 
-int
+bool
 c_isalnum (c)
      int c;
 {
@@ -75,7 +75,7 @@ c_isalnum (c)
 #endif
 }
 
-int
+bool
 c_isalpha (c)
      int c;
 {
@@ -101,14 +101,14 @@ c_isalpha (c)
 #endif
 }
 
-int
+bool
 c_isblank (c)
      int c;
 {
   return (c == ' ' || c == '\t');
 }
 
-int
+bool
 c_iscntrl (c)
      int c;
 {
@@ -143,7 +143,7 @@ c_iscntrl (c)
 #endif
 }
 
-int
+bool
 c_isdigit (c)
      int c;
 {
@@ -161,7 +161,7 @@ c_isdigit (c)
 #endif
 }
 
-int
+bool
 c_islower (c)
      int c;
 {
@@ -182,7 +182,7 @@ c_islower (c)
 #endif
 }
 
-int
+bool
 c_isgraph (c)
      int c;
 {
@@ -217,7 +217,7 @@ c_isgraph (c)
 #endif
 }
 
-int
+bool
 c_isprint (c)
      int c;
 {
@@ -252,7 +252,7 @@ c_isprint (c)
 #endif
 }
 
-int
+bool
 c_ispunct (c)
      int c;
 {
@@ -278,7 +278,7 @@ c_ispunct (c)
 #endif
 }
 
-int
+bool
 c_isspace (c)
      int c;
 {
@@ -286,7 +286,7 @@ c_isspace (c)
           || c == '\n' || c == '\v' || c == '\f' || c == '\r');
 }
 
-int
+bool
 c_isupper (c)
      int c;
 {
@@ -307,7 +307,7 @@ c_isupper (c)
 #endif
 }
 
-int
+bool
 c_isxdigit (c)
      int c;
 {
index 64222c59b4a43fac60f48d542ae17cba1a09c4a3..929b14ec17c58cf38d3bb34aae1277df37d4e027 100644 (file)
@@ -5,7 +5,7 @@
    <ctype.h> functions' behaviour depends on the current locale set via
    setlocale.
 
-   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 2000-2002 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
@@ -32,6 +32,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 # endif
 #endif
 
+#include <stdbool.h>
+
 
 /* Check whether the ASCII optimizations apply. */
 
@@ -98,20 +100,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Function declarations. */
 
-extern int c_isascii PARAMS ((int c)); /* not locale dependent */
-
-extern int c_isalnum PARAMS ((int c));
-extern int c_isalpha PARAMS ((int c));
-extern int c_isblank PARAMS ((int c));
-extern int c_iscntrl PARAMS ((int c));
-extern int c_isdigit PARAMS ((int c));
-extern int c_islower PARAMS ((int c));
-extern int c_isgraph PARAMS ((int c));
-extern int c_isprint PARAMS ((int c));
-extern int c_ispunct PARAMS ((int c));
-extern int c_isspace PARAMS ((int c));
-extern int c_isupper PARAMS ((int c));
-extern int c_isxdigit PARAMS ((int c));
+extern bool c_isascii PARAMS ((int c)); /* not locale dependent */
+
+extern bool c_isalnum PARAMS ((int c));
+extern bool c_isalpha PARAMS ((int c));
+extern bool c_isblank PARAMS ((int c));
+extern bool c_iscntrl PARAMS ((int c));
+extern bool c_isdigit PARAMS ((int c));
+extern bool c_islower PARAMS ((int c));
+extern bool c_isgraph PARAMS ((int c));
+extern bool c_isprint PARAMS ((int c));
+extern bool c_ispunct PARAMS ((int c));
+extern bool c_isspace PARAMS ((int c));
+extern bool c_isupper PARAMS ((int c));
+extern bool c_isxdigit PARAMS ((int c));
 
 extern int c_tolower PARAMS ((int c));
 extern int c_toupper PARAMS ((int c));
index 37f4f6a3953cae23da7bde26a8bd54dbbc082fdc..11b62944e4088cbde4d8487c059dfeb569bbec5b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2001-2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -25,6 +25,7 @@
 /* Specification.  */
 #include "tmpdir.h"
 
+#include <stdbool.h>
 #include <stdlib.h>
 #include <string.h>
 
 
 /* Prototypes for local functions.  Needed to ensure compiler checking of
    function argument counts despite of K&R C function definition syntax.  */
-static int direxists PARAMS ((const char *dir));
+static bool direxists PARAMS ((const char *dir));
 
 
 /* Return nonzero if DIR is an existent directory.  */
-static int
+static bool
 direxists (dir)
      const char *dir;
 {
@@ -102,7 +103,7 @@ path_search (tmpl, tmpl_len, dir, pfx, try_tmpdir)
      size_t tmpl_len;
      const char *dir;
      const char *pfx;
-     int try_tmpdir;
+     bool try_tmpdir;
 {
   const char *d;
   size_t dlen, plen;
index 2a8a37d66dafaee88d9df33c845a15f73b91c37e..8eaed9e2df3c5baaead2a61da22be12ef1621915 100644 (file)
@@ -1,5 +1,5 @@
 /* Determine a temporary directory.
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002 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
@@ -23,6 +23,7 @@
 # endif
 #endif
 
+#include <stdbool.h>
 #include <stddef.h>
 
 /* Path search algorithm, for tmpnam, tmpfile, etc.  If DIR is
@@ -31,4 +32,4 @@
    for use with mk[s]temp.  Will fail (-1) if DIR is non-null and
    doesn't exist, none of the searched dirs exists, or there's not
    enough space in TMPL. */
-extern int path_search PARAMS ((char *tmpl, size_t tmpl_len, const char *dir, const char *pfx, int try_tmpdir));
+extern int path_search PARAMS ((char *tmpl, size_t tmpl_len, const char *dir, const char *pfx, bool try_tmpdir));
index 1c2a085d09319707fa7898df25b4669d8296083b..c723ed475dce6c0208d08efe02e94e80673532ed 100644 (file)
@@ -1,6 +1,6 @@
 /* Like vsprintf but provides a pointer to malloc'd storage, which must
    be freed by the caller.
-   Copyright (C) 1994, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1998, 1999, 2000-2002 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
@@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <math.h>
 
 #ifdef TEST
-int global_total_width;
+size_t global_total_width;
 #endif
 
 static int
@@ -45,7 +45,7 @@ int_vasprintf (result, format, args)
   const char *p = format;
   /* Add one to make sure that it is never zero, which might cause malloc
      to return NULL.  */
-  int total_width = strlen (format) + 1;
+  size_t total_width = strlen (format) + 1;
   va_list ap;
 
   memcpy (&ap, args, sizeof (va_list));
@@ -191,7 +191,7 @@ checkit
     printf ("PASS: ");
   else
     printf ("FAIL: ");
-  printf ("%d %s\n", global_total_width, result);
+  printf ("%lu %s\n", (unsigned long) global_total_width, result);
 }
 
 int
index dea45cd0d09124a2f04de8a4e055ce3c54eb862e..6cda5b4df9ceb2c4648f36592550871ae2958dd5 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-09  Bruno Haible  <bruno@clisp.org>
+
+       * message.h (possible_format_p): Change return type to bool.
+       * message.c (possible_format_p): Likewise.
+
 2002-01-14  Bruno Haible  <bruno@clisp.org>
 
        * x-glade.h: New file.
index 84ac2d005ab9c74e9a9004aaf360da335fc61242..bbfb0028cfe449649642705cb8b021c64849005f 100644 (file)
@@ -67,7 +67,7 @@ const char *const format_language_pretty[NFORMATS] =
 };
 
 
-int
+bool
 possible_format_p (is_format)
      enum is_format is_format;
 {
index aad981b7ef2f8e15404529c8bdd7773ea319466c..74fa4a7e6cedcd9c8508063d5f3d19d27170bc6d 100644 (file)
@@ -59,7 +59,7 @@ enum is_format
   impossible
 };
 
-extern int
+extern bool
        possible_format_p PARAMS ((enum is_format));