coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] maint: sort, stat: remove unused parameters


From: Jim Meyering
Subject: [PATCH] maint: sort, stat: remove unused parameters
Date: Sun, 04 Dec 2011 14:09:47 +0100

More gcc warnings fallout:

>From fd75178fa8f1deeef72b375a19870e7464f5f393 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 4 Dec 2011 14:08:54 +0100
Subject: [PATCH] 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.
---
 src/sort.c |   15 ++++++---------
 src/stat.c |   11 ++++++-----
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/src/sort.c b/src/sort.c
index 4a87148..1813270 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 4e5dbce..0f87dfd 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);
 }
--
1.7.8



reply via email to

[Prev in Thread] Current Thread [Next in Thread]