]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(PFI): Return `long', not `int'.
authorJim Meyering <jim@meyering.net>
Fri, 21 Jan 2000 07:33:25 +0000 (07:33 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 21 Jan 2000 07:33:25 +0000 (07:33 +0000)
(PFL): Rename from PFI now that it returns long.
(squeeze_filter): Declare as `long': i, nr, out_len.

src/tr.c

index dc3332b7fb74534f898f46fd4d7abda4f512d011..427d0a40317d1b3b232db8a54ae1854c4a9eccda 100644 (file)
--- a/src/tr.c
+++ b/src/tr.c
@@ -1,5 +1,5 @@
 /* tr -- a filter to translate characters
-   Copyright (C) 91, 1995-1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 91, 1995-1998, 1999, 2000 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
@@ -36,8 +36,8 @@
 
 #define N_CHARS (UCHAR_MAX + 1)
 
-/* A pointer to a function that returns an int.  */
-typedef int (*PFI) ();
+/* A pointer to a function that returns a `long'.  */
+typedef long (*PFL) (/* unsigned char *, long int, PFL */);
 
 /* Convert from character C to its index in the collating
    sequence array.  Just cast to an unsigned int to avoid
@@ -960,7 +960,7 @@ star_digits_closebracket (const struct E_string *es, size_t idx)
   return 0;
 }
 
-/* Convert string UNESACPED_STRING (which has been preprocessed to
+/* Convert string UNESCAPED_STRING (which has been preprocessed to
    convert backslash-escape sequences) of length LEN characters into
    a linked list of the following 5 types of constructs:
       - [:str:] Character class where `str' is one of the 12 valid strings.
@@ -1598,15 +1598,15 @@ when translating"));
    character is in the squeeze set.  */
 
 static void
-squeeze_filter (unsigned char *buf, long int size, PFI reader)
+squeeze_filter (unsigned char *buf, long int size, PFL reader)
 {
   unsigned int char_to_squeeze = NOT_A_CHAR;
-  int i = 0;
-  int nr = 0;
+  long i = 0;
+  long nr = 0;
 
   for (;;)
     {
-      int begin;
+      long begin;
 
       if (i >= nr)
        {
@@ -1626,7 +1626,7 @@ squeeze_filter (unsigned char *buf, long int size, PFI reader)
 
       if (char_to_squeeze == NOT_A_CHAR)
        {
-         int out_len;
+         long out_len;
          /* Here, by being a little tricky, we can get a significant
             performance increase in most cases when the input is
             reasonably large.  Since tr will modify the input only
@@ -1693,7 +1693,7 @@ squeeze_filter (unsigned char *buf, long int size, PFI reader)
    or 0 upon EOF.  */
 
 static long
-read_and_delete (unsigned char *buf, long int size, PFI not_used)
+read_and_delete (unsigned char *buf, long int size, PFL not_used)
 {
   long n_saved;
   static int hit_eof = 0;
@@ -1743,7 +1743,7 @@ read_and_delete (unsigned char *buf, long int size, PFI not_used)
    array `xlate'.  Return the number of characters read, or 0 upon EOF.  */
 
 static long
-read_and_xlate (unsigned char *buf, long int size, PFI not_used)
+read_and_xlate (unsigned char *buf, long int size, PFL not_used)
 {
   long chars_read = 0;
   static int hit_eof = 0;
@@ -1921,7 +1921,7 @@ without squeezing repeats"));
     {
       set_initialize (s1, complement, in_delete_set);
       set_initialize (s2, 0, in_squeeze_set);
-      squeeze_filter (io_buf, IO_BUF_SIZE, (PFI) read_and_delete);
+      squeeze_filter (io_buf, IO_BUF_SIZE, read_and_delete);
     }
   else if (translating)
     {
@@ -2010,7 +2010,7 @@ construct in string1 must be aligned with a corresponding construct\n\
       if (squeeze_repeats)
        {
          set_initialize (s2, 0, in_squeeze_set);
-         squeeze_filter (io_buf, IO_BUF_SIZE, (PFI) read_and_xlate);
+         squeeze_filter (io_buf, IO_BUF_SIZE, read_and_xlate);
        }
       else
        {