summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-12-04 14:08:54 +0100
committerJim Meyering <meyering@redhat.com>2011-12-05 22:49:34 +0100
commitd72e8dff0487d804c09edb6a166b4e90dddf6063 (patch)
tree8d01c6accbfdf3afc36e201bcf0389f3520eda3d
parent787592587d0a1cfac77d31c7808fc0b0a04a0334 (diff)
downloadcoreutils-d72e8dff0487d804c09edb6a166b4e90dddf6063.tar.xz
maint: sort, stat: remove unused parameters
* src/sort.c (struct thread_args) [is_lo_child]: Remove member. (sortlines): Remove unused parameter, "is_lo_child". Update callers. * src/stat.c (out_epoch_sec): Mark unused parameter. (do_statfs, do_stat): Remove unused parameter, "terse". Update callers.
-rw-r--r--src/sort.c15
-rw-r--r--src/stat.c11
2 files changed, 12 insertions, 14 deletions
diff --git a/src/sort.c b/src/sort.c
index 4a87148e2..1813270bd 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -3488,7 +3488,7 @@ merge_loop (struct merge_node_queue *queue,
static void sortlines (struct line *restrict, size_t, size_t,
- struct merge_node *, bool, struct merge_node_queue *,
+ struct merge_node *, struct merge_node_queue *,
FILE *, char const *);
/* Thread arguments for sortlines_thread. */
@@ -3509,9 +3509,6 @@ struct thread_args
to this node's parent. */
struct merge_node *const node;
- /* True if this node is sorting the lower half of the parent's work. */
- bool is_lo_child;
-
/* The priority queue controlling available work for the entire
internal sort. */
struct merge_node_queue *const queue;
@@ -3529,7 +3526,7 @@ sortlines_thread (void *data)
{
struct thread_args const *args = data;
sortlines (args->lines, args->nthreads, args->total_lines,
- args->node, args->is_lo_child, args->queue, args->tfp,
+ args->node, args->queue, args->tfp,
args->output_temp);
return NULL;
}
@@ -3560,7 +3557,7 @@ sortlines_thread (void *data)
static void
sortlines (struct line *restrict lines, size_t nthreads,
- size_t total_lines, struct merge_node *node, bool is_lo_child,
+ size_t total_lines, struct merge_node *node,
struct merge_node_queue *queue, FILE *tfp, char const *temp_output)
{
size_t nlines = node->nlo + node->nhi;
@@ -3570,13 +3567,13 @@ sortlines (struct line *restrict lines, size_t nthreads,
size_t hi_threads = nthreads - lo_threads;
pthread_t thread;
struct thread_args args = {lines, lo_threads, total_lines,
- node->lo_child, true, queue, tfp, temp_output};
+ node->lo_child, queue, tfp, temp_output};
if (nthreads > 1 && SUBTHREAD_LINES_HEURISTIC <= nlines
&& pthread_create (&thread, NULL, sortlines_thread, &args) == 0)
{
sortlines (lines - node->nlo, hi_threads, total_lines,
- node->hi_child, false, queue, tfp, temp_output);
+ node->hi_child, queue, tfp, temp_output);
pthread_join (thread, NULL);
}
else
@@ -3871,7 +3868,7 @@ sort (char *const *files, size_t nfiles, char const *output_file,
struct merge_node *root = merge_tree + 1;
sortlines (line, nthreads, buf.nlines, root,
- true, &queue, tfp, temp_output);
+ &queue, tfp, temp_output);
queue_destroy (&queue);
pthread_mutex_destroy (&root->lock);
merge_tree_destroy (merge_tree);
diff --git a/src/stat.c b/src/stat.c
index 4e5dbcef7..0f87dfdfa 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -550,7 +550,8 @@ out_minus_zero (char *pformat, size_t prefix_len)
/* Output the number of seconds since the Epoch, using a format that
acts like printf's %f format. */
static void
-out_epoch_sec (char *pformat, size_t prefix_len, struct stat const *statbuf,
+out_epoch_sec (char *pformat, size_t prefix_len,
+ struct stat const *statbuf ATTRIBUTE_UNUSED,
struct timespec arg)
{
char *dot = memchr (pformat, '.', prefix_len);
@@ -1159,7 +1160,7 @@ print_it (char const *format, char const *filename,
/* Stat the file system and print what we find. */
static bool ATTRIBUTE_WARN_UNUSED_RESULT
-do_statfs (char const *filename, bool terse, char const *format)
+do_statfs (char const *filename, char const *format)
{
STRUCT_STATVFS statfsbuf;
@@ -1183,7 +1184,7 @@ do_statfs (char const *filename, bool terse, char const *format)
/* stat the file and print what we find */
static bool ATTRIBUTE_WARN_UNUSED_RESULT
-do_stat (char const *filename, bool terse, char const *format,
+do_stat (char const *filename, char const *format,
char const *format2)
{
struct stat statbuf;
@@ -1479,8 +1480,8 @@ main (int argc, char *argv[])
for (i = optind; i < argc; i++)
ok &= (fs
- ? do_statfs (argv[i], terse, format)
- : do_stat (argv[i], terse, format, format2));
+ ? do_statfs (argv[i], format)
+ : do_stat (argv[i], format, format2));
exit (ok ? EXIT_SUCCESS : EXIT_FAILURE);
}