]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Use getc_unlocked instead of getc where possible, for speed.
authorBruno Haible <bruno@clisp.org>
Fri, 26 Oct 2001 09:12:43 +0000 (09:12 +0000)
committerBruno Haible <bruno@clisp.org>
Fri, 26 Oct 2001 09:12:43 +0000 (09:12 +0000)
intl/ChangeLog
intl/localcharset.c
lib/ChangeLog
lib/localcharset.c
m4/ChangeLog
m4/gettext.m4
src/ChangeLog
src/po-lex.c

index 2bb17d98f3da234b57ba7d5ae9520fb231892261..cd3152cb20372c2baa77f5bec35c5aa829de09fe 100644 (file)
@@ -1,3 +1,7 @@
+2001-10-09  Bruno Haible  <haible@clisp.cons.org>
+
+       * localcharset.c (getc): Define as getc_unlocked if available.
+
 2001-09-27  Bruno Haible  <haible@clisp.cons.org>
 
        * Makefile.in (install-strip, installdirs): New rules.
index 61f8f3e8529ed4b5de04fad2f0f84642c14cf0af..54600cdc0890d03281368ce07d1748570f9d0942 100644 (file)
 # define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
 #endif
 
+#ifdef HAVE_GETC_UNLOCKED
+# undef getc
+# define getc getc_unlocked
+#endif
+
 /* The following static variable is declared 'volatile' to avoid a
    possible multithread problem in the function get_charset_aliases. If we
    are running in a threaded environment, and if two threads initialize
@@ -138,19 +143,19 @@ get_charset_aliases ()
                  continue;
                }
              ungetc (c, fp);
-             if (fscanf(fp, "%50s %50s", buf1, buf2) < 2)
+             if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
                break;
              l1 = strlen (buf1);
              l2 = strlen (buf2);
              if (res_size == 0)
                {
                  res_size = l1 + 1 + l2 + 1;
-                 res_ptr = malloc (res_size + 1);
+                 res_ptr = (char *) malloc (res_size + 1);
                }
              else
                {
                  res_size += l1 + 1 + l2 + 1;
-                 res_ptr = realloc (res_ptr, res_size + 1);
+                 res_ptr = (char *) realloc (res_ptr, res_size + 1);
                }
              if (res_ptr == NULL)
                {
index 722f252f0466400c150d8c37c9d7c7880532bc73..09dee1670cf834b624f2c84460e42c4981a65f4b 100644 (file)
@@ -1,3 +1,7 @@
+2001-10-09  Bruno Haible  <haible@clisp.cons.org>
+
+       * localcharset.c (getc): Define as getc_unlocked if available.
+
 2001-10-10  Bruno Haible  <haible@clisp.cons.org>
 
        * wait-process.h (wait_subprocess): New argument 'exit_on_error'.
index 61f8f3e8529ed4b5de04fad2f0f84642c14cf0af..54600cdc0890d03281368ce07d1748570f9d0942 100644 (file)
 # define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
 #endif
 
+#ifdef HAVE_GETC_UNLOCKED
+# undef getc
+# define getc getc_unlocked
+#endif
+
 /* The following static variable is declared 'volatile' to avoid a
    possible multithread problem in the function get_charset_aliases. If we
    are running in a threaded environment, and if two threads initialize
@@ -138,19 +143,19 @@ get_charset_aliases ()
                  continue;
                }
              ungetc (c, fp);
-             if (fscanf(fp, "%50s %50s", buf1, buf2) < 2)
+             if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
                break;
              l1 = strlen (buf1);
              l2 = strlen (buf2);
              if (res_size == 0)
                {
                  res_size = l1 + 1 + l2 + 1;
-                 res_ptr = malloc (res_size + 1);
+                 res_ptr = (char *) malloc (res_size + 1);
                }
              else
                {
                  res_size += l1 + 1 + l2 + 1;
-                 res_ptr = realloc (res_ptr, res_size + 1);
+                 res_ptr = (char *) realloc (res_ptr, res_size + 1);
                }
              if (res_ptr == NULL)
                {
index 54e7b262518c9c15895a9cb78385d55aad7b33fa..480eb309534af1b7d2ad69451c5d34bf1d6844fa 100644 (file)
@@ -1,3 +1,7 @@
+2001-10-09  Bruno Haible  <haible@clisp.cons.org>
+
+       * gettext.m4 (AM_GNU_GETTEXT): Add check for getc_unlocked.
+
 2001-09-29  Bruno Haible  <haible@clisp.cons.org>
 
        * hostname.m4: New file.
index ca22e40e2b8ebdb587c1eed24d08d11cbd46a7fb..8b0ad3c8aa6955f45d8ca58d005e562332bcf82a 100644 (file)
@@ -57,9 +57,9 @@ AC_DEFUN([AM_GNU_GETTEXT],
 
    AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
 stdlib.h string.h unistd.h sys/param.h])
-   AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
-getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strcasecmp strdup \
-strtoul tsearch __argz_count __argz_stringify __argz_next])
+   AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
+geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
+strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
 
    AM_ICONV
    AM_LANGINFO_CODESET
index b174aabf714eac040eb5b12ebf9935525c7e770c..ed9665c5230e403d79ffd3011b65589b40aeb53e 100644 (file)
@@ -1,3 +1,7 @@
+2001-10-09  Bruno Haible  <haible@clisp.cons.org>
+
+       * po-lex.c (getc): Define as getc_unlocked if available.
+
 2001-10-21  Bruno Haible  <haible@clisp.cons.org>
 
        * msginit.c: New file.
index b664d0f375b52fc674bb59f420389adecbf43984..d0df8d19a20e9baba6ca4439badc6d4178c558e1 100644 (file)
 # include "utf8-ucs4.h"
 #endif
 
+#ifdef HAVE_GETC_UNLOCKED
+# undef getc
+# define getc getc_unlocked
+#endif
+
 #if HAVE_C_BACKSLASH_A
 # define ALERT_CHAR '\a'
 #else