[beast] TOOLS: compile C sources as C++ sources



commit 27d2faec3d5a15d65003ee4b8c5b3c0e410f8dd7
Author: Stefan Westerfeld <stefan space twc de>
Date:   Tue May 10 12:19:05 2011 +0200

    TOOLS: compile C sources as C++ sources

 tools/Makefile.am                         |   10 +++++-----
 tools/{bseloopfuncs.c => bseloopfuncs.cc} |   18 +++++++++---------
 tools/{bseloopfuncs.h => bseloopfuncs.hh} |    0
 tools/bsewavetool.hh                      |    2 +-
 tools/{cutvorbis.c => cutvorbis.cc}       |    0
 tools/{magictest.c => magictest.cc}       |    2 +-
 tools/{mathtool.c => mathtool.cc}         |    6 +++---
 tools/{sfiutils.c => sfiutils.cc}         |    0
 tools/{sfiutils.h => sfiutils.hh}         |    0
 9 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/tools/Makefile.am b/tools/Makefile.am
index e0a51c2..180adfe 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -17,12 +17,12 @@ progs_ldadd     = $(top_builddir)/bse/libbse.la $(BSE_LIBS)
 #
 
 bin_PROGRAMS        = bsewavetool
-bsewavetool_SOURCES = bsewavetool.cc bwtwave.cc bseloopfuncs.c
+bsewavetool_SOURCES = bsewavetool.cc bwtwave.cc bseloopfuncs.cc
 bsewavetool_LDADD   = $(progs_ldadd)
-EXTRA_DIST         += bsewavetool.hh bwtwave.hh bseloopfuncs.h sfiutils.h
+EXTRA_DIST         += bsewavetool.hh bwtwave.hh bseloopfuncs.hh sfiutils.hh
 
 noinst_PROGRAMS  += cutvorbis
-cutvorbis_SOURCES = cutvorbis.c cxxdummy.cc
+cutvorbis_SOURCES = cutvorbis.cc cxxdummy.cc
 cutvorbis_LDADD   = $(progs_ldadd)
 
 noinst_PROGRAMS    += bsefextract
@@ -34,11 +34,11 @@ bsefcompare_SOURCES = bsefcompare.cc
 bsefcompare_LDADD   = $(progs_ldadd)
 
 noinst_PROGRAMS  += magictest
-magictest_SOURCES = magictest.c cxxdummy.cc
+magictest_SOURCES = magictest.cc cxxdummy.cc
 magictest_LDADD   = $(progs_ldadd)
 
 noinst_PROGRAMS += mathtool
-mathtool_SOURCES = mathtool.c cxxdummy.cc
+mathtool_SOURCES = mathtool.cc cxxdummy.cc
 mathtool_LDADD   = $(progs_ldadd)
 
 # === Bsewavetool tests ===
diff --git a/tools/bseloopfuncs.c b/tools/bseloopfuncs.cc
similarity index 98%
rename from tools/bseloopfuncs.c
rename to tools/bseloopfuncs.cc
index 85c376c..743297d 100644
--- a/tools/bseloopfuncs.c
+++ b/tools/bseloopfuncs.cc
@@ -14,7 +14,7 @@
  * A copy of the GNU Lesser General Public License should ship along
  * with this library; if not, see http://www.gnu.org/copyleft/.
  */
-#include "bseloopfuncs.h"
+#include "bseloopfuncs.hh"
 #include <bse/gsldatacache.h>
 #include <string.h>
 #include <signal.h>    /* G_BREAKPOINT() */
