summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1993-05-07 03:09:55 +0000
committerJim Meyering <jim@meyering.net>1993-05-07 03:09:55 +0000
commit9a96f7c461a5c7c53639d3f84bd446a6959aa1a9 (patch)
treedf4468282d2a175bdfabcb9001f30b18f9686329 /src
parentf7999d7584ad787f4e7432b7ad76cc3486bc7b0b (diff)
downloadcoreutils-9a96f7c461a5c7c53639d3f84bd446a6959aa1a9.tar.xz
merge with 1.5
Diffstat (limited to 'src')
-rw-r--r--src/cat.c8
-rw-r--r--src/csplit.c9
-rw-r--r--src/od.c8
-rw-r--r--src/split.c2
-rw-r--r--src/tr.c10
-rw-r--r--src/wc.c10
6 files changed, 19 insertions, 28 deletions
diff --git a/src/cat.c b/src/cat.c
index 044c9a971..98da7c971 100644
--- a/src/cat.c
+++ b/src/cat.c
@@ -74,12 +74,8 @@ static int newlines2 = 0;
static int exit_stat = 0;
static void
-usage (reason)
- char *reason;
+usage ()
{
- if (reason != NULL)
- fprintf (stderr, "%s: %s\n", program_name, reason);
-
fprintf (stderr, "\
Usage: %s [-benstuvAET] [--number] [--number-nonblank] [--squeeze-blank]\n\
[--show-nonprinting] [--show-ends] [--show-tabs] [--show-all]\n\
@@ -224,7 +220,7 @@ main (argc, argv)
break;
default:
- usage ((char *) 0);
+ usage ();
}
}
diff --git a/src/csplit.c b/src/csplit.c
index e5b6ed68d..eaea8c314 100644
--- a/src/csplit.c
+++ b/src/csplit.c
@@ -599,7 +599,6 @@ static struct cstring *
remove_line ()
{
struct cstring *line; /* Return value. */
- unsigned line_got; /* Number of the line retrieved. */
struct line *l; /* For convenience. */
if (head == NULL && !load_buffer ())
@@ -608,7 +607,7 @@ remove_line ()
if (current_line < head->first_available)
current_line = head->first_available;
- line_got = head->first_available++;
+ ++(head->first_available);
l = head->curr_line;
@@ -1076,13 +1075,11 @@ string_to_number (result, num)
/* Check if there is a numeric offset after a regular expression.
STR is the entire command line argument.
- ARGNUM is the index in ARGV of STR.
P is the control record for this regular expression.
NUM is the numeric part of STR. */
static void
-check_for_offset (argnum, p, str, num)
- int argnum;
+check_for_offset (p, str, num)
struct control *p;
char *str;
char *num;
@@ -1163,7 +1160,7 @@ extract_regexp (argnum, ignore, str)
}
if (closing_delim[1])
- check_for_offset (argnum, p, str, closing_delim + 1);
+ check_for_offset (p, str, closing_delim + 1);
return p;
}
diff --git a/src/od.c b/src/od.c
index a6967d1fb..ea4f12b39 100644
--- a/src/od.c
+++ b/src/od.c
@@ -43,7 +43,7 @@ char *alloca ();
#include <float.h>
#endif
-#if defined (__GNUC__) || defined (HAVE_LONG_DOUBLE)
+#ifdef HAVE_LONG_DOUBLE
typedef long double LONG_DOUBLE;
#else
typedef double LONG_DOUBLE;
@@ -553,7 +553,7 @@ print_double (n_bytes, block, fmt_string)
}
}
-#if defined (__GNUC__) || defined (HAVE_LONG_DOUBLE)
+#ifdef HAVE_LONG_DOUBLE
static void
print_long_double (n_bytes, block, fmt_string)
long unsigned int n_bytes;
@@ -885,7 +885,7 @@ decode_one_format (s, next, tspec)
DBL_DIG + 8, DBL_DIG);
break;
-#if defined (__GNUC__) || defined (HAVE_LONG_DOUBLE)
+#ifdef HAVE_LONG_DOUBLE
case FP_LONG_DOUBLE:
print_function = print_long_double;
pre_fmt_string = "%%%d.%dle%%c";
@@ -1808,7 +1808,6 @@ main (argc, argv)
if (flag_compatibility)
{
long int offset;
- int usage_error = 0;
if (n_files == 1)
{
@@ -1840,7 +1839,6 @@ main (argc, argv)
}
else
{
- usage_error = 1;
error (0, 0,
"invalid second operand in compatibility mode `%s'",
argv[optind + 1]);
diff --git a/src/split.c b/src/split.c
index 07b37aef9..addddd982 100644
--- a/src/split.c
+++ b/src/split.c
@@ -188,7 +188,7 @@ main (argc, argv)
fprintf (stderr, "%s\n", version_string);
if (flag_help)
- usage ();
+ usage ((char *)0);
/* Handle default case. */
if (split_type == type_undef)
diff --git a/src/tr.c b/src/tr.c
index 9010f4500..f2a3fac76 100644
--- a/src/tr.c
+++ b/src/tr.c
@@ -371,7 +371,7 @@ is_char_class_member (char_class, c)
case CC_XDIGIT:
return ISXDIGIT (c);
break;
- case CC_NO_CLASS:
+ default:
abort ();
break;
}
@@ -1759,15 +1759,15 @@ deleting and squeezing repeats");
{
if (!in_s1[i])
{
- int c = get_next (s2, NULL);
- assert (c != -1 || truncate_set1);
- if (c == -1)
+ int ch = get_next (s2, NULL);
+ assert (ch != -1 || truncate_set1);
+ if (ch == -1)
{
/* This will happen when tr is invoked like e.g.
tr -cs A-Za-z0-9 '\012'. */
break;
}
- xlate[i] = c;
+ xlate[i] = ch;
}
}
assert (get_next (s2, NULL) == -1 || truncate_set1);
diff --git a/src/wc.c b/src/wc.c
index 678e179ae..22aa53333 100644
--- a/src/wc.c
+++ b/src/wc.c
@@ -234,23 +234,23 @@ wc (fd, file)
}
static void
-write_counts (lc, wc, cc, file)
- unsigned long lc, wc, cc;
+write_counts (lines, words, chars, file)
+ unsigned long lines, words, chars;
char *file;
{
if (print_lines)
- printf ("%7lu", lc);
+ printf ("%7lu", lines);
if (print_words)
{
if (print_lines)
putchar (' ');
- printf ("%7lu", wc);
+ printf ("%7lu", words);
}
if (print_chars)
{
if (print_lines || print_words)
putchar (' ');
- printf ("%7lu", cc);
+ printf ("%7lu", chars);
}
if (*file)
printf (" %s", file);