[beast: 15/18] TOOLS: fix signedness compiler warnings



commit 93ebcfa2cff1e6ae3b2cd3904b46588db964d7d0
Author: Tim Janik <timj gnu org>
Date:   Thu Sep 24 21:50:56 2015 +0200

    TOOLS: fix signedness compiler warnings

 tools/bsefextract.cc  |    6 +++---
 tools/bseloopfuncs.cc |    8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/tools/bsefextract.cc b/tools/bsefextract.cc
index 5e75b04..1c2d391 100644
--- a/tools/bsefextract.cc
+++ b/tools/bsefextract.cc
@@ -86,7 +86,7 @@ public:
     m_offset = 0;
 
     m_samples.resize (m_length);
-    size_t have_samples = 0;
+    ssize_t have_samples = 0;
     while (have_samples < m_length)
       {
         int64 r = gsl_data_handle_read (data_handle, have_samples, MIN (m_length - have_samples, 4096 * 
m_n_channels),
@@ -1168,8 +1168,8 @@ struct TimingSlices
      * at a sufficiently large null slice (where sufficiently large may be 0,
      * if both slices were out of the range for which features have been extracted) */
     vector<double> null_slice;
-    vector<double>& s1 = (slice1 >= 0 && slice1 < slices.size()) ? slices[slice1] : null_slice;
-    vector<double>& s2 = (slice2 >= 0 && slice2 < slices.size()) ? slices[slice2] : null_slice;
+    vector<double>& s1 = (slice1 >= 0 && slice1 < (ssize_t) slices.size()) ? slices[slice1] : null_slice;
+    vector<double>& s2 = (slice2 >= 0 && slice2 < (ssize_t) slices.size()) ? slices[slice2] : null_slice;
     null_slice.resize (max (s1.size(), s2.size()));
 
     double sf = 0;
diff --git a/tools/bseloopfuncs.cc b/tools/bseloopfuncs.cc
index 9324055..3e34eca 100644
--- a/tools/bseloopfuncs.cc
+++ b/tools/bseloopfuncs.cc
@@ -569,7 +569,7 @@ dcache_headloop_score (GslDataCache     *dcache,
                        GslDataCacheNode **cnp,
                        gboolean           weighted)
 {
-  gsize node_size = GSL_DATA_CACHE_NODE_SIZE (dcache);
+  ssize_t node_size = GSL_DATA_CACHE_NODE_SIZE (dcache);
   GslDataCacheNode *lnode = *lnp, *cnode = *cnp;
   gdouble wmax = clength, score = 0.0;
   GslLong i = 0, loop_length = cstart - lstart;
@@ -768,8 +768,8 @@ tailloop_score (GslDataCache          *dcache,
                GslLong                loopsize,
                gfloat                 worstscore)
 {
-  gsize node_size = GSL_DATA_CACHE_NODE_SIZE (dcache);
-  GslLong looppos, i, compare = cfg->pre_loop_compare;
+  ssize_t node_size = GSL_DATA_CACHE_NODE_SIZE (dcache);
+  GslLong looppos, compare = cfg->pre_loop_compare;
   gfloat score = 0.0;
   GslDataCacheNode *snode, *lnode;
 
@@ -784,7 +784,7 @@ tailloop_score (GslDataCache          *dcache,
 
   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;)
+  for (ssize_t i = loopstart - compare; i < loopstart;)
     {
       GslLong sdiff, ldiff, slen, llen, loop_len, compare_len, j;
       gfloat *sb, *lb;


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