@@ -601,12 +601,12 @@ dcache_headloop_score (GslDataCache     *dcache,
       if (lnode->offset > lstart + l || lstart + l >= lnode->offset + node_size)
 	{
 	  gsl_data_cache_unref_node (dcache, lnode);
-	  lnode = *lnp = gsl_data_cache_ref_node (dcache, lstart + l, TRUE);
+	  lnode = *lnp = gsl_data_cache_ref_node (dcache, lstart + l, GSL_DATA_CACHE_DEMAND_LOAD);
 	}
       if (cnode->offset > cstart + i || cstart + i >= cnode->offset + node_size)
 	{
 	  gsl_data_cache_unref_node (dcache, cnode);
-	  cnode = *cnp = gsl_data_cache_ref_node (dcache, cstart + i, TRUE);
+	  cnode = *cnp = gsl_data_cache_ref_node (dcache, cstart + i, GSL_DATA_CACHE_DEMAND_LOAD);
 	}
       cdiff = cstart + i - cnode->offset;
       ldiff = lstart + l - lnode->offset;
@@ -669,8 +669,8 @@ gsl_data_find_loop1 (GslDataHandle    *dhandle,
   gsl_data_handle_close (dhandle);
   gsl_data_cache_unref (dcache);
 
-  dnode1 = gsl_data_cache_ref_node (dcache, config->block_start, TRUE);
-  dnode2 = gsl_data_cache_ref_node (dcache, config->block_start, TRUE);
+  dnode1 = gsl_data_cache_ref_node (dcache, config->block_start, GSL_DATA_CACHE_DEMAND_LOAD);
+  dnode2 = gsl_data_cache_ref_node (dcache, config->block_start, GSL_DATA_CACHE_DEMAND_LOAD);
 
   /* widen loop, keeping it end-aligned to cstart
    *      |------------##########|--------------------|......
@@ -797,8 +797,8 @@ tailloop_score (GslDataCache          *dcache,
   while (looppos < loopstart)
     looppos += loopsize;
 
-  snode = gsl_data_cache_ref_node (dcache, loopstart - compare, TRUE);
-  lnode = gsl_data_cache_ref_node (dcache, looppos, TRUE);
+  snode = gsl_data_cache_ref_node (dcache, loopstart - compare, GSL_DATA_CACHE_DEMAND_LOAD);
+  lnode = gsl_data_cache_ref_node (dcache, looppos, GSL_DATA_CACHE_DEMAND_LOAD);
   for (i = loopstart - compare; i < loopstart;)
     {
       GslLong sdiff, ldiff, slen, llen, loop_len, compare_len, j;
@@ -807,12 +807,12 @@ tailloop_score (GslDataCache          *dcache,
       if (snode->offset > i || i >= snode->offset + node_size)
 	{
 	  gsl_data_cache_unref_node (dcache, snode);
-	  snode = gsl_data_cache_ref_node (dcache, i, TRUE);
+	  snode = gsl_data_cache_ref_node (dcache, i, GSL_DATA_CACHE_DEMAND_LOAD);
 	}
       if (lnode->offset > looppos || looppos >= lnode->offset + node_size)
 	{
 	  gsl_data_cache_unref_node (dcache, lnode);
-	  lnode = gsl_data_cache_ref_node (dcache, looppos, TRUE);
+	  lnode = gsl_data_cache_ref_node (dcache, looppos, GSL_DATA_CACHE_DEMAND_LOAD);
 	}
       sdiff = i - snode->offset;
       ldiff = looppos - lnode->offset;
diff --git a/tools/bseloopfuncs.h b/tools/bseloopfuncs.hh
similarity index 100%
rename from tools/bseloopfuncs.h
rename to tools/bseloopfuncs.hh
diff --git a/tools/bsewavetool.hh b/tools/bsewavetool.hh
index 80eb366..8664e97 100644
--- a/tools/bsewavetool.hh
+++ b/tools/bsewavetool.hh
@@ -16,7 +16,7 @@
  */
 #include <bse/gsldatahandle.h>
 #include <bse/gslwavechunk.h>
-#include "bseloopfuncs.h"
+#include "bseloopfuncs.hh"
 #include "bwtwave.hh"
 #include <typeinfo>
 #include <string>
diff --git a/tools/cutvorbis.c b/tools/cutvorbis.cc
similarity index 100%
rename from tools/cutvorbis.c
rename to tools/cutvorbis.cc
diff --git a/tools/magictest.c b/tools/magictest.cc
similarity index 98%
rename from tools/magictest.c
rename to tools/magictest.cc
index 8f4fe36..b970172 100644
--- a/tools/magictest.c
+++ b/tools/magictest.cc
@@ -105,7 +105,7 @@ main (gint   argc,
                   if (test_open)
                     {
                       BseWaveFileInfo *wfi;
-                      BseErrorType error = 0;
+                      BseErrorType error = BSE_ERROR_NONE;
                       g_print ("\n  LOADER: %s\n", loader->name);
                       wfi = bse_wave_file_info_load (argv[i], &error);
                       if (wfi)
diff --git a/tools/mathtool.c b/tools/mathtool.cc
similarity index 99%
rename from tools/mathtool.c
rename to tools/mathtool.cc
index 40f56e7..48d6e45 100644
--- a/tools/mathtool.c
+++ b/tools/mathtool.cc
@@ -681,7 +681,7 @@ print_int_ring (SfiRing *ring)
   SfiRing *node;
   g_print ("{");
   for (node = ring; node; node = sfi_ring_walk (node, ring))
-    g_print ("%c", (gint) node->data);
+    g_print ("%c", (gint) (long) node->data);
   g_print ("}");
 }
 
@@ -690,8 +690,8 @@ ints_cmp (gconstpointer d1,
 	  gconstpointer d2,
           gpointer      data)
 {
-  gint i1 = (gint) d1;
-  gint i2 = (gint) d2;
+  gint i1 = (gint) (long) d1;
+  gint i2 = (gint) (long) d2;
   return i1 - i2;
 }
 
diff --git a/tools/sfiutils.c b/tools/sfiutils.cc
similarity index 100%
rename from tools/sfiutils.c
rename to tools/sfiutils.cc
diff --git a/tools/sfiutils.h b/tools/sfiutils.hh
similarity index 100%
rename from tools/sfiutils.h
rename to tools/sfiutils.hh



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