Changeset 1418 for trunk


Ignore:
Timestamp:
Oct 25, 2011, 3:00:49 AM (9 years ago)
Author:
Peter Johansson
Message:

avoid warnings (-Wall)

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/AddStats.cc

    r1280 r1418  
    7272        if (*rev_iter==svn_blame.revision()) {
    7373          author = svn_blame.author();
    74           assert(lt<add_vec.size());
     74          assert(static_cast<size_t>(lt)<add_vec.size());
    7575          ++add_vec[lt];
    7676        }
     
    9393        // add add_vec[lt] to current value
    9494        vec.set(*rev_iter, vec[*rev_iter] + add_vec[lt]);
    95         assert(data[lt][author][*rev_iter] >= add_vec[lt]);
     95        assert(static_cast<size_t>(data[lt][author][*rev_iter])>=add_vec[lt]);
    9696      }
    9797    }
  • trunk/lib/BlameStats.cc

    r1209 r1418  
    8181      while (svn_blame.valid()) {
    8282        int lt = parser.parse(svn_blame.line());
    83         assert(lt<data.size());
     83        assert(static_cast<size_t>(lt)<data.size());
    8484        SparseVector& vec = data[lt][svn_blame.author()];
    8585        vec.set(*rev_iter, vec[*rev_iter] + 1);
     
    9696    if (stats_.size()<data.size())
    9797      stats_.resize(data.size());
    98     for (int lt =0; lt<data.size(); ++lt) {
     98    for (size_t lt =0; lt<data.size(); ++lt) {
    9999      // just to avoid long long lines
    100100      typedef std::map<std::string,SparseVector>::const_iterator const_iterator;
  • trunk/lib/ClassicStats.cc

    r1280 r1418  
    6868    while (svn_blame.valid()) {
    6969      LineTypeParser::line_type lt = parser.parse(svn_blame.line());
    70       assert(lt<data.size());
     70      assert(static_cast<size_t>(lt)<data.size());
    7171      SparseVector& vec = data[lt][svn_blame.author()];
    7272      vec.set(svn_blame.revision(), vec[svn_blame.revision()] + 1);
  • trunk/lib/FilePrinter.cc

    r1330 r1418  
    119119    else {
    120120      first = Graph::dates()[Graph::rev_min()];
    121       assert(Graph::rev_max()<Graph::dates().size());
     121      assert(static_cast<size_t>(Graph::rev_max()) < Graph::dates().size());
    122122      last = Graph::dates()[Graph::rev_max()];
    123123    }
  • trunk/lib/Functor.h

    r1267 r1418  
    166166    {
    167167      x += p.second;
     168      return x;
    168169    }
    169170  };
  • trunk/lib/Graph.cc

    r1331 r1418  
    9393#ifdef HAVE_PLPLOT
    9494    if (!plots_) {
    95       assert(!date_xticks() || rev_min_<dates_.size());
     95      assert(!date_xticks() || static_cast<size_t>(rev_min_)<dates_.size());
    9696      assert(!date_xticks() || dates_[rev_min_]);
    97       assert(rev_min_<dates_.size() || !date_xticks());
     97      assert(static_cast<size_t>(rev_min_)<dates_.size() || !date_xticks());
    9898      xmin_= date_xticks() ? dates_[rev_min_] : rev_min_;
    99       assert(rev_max_<dates_.size() || !date_xticks());
     99      assert(static_cast<size_t>(rev_max_)<dates_.size() || !date_xticks());
    100100      xmax_= date_xticks() ? dates_[rev_max_] : rev_max_;
    101101      xrange_=xmax_-xmin_;
     
    202202    PLFLT x1 = rev1;
    203203    if (date_xticks()) {
    204       assert(rev0<dates_.size());
     204      assert(static_cast<size_t>(rev0)<dates_.size());
    205205      assert(dates_[rev0]);
    206206      x0 = dates_[rev0];
    207       assert(rev1<dates_.size());
     207      assert(static_cast<size_t>(rev1)<dates_.size());
    208208      assert(dates_[rev1]);
    209209      x1 = dates_[rev1];
  • trunk/lib/TinyStats.cc

    r1256 r1418  
    4242    if (j==i->second.end())
    4343      return 0;
    44     assert(lt < j->second.size());
     44    assert(static_cast<size_t>(lt) < j->second.size());
    4545    return j->second[lt];
    4646  }
  • trunk/lib/Vector.h

    r1208 r1418  
    181181      std::swap(map_, result.map_);
    182182      resize(std::max(size_, other.size()));
     183      return *this;
    183184    }
    184185
  • trunk/test/parser.cc

    r1164 r1418  
    3535{
    3636  theplu::svndigest::test::Suite suite(argc, argv);
    37   bool ok=true;
    3837  std::ofstream os("parser.tmp");
    3938  test("parser.cc",os);
  • trunk/test/stats.cc

    r1208 r1418  
    6060{
    6161  test::Suite suite(argc, argv, true);
    62 
    63   bool verbose=suite.verbose();
    6462
    6563  SVN* svn=SVN::instance("toy_project");
  • trunk/test/vector.cc

    r1203 r1418  
    9595  expected[8]=1;
    9696  expected[9]=13;
    97   if (result.size() != expected.size()) {
     97  if (static_cast<size_t>(result.size()) != expected.size()) {
    9898    suite.add(false);
    9999    suite.out() << "error: size: " << result.size() << " expected: "
     
    101101  }
    102102  else {
    103     for (size_t i=0; i<result.size(); ++i) {
     103    for (svn_revnum_t i=0; i<result.size(); ++i) {
    104104      if (result[i]!=expected[i]) {
    105105        suite.add(false);
Note: See TracChangeset for help on using the changeset viewer.