[beast: 10/24] TOOLS: use Rapicorn's printerr()



commit 38bb335b27a81e155cc6e4aba828ef4424e962de
Author: Tim Janik <timj gnu org>
Date:   Tue Sep 22 22:19:58 2015 +0200

    TOOLS: use Rapicorn's printerr()

 shell/bsescm.cc       |    6 +++---
 shell/bsescminterp.cc |    6 +++---
 tools/bsefcompare.cc  |   14 +++++++-------
 tools/bsefextract.cc  |   10 +++++-----
 tools/bseloopfuncs.cc |   24 ++++++++++++------------
 tools/bsewavetool.cc  |   10 +++++-----
 tools/cutvorbis.cc    |   20 ++++++++++----------
 tools/sfiutils.cc     |   10 +++++-----
 8 files changed, 50 insertions(+), 50 deletions(-)
---
diff --git a/shell/bsescm.cc b/shell/bsescm.cc
index 48133ef..a856c3d 100644
--- a/shell/bsescm.cc
+++ b/shell/bsescm.cc
@@ -70,7 +70,7 @@ main (int   argc,
       sfi_com_port_set_close_func (bse_scm_port, port_closed, NULL);
       if (!bse_scm_port->connected)
        {
-         g_printerr ("%s: failed to connect to pipe (%d, %d)\n", PRG_NAME, bse_scm_pipe[0], bse_scm_pipe[1]);
+         printerr ("%s: failed to connect to pipe (%d, %d)\n", PRG_NAME, bse_scm_pipe[0], bse_scm_pipe[1]);
          exit (BSE_EXIT_STATUS);
        }
       bse_scm_context = sfi_glue_encoder_context (bse_scm_port);
@@ -190,7 +190,7 @@ shell_parse_args (int *argc_p, char **argv)
          argv[i] = NULL;
          if (bse_scm_pipe[0] < 2 || bse_scm_pipe[1] < 2)
            {
-             g_printerr ("%s: invalid arguments supplied for: --bse-pipe <inpipe> <outpipe>\n", PRG_NAME);
+             printerr ("%s: invalid arguments supplied for: --bse-pipe <inpipe> <outpipe>\n", PRG_NAME);
              exit (BSE_EXIT_STATUS);
            }
        }
@@ -205,7 +205,7 @@ shell_parse_args (int *argc_p, char **argv)
          argv[i] = NULL;
          if (!bse_scm_eval_expr)
            {
-             g_printerr ("%s: invalid arguments supplied for: --bse-eval <expression>\n", PRG_NAME);
+             printerr ("%s: invalid arguments supplied for: --bse-eval <expression>\n", PRG_NAME);
              exit (BSE_EXIT_STATUS);
            }
        }
diff --git a/shell/bsescminterp.cc b/shell/bsescminterp.cc
index 90b1157..e2271df 100644
--- a/shell/bsescminterp.cc
+++ b/shell/bsescminterp.cc
@@ -136,7 +136,7 @@ bse_scm_enter_gc (SCM           *scm_gc_list,
   SCM s_cell = 0;
   assert_return (scm_gc_list != NULL);
   assert_return (free_func != NULL);
-  // g_printerr ("GCCell allocating %u bytes (%p).\n", size_hint, free_func);
+  // printerr ("GCCell allocating %u bytes (%p).\n", size_hint, free_func);
   gc_cell = g_new (BseScmGCCell, 1);
   gc_cell->data = data;
   gc_cell->free_func = free_func;
@@ -149,7 +149,7 @@ static SCM
 bse_scm_mark_gc_cell (SCM scm_gc_cell) /* called from any thread */
 {
   // BseScmGCCell *gc_cell = (BseScmGCCell*) SCM_CDR (scm_gc_cell);
-  // g_printerr ("GCCell mark %u bytes (%p).\n", gc_cell->size_hint, gc_cell->free_func);
+  // printerr ("GCCell mark %u bytes (%p).\n", gc_cell->size_hint, gc_cell->free_func);
   /* scm_gc_mark (gc_cell->something); */
   return SCM_BOOL_F;
 }
@@ -158,7 +158,7 @@ static scm_sizet
 bse_scm_free_gc_cell (SCM scm_gc_cell) /* called from any thread */
 {
   BseScmGCCell *gc_cell = SCM_GET_GLUE_GC_CELL (scm_gc_cell);
-  // g_printerr ("GCCell freeing %u bytes (%p).\n", size, gc_cell->free_func);
+  // printerr ("GCCell freeing %u bytes (%p).\n", size, gc_cell->free_func);
   gc_cell->free_func (gc_cell->data);
   g_free (gc_cell);
   return 0;
diff --git a/tools/bsefcompare.cc b/tools/bsefcompare.cc
index 95db6cf..c1ad26e 100644
--- a/tools/bsefcompare.cc
+++ b/tools/bsefcompare.cc
@@ -693,9 +693,9 @@ main (int argc, char **argv)
 
   if (file1.feature_values.size() != file2.feature_values.size())
     {
-      g_printerr ("%s: can't compare files\n", options.program_name.c_str());
-      g_printerr ("  * file \"%s\" contains %zd feature values\n", file1.filename.c_str(), 
file1.feature_values.size());
-      g_printerr ("  * file \"%s\" contains %zd feature values\n", file2.filename.c_str(), 
file2.feature_values.size());
+      printerr ("%s: can't compare files\n", options.program_name.c_str());
+      printerr ("  * file \"%s\" contains %zd feature values\n", file1.filename.c_str(), 
file1.feature_values.size());
+      printerr ("  * file \"%s\" contains %zd feature values\n", file2.filename.c_str(), 
file2.feature_values.size());
       exit (1);
     }
 
@@ -707,10 +707,10 @@ main (int argc, char **argv)
       double s = f1->similarity (f2);
       if (s < 0)
        {
-         g_printerr ("%s: can't compare features:\n", options.program_name.c_str());
-         g_printerr ("  * %s which is a %s from file \"%s\"\n",
+         printerr ("%s: can't compare features:\n", options.program_name.c_str());
+         printerr ("  * %s which is a %s from file \"%s\"\n",
                      f1->name.c_str(), f1->printable_type().c_str(), file1.filename.c_str());
-         g_printerr ("  * %s which is a %s from file \"%s\"\n",
+         printerr ("  * %s which is a %s from file \"%s\"\n",
                      f2->name.c_str(), f2->printable_type().c_str(), file2.filename.c_str());
          return 1;
        }
@@ -777,7 +777,7 @@ public:
     const FeatureValueVector *vec1 = static_cast<const FeatureValueVector *> (value1);
     const FeatureValueVector *vec2 = static_cast<const FeatureValueVector *> (value2);
 
-    g_printerr ("using custom TimingComparisionStrategy\n");
+    printerr ("using custom TimingComparisionStrategy\n");
 
     // the sizes of the two vectors can be different
     uint   size = min (vec1->data.size(), vec2->data.size());
diff --git a/tools/bsefextract.cc b/tools/bsefextract.cc
index ed8b495..5e75b04 100644
--- a/tools/bsefextract.cc
+++ b/tools/bsefextract.cc
@@ -93,7 +93,7 @@ public:
                                         &m_samples[have_samples]);
         if (r < 0)
           {
-            g_printerr ("error reading sample data\n");
+            printerr ("error reading sample data\n");
             exit (1);
           }
         have_samples += r;
@@ -377,7 +377,7 @@ struct SpectrumFeature : public Feature
                      vector< vector<double> >::const_iterator end,
                      double                                   normalize)
   {
-    const vector < double > empty_return; // this can't be inlined in g_return* due to a bug in g++-3.3
+    const vector < double > empty_return; // this can't be inlined as return-statement due to a bug in 
g++-3.3
     assert_return (end - start > 0, empty_return);
 
     vector<double> result (start->size());
@@ -1121,11 +1121,11 @@ struct TimingSlices
 
     if (options.verbose)
       {
-       g_printerr ("timing window (for attack and release detection):\n");
-       g_printerr ("  * size         %5.2f ms    %6u samples\n",
+       printerr ("timing window (for attack and release detection):\n");
+       printerr ("  * size         %5.2f ms    %6u samples\n",
          fft_size_samples / signal.mix_freq() * 1000,
          fft_size_samples);
-       g_printerr ("  * stepping     %5.2f ms    %6u samples\n",
+       printerr ("  * stepping     %5.2f ms    %6u samples\n",
          float (options.timing_window_stepping_ms),
          uint (options.timing_window_stepping_ms * signal.mix_freq() / 1000));
       }
diff --git a/tools/bseloopfuncs.cc b/tools/bseloopfuncs.cc
index 164165e..9324055 100644
--- a/tools/bseloopfuncs.cc
+++ b/tools/bseloopfuncs.cc
@@ -241,7 +241,7 @@ gsl_data_find_loop5 (GslDataHandle     *dhandle,
         }
     }
   gsl_progress_wipe (&pstate);
-  g_printerr ("  LOOP: %6llu - %6llu [%6llu] (block: %6llu - %6llu [%6llu]) (score:%+g at:%5.1f%%)\n",
+  printerr ("  LOOP: %6llu - %6llu [%6llu] (block: %6llu - %6llu [%6llu]) (score:%+g at:%5.1f%%)\n",
               config->loop_start, config->loop_start + config->loop_length, config->loop_length,
               bstart, bstart + blength, blength,
               config->score, score_pcount * 100.0 / pdist);
@@ -358,7 +358,7 @@ gsl_data_find_loop4 (GslDataHandle     *dhandle,
                              config->score, config->loop_length, lstart, llength);
       }
   gsl_progress_wipe (&pstate);
-  g_printerr ("  LOOP: %6llu - %6llu [%6llu] (block: %6llu - %6llu [%6llu]) (score:%+g at:%5.1f%%)\n",
+  printerr ("  LOOP: %6llu - %6llu [%6llu] (block: %6llu - %6llu [%6llu]) (score:%+g at:%5.1f%%)\n",
               config->loop_start, config->loop_start + config->loop_length, config->loop_length,
               bstart, bstart + blength, blength,
               config->score, score_pcount * 100.0 / pdist);
@@ -414,7 +414,7 @@ gsl_data_find_loop3 (GslDataHandle     *dhandle,
   cstart = block + config->block_length / 2;
   config->score = G_MAXDOUBLE;
   pcount = 0, pdist = (maxll * 1.0 - minll * 1.0 + 2.0) * (maxll * 1.0 - minll * 1.0 + 1.0) / 2.;
-  g_printerr ("pdist: %f\n", pdist);
+  printerr ("pdist: %f\n", pdist);
   for (sp = block; sp < cstart - minll; sp++)
     for (ep = sp + minll; ep < cstart; ep++)
       {
@@ -427,7 +427,7 @@ gsl_data_find_loop3 (GslDataHandle     *dhandle,
             found_loop = TRUE;
           }
         gsl_progress_notify (&pstate, ++pcount * 100.0 / pdist, "score:%+g (pos:%6lu)", config->score, sp - 
block);
-        // g_printerr ("processed: %7.3f (score:%+g)            \r", ++pcount * 100.0 / pdist, 
config->score);
+        // printerr ("processed: %7.3f (score:%+g)            \r", ++pcount * 100.0 / pdist, config->score);
       }
 
   g_free (block);
@@ -496,7 +496,7 @@ gsl_data_find_loop2 (GslDataHandle     *dhandle,
     }
   gsl_progress_wipe (&pstate);
   ll = config->loop_length;
-  g_printerr ("loop size: %llu\n", ll);
+  printerr ("loop size: %llu\n", ll);
 
   /* test every possible position */
   minll = ll;
@@ -505,7 +505,7 @@ gsl_data_find_loop2 (GslDataHandle     *dhandle,
   cstart = block + config->block_length / 2;
   config->score = G_MAXDOUBLE;
   pcount = 0, pdist = (maxll * 1.0 - minll * 1.0 + 2.0) * (maxll * 1.0 - minll * 1.0 + 1.0) / 2.;
-  g_printerr ("pdist: %f\n", pdist);
+  printerr ("pdist: %f\n", pdist);
   for (sp = block; sp < cstart - minll; sp++)
     {
       ep = sp + minll;
@@ -534,7 +534,7 @@ gsl_data_find_loop2 (GslDataHandle     *dhandle,
   cstart = block + config->block_length / 2;
   config->score = G_MAXDOUBLE;
   pcount = 0, pdist = (maxll * 1.0 - minll * 1.0 + 2.0) * (maxll * 1.0 - minll * 1.0 + 1.0) / 2.;
-  g_printerr ("pdist: %f\n", pdist);
+  printerr ("pdist: %f\n", pdist);
   for (sp = block + 99999; sp < cstart - minll; sp++)
     {
       for (ep = sp + minll; ep < cstart; ep++)
@@ -683,7 +683,7 @@ gsl_data_find_loop1 (GslDataHandle    *dhandle,
   gsl_progress_wipe (&pstate);
   if (!found_loop)
     goto seek_loop_done;
-  g_printerr ("  lLOOP: %6llu - %6llu [%6llu] (block: %6llu - %6llu [%6llu]) (score:%+g)\n",
+  printerr ("  lLOOP: %6llu - %6llu [%6llu] (block: %6llu - %6llu [%6llu]) (score:%+g)\n",
               config->loop_start, config->loop_start + config->loop_length, config->loop_length,
               config->block_start, config->block_start + config->block_length, config->block_length,
               config->score);
@@ -711,7 +711,7 @@ gsl_data_find_loop1 (GslDataHandle    *dhandle,
         }
     }
   gsl_progress_wipe (&pstate);
-  g_printerr ("  pLOOP: %6llu - %6llu [%6llu] (block: %6llu - %6llu [%6llu]) (weighted-frame-score:%+g)\n",
+  printerr ("  pLOOP: %6llu - %6llu [%6llu] (block: %6llu - %6llu [%6llu]) (weighted-frame-score:%+g)\n",
               config->loop_start, config->loop_start + config->loop_length, config->loop_length,
               config->block_start, config->block_start + config->block_length, config->block_length,
               config->score);
@@ -745,7 +745,7 @@ gsl_data_find_loop1 (GslDataHandle    *dhandle,
           gsl_progress_notify (&pstate, ++pcount * 100.0 / pdist, "frame-score:%+g", config->score);
         }
       gsl_progress_wipe (&pstate);
-      g_printerr ("  sLOOP: %6llu - %6llu [%6llu] (block: %6llu - %6llu [%6llu]) (frame[%d]-score:%+g)\n",
+      printerr ("  sLOOP: %6llu - %6llu [%6llu] (block: %6llu - %6llu [%6llu]) (frame[%d]-score:%+g)\n",
                   config->loop_start, config->loop_start + config->loop_length, config->loop_length,
                   config->block_start, config->block_start + config->block_length, config->block_length,
                   frame, config->score);
@@ -899,10 +899,10 @@ gsl_data_find_loop0 (GslDataHandle         *dhandle,
        {
          perc_count = 0;
          perc_val++;
-         g_printerr ("processed %llu%%       \r", perc_val);
+         printerr ("processed %llu%%       \r", perc_val);
        }
     }
-  g_printerr ("\nbest match (%s): len in samples=%lld, len=%lld, score=%f\n",
+  printerr ("\nbest match (%s): len in samples=%lld, len=%lld, score=%f\n",
              (cfg->cmp_strategy == GSL_DATA_TAIL_LOOP_CMP_CORRELATION) ? "correlation" : "least squares",
              bestloopsize, bestloopsize, bestscore);
 
diff --git a/tools/bsewavetool.cc b/tools/bsewavetool.cc
index b2516a5..d7e5e52 100644
--- a/tools/bsewavetool.cc
+++ b/tools/bsewavetool.cc
@@ -116,7 +116,7 @@ main (int   argc,
     }
 
   /* load wave file */
-  g_printerr ("LOAD: %s\n", input_file.c_str());
+  printerr ("LOAD: %s\n", input_file.c_str());
   Wave *wave = command->create ();
   Bse::ErrorType error = Bse::ERROR_NONE;
   if (!wave)
@@ -171,13 +171,13 @@ main (int   argc,
     }
 
   /* process */
-  g_printerr ("EXEC: %s\n", command_name.c_str());
+  printerr ("EXEC: %s\n", command_name.c_str());
   bool needs_saving = command->exec (wave);
 
   /* save */
   if (needs_saving)
     {
-      g_printerr ("SAVE: %s\n", output_file.c_str());
+      printerr ("SAVE: %s\n", output_file.c_str());
       wave->sort();
       error = wave->store (output_file);
       if (error)
@@ -816,7 +816,7 @@ public:
                   }
               }
             if (!silent_infos)
-              g_printerr ("chunk % 7.2f/%.0f, processed %0.1f%%       \r",
+              printerr ("chunk % 7.2f/%.0f, processed %0.1f%%       \r",
                           gsl_data_handle_osc_freq (chunk->dhandle), gsl_data_handle_mix_freq 
(chunk->dhandle),
                           n * 99.999999 / l);
           }
@@ -843,7 +843,7 @@ public:
         gsl_vorbis_encoder_destroy (enc);
         guint n_bytes = (gsl_data_handle_bit_depth (dhandle) + 7) / 8;
         if (!silent_infos)
-          g_printerr ("chunk % 7.2f/%.0f, processed %0.1f%% (reduced to: %5.2f%%)      \n",
+          printerr ("chunk % 7.2f/%.0f, processed %0.1f%% (reduced to: %5.2f%%)      \n",
                       gsl_data_handle_osc_freq (chunk->dhandle), gsl_data_handle_mix_freq (chunk->dhandle),
                   n * 100.0 / l, v * 100.0 / (l * MAX (1, n_bytes)));
         if (close (tmpfd) < 0)
diff --git a/tools/cutvorbis.cc b/tools/cutvorbis.cc
index 956eed3..691d876 100644
--- a/tools/cutvorbis.cc
+++ b/tools/cutvorbis.cc
@@ -79,11 +79,11 @@ main (int   argc,
   parse_args (&argc, &argv);
   if (argc != 3)
     {
-      g_printerr ("usage: cutvorbis infile.ogg [{-s|-k|-p} <cutpoint>] [-S <serialno>] outfile.ogg\n");
-      g_printerr ("  -S <serialno>  only process data from the Ogg/Vorbis stream with <serialno>\n");
-      g_printerr ("  -s <cutpoint>  cut the Ogg/Vorbis stream at sample <cutpoint>\n");
-      g_printerr ("  -k <cutpoint>  same as -s, but cut at vorbis packet boundary\n");
-      g_printerr ("  -p <cutpoint>  same as -s, but cut at ogg page boundary\n");
+      printerr ("usage: cutvorbis infile.ogg [{-s|-k|-p} <cutpoint>] [-S <serialno>] outfile.ogg\n");
+      printerr ("  -S <serialno>  only process data from the Ogg/Vorbis stream with <serialno>\n");
+      printerr ("  -s <cutpoint>  cut the Ogg/Vorbis stream at sample <cutpoint>\n");
+      printerr ("  -k <cutpoint>  same as -s, but cut at vorbis packet boundary\n");
+      printerr ("  -p <cutpoint>  same as -s, but cut at ogg page boundary\n");
       exit (1);
     }
   ifile = argv[1];
@@ -97,13 +97,13 @@ main (int   argc,
   ifd = open (ifile, O_RDONLY);
   if (ifd < 0)
     {
-      g_printerr ("Error: failed to open \"%s\": %s\n", ifile, g_strerror (errno));
+      printerr ("Error: failed to open \"%s\": %s\n", ifile, g_strerror (errno));
       exit (1);
     }
   ofd = open (ofile, O_CREAT | O_TRUNC | O_WRONLY, 0666);
   if (ofd < 0)
     {
-      g_printerr ("Error: failed to open \"%s\": %s\n", ofile, g_strerror (errno));
+      printerr ("Error: failed to open \"%s\": %s\n", ofile, g_strerror (errno));
       exit (1);
     }
 
@@ -119,7 +119,7 @@ main (int   argc,
           const char *errstr = g_strerror (errno);
           if (!errno && j == 0)
             errstr = "End of File";
-          g_printerr ("Error: failed to read from \"%s\": %s\n", ifile, errstr);
+          printerr ("Error: failed to read from \"%s\": %s\n", ifile, errstr);
           exit (1);
         }
       gsl_vorbis_cutter_write_ogg (cutter, j, buffer);
@@ -129,7 +129,7 @@ main (int   argc,
       while (j < 0 && errno == EINTR);
       if (j < 0)
         {
-          g_printerr ("Error: failed to write to \"%s\": %s\n", ofile, g_strerror (errno));
+          printerr ("Error: failed to write to \"%s\": %s\n", ofile, g_strerror (errno));
           exit (1);
         }
     }
@@ -137,7 +137,7 @@ main (int   argc,
   close (ifd);
   if (close (ofd) < 0)
     {
-      g_printerr ("Error: failed to flush \"%s\": %s\n", ofile, g_strerror (errno));
+      printerr ("Error: failed to flush \"%s\": %s\n", ofile, g_strerror (errno));
       exit (1);
     }
   printout ("done\n");
diff --git a/tools/sfiutils.cc b/tools/sfiutils.cc
index 33a16c7..5688155 100644
--- a/tools/sfiutils.cc
+++ b/tools/sfiutils.cc
@@ -149,18 +149,18 @@ parse_arguments (gint              *argc_p,
   if (unknown_short || missing < n_arguments || extraneous < n_arguments || extraneous_arg)
     {
       if (unknown_short)
-        g_printerr ("unknown short options: \"%s\"\n", unknown_short);
+        printerr ("unknown short options: \"%s\"\n", unknown_short);
       if (missing < n_arguments)
         if (arguments[missing].long_opt)
-          g_printerr ("missing option argument for \"--%s\"\n", arguments[missing].long_opt);
+          printerr ("missing option argument for \"--%s\"\n", arguments[missing].long_opt);
         else
-          g_printerr ("missing option argument for \"-%c\"\n", arguments[missing].short_opt);
+          printerr ("missing option argument for \"-%c\"\n", arguments[missing].short_opt);
       else
         ;
       if (extraneous < n_arguments)
-        g_printerr ("extraneous argument to option \"%s\"\n", arguments[extraneous].long_opt);
+        printerr ("extraneous argument to option \"%s\"\n", arguments[extraneous].long_opt);
       if (extraneous_arg)
-        g_printerr ("extraneous argument: \"%s\"\n", extraneous_arg);
+        printerr ("extraneous argument: \"%s\"\n", extraneous_arg);
       exit (127);
     }
 


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