]> Savannah Git Hosting - gnulib.git/commitdiff
bitset: Avoid newlines at the end of translatable strings.
authorBruno Haible <bruno@clisp.org>
Sun, 25 Feb 2024 14:48:47 +0000 (15:48 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 25 Feb 2024 14:48:47 +0000 (15:48 +0100)
* lib/bitset/stats.c (bitset_percent_histogram_print,
bitset_log_histogram_print): Print a newline after msg.
(bitset_stats_print_1): Don't include a newline in the argument of
bitset_percent_histogram_print or bitset_log_histogram_print.
(bitset_stats_print): Move newlines outside of translatable strings.

ChangeLog
lib/bitset/stats.c

index 1910933eb7f89c9ad44faefacd1ccda0fcb198a0..511a9f247e0337a83b8b8f8031d5412722a68f43 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-02-25  Bruno Haible  <bruno@clisp.org>
+
+       bitset: Avoid newlines at the end of translatable strings.
+       * lib/bitset/stats.c (bitset_percent_histogram_print,
+       bitset_log_histogram_print): Print a newline after msg.
+       (bitset_stats_print_1): Don't include a newline in the argument of
+       bitset_percent_histogram_print or bitset_log_histogram_print.
+       (bitset_stats_print): Move newlines outside of translatable strings.
+
 2024-02-24  Collin Funk  <collin.funk1@gmail.com>
 
        gnulib-tool.py: Follow gnulib-tool changes, part 28.
index a32b0cfd087108a73a460519623aee7ddbe01233..5c40fc946627dc16c5af47e2bb2cfda60cadd3d7 100644 (file)
@@ -115,7 +115,7 @@ bitset_percent_histogram_print (FILE *file, const char *name, const char *msg,
   if (!total)
     return;
 
-  fprintf (file, "%s %s", name, msg);
+  fprintf (file, "%s %s\n", name, msg);
   for (unsigned i = 0; i < n_bins; i++)
     fprintf (file, "%.0f-%.0f%%\t%8u (%5.1f%%)\n",
              i * 100.0 / n_bins,
@@ -147,7 +147,7 @@ bitset_log_histogram_print (FILE *file, const char *name, const char *msg,
   /* 2 * ceil (log10 (2) * (N - 1)) + 1.  */
   unsigned max_width = 2 * (unsigned) (0.30103 * (n_bins - 1) + 0.9999) + 1;
 
-  fprintf (file, "%s %s", name, msg);
+  fprintf (file, "%s %s\n", name, msg);
   {
     unsigned i;
     for (i = 0; i < 2; i++)
@@ -195,13 +195,13 @@ bitset_stats_print_1 (FILE *file, const char *name,
 
   fprintf (file, _("%u bitset_lists\n"), stats->lists);
 
-  bitset_log_histogram_print (file, name, _("count log histogram\n"),
+  bitset_log_histogram_print (file, name, _("count log histogram"),
                               BITSET_LOG_COUNT_BINS, stats->list_counts);
 
-  bitset_log_histogram_print (file, name, _("size log histogram\n"),
+  bitset_log_histogram_print (file, name, _("size log histogram"),
                               BITSET_LOG_SIZE_BINS, stats->list_sizes);
 
-  bitset_percent_histogram_print (file, name, _("density histogram\n"),
+  bitset_percent_histogram_print (file, name, _("density histogram"),
                                   BITSET_DENSITY_BINS, stats->list_density);
 }
 
@@ -213,10 +213,13 @@ bitset_stats_print (FILE *file, MAYBE_UNUSED bool verbose)
   if (!bitset_stats_info)
     return;
 
-  fprintf (file, _("Bitset statistics:\n\n"));
+  fprintf (file, "%s\n\n", _("Bitset statistics:"));
 
   if (bitset_stats_info->runs > 1)
-    fprintf (file, _("Accumulated runs = %u\n"), bitset_stats_info->runs);
+    {
+      fprintf (file, _("Accumulated runs = %u"), bitset_stats_info->runs);
+      fputc ('\n', file);
+    }
 
   for (int i = 0; i < BITSET_TYPE_NUM; i++)
     bitset_stats_print_1 (file, bitset_type_names[i],
@@ -260,7 +263,7 @@ bitset_stats_read (const char *file_name)
           if (ferror (file))
             perror (_("cannot read stats file"));
           else
-            fprintf (stderr, _("bad stats file size\n"));
+            fprintf (stderr, "%s\n", _("bad stats file size"));
         }
       if (fclose (file) != 0)
         perror (_("cannot read stats file"));