Changeset 589 for trunk


Ignore:
Timestamp:
Apr 12, 2008, 6:53:33 PM (13 years ago)
Author:
Jari Häkkinen
Message:

Replace u_int with unsigned int.

Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/BlameStats.cc

    r552 r589  
    6868    for (std::set<std::string>::const_iterator iter(authors().begin());
    6969         iter!=authors().end(); ++iter) {
    70       std::vector<u_int>& vec = a2v[*iter];
     70      std::vector<unsigned int>& vec = a2v[*iter];
    7171      vec.resize(revision()+1);
    7272      assert(rev<static_cast<svn_revnum_t>(vec.size()));
  • trunk/lib/Date.cc

    r519 r589  
    6969    struct tm* last = std::gmtime(&t1);
    7070
    71     u_int year=0;
     71    unsigned int year=0;
    7272    while (t0<=t1) {
    7373      ++year;
     
    8585    }
    8686
    87     u_int month=0;
     87    unsigned int month=0;
    8888    while (t0<=t1) {
    8989      ++month;
     
    102102   
    103103
    104     u_int day = (t1-t0)/24/60/60;
     104    unsigned int day = (t1-t0)/24/60/60;
    105105    ss << day << " day";
    106106    if (day!=1)
     
    118118    time_t timezone_correction = timeinfo->tm_gmtoff;
    119119
    120     u_int year, month, day, hour, minute, second;
     120    unsigned int year, month, day, hour, minute, second;
    121121    std::string tmp;
    122122    std::getline(sstream,tmp,'-');
  • trunk/lib/Directory.cc

    r546 r589  
    4949
    5050
    51   Directory::Directory(const u_int level, const std::string& path,
     51  Directory::Directory(const unsigned int level, const std::string& path,
    5252                       const std::string& output)
    5353    : Node(level,path,output)
  • trunk/lib/Directory.h

    r538 r589  
    5353    /// traversed.
    5454    ///
    55     Directory(const u_int level, const std::string& path,
     55    Directory(const unsigned int level, const std::string& path,
    5656              const std::string& output="");
    5757
  • trunk/lib/File.cc

    r579 r589  
    4848
    4949
    50   File::File(const u_int level, const std::string& path,
     50  File::File(const unsigned int level, const std::string& path,
    5151             const std::string& output)
    5252    : Node(level,path,output)
  • trunk/lib/File.h

    r538 r589  
    3939    /// @brief Default Constructor
    4040    ///
    41     File(const u_int level, const std::string& path,
     41    File(const unsigned int level, const std::string& path,
    4242         const std::string& output="");
    4343
  • trunk/lib/GnuplotFE.cc

    r519 r589  
    3838
    3939
    40   void GnuplotFE::plot(std::vector<u_int>& y, const std::string& format)
     40  void GnuplotFE::plot(std::vector<unsigned int>& y, const std::string& format)
    4141  {
    4242    if (!date_.empty()) {
     
    5858
    5959
    60   void GnuplotFE::replot(std::vector<u_int>& y)
     60  void GnuplotFE::replot(std::vector<unsigned int>& y)
    6161  {
    6262    if (!date_.empty()) {
  • trunk/lib/GnuplotFE.h

    r519 r589  
    7979    /// shorter than \a y vector.
    8080    ///
    81     void plot(std::vector<u_int>& y,const std::string& format="%y-%b");
     81    void plot(std::vector<unsigned int>& y,const std::string& format="%y-%b");
    8282
    8383    ///
     
    8686    /// axis data and possible modifications of \a y.
    8787    ///
    88     void replot(std::vector<u_int>& y);
     88    void replot(std::vector<unsigned int>& y);
    8989
    9090    ///
  • trunk/lib/Node.cc

    r532 r589  
    4444  std::string Node::project_=std::string();
    4545
    46   Node::Node(const u_int level, const std::string& path,
     46  Node::Node(const unsigned int level, const std::string& path,
    4747             const std::string& local_path)
    4848    : level_(level), path_(path), stats_(path), log_(NULL), 
  • trunk/lib/Node.h

    r538 r589  
    5858    /// @brief Constructor
    5959    ///
    60     Node(const u_int, const std::string&, const std::string&);
     60    Node(const unsigned int, const std::string&, const std::string&);
    6161
    6262    ///
     
    198198    void path_anchor(std::ostream& os) const;
    199199
    200     u_int level_;
     200    unsigned int level_;
    201201    std::string local_path_; // path from root
    202202    std::string output_dir_;
  • trunk/lib/Stats.cc

    r556 r589  
    6565
    6666
    67   void Stats::accumulate(std::vector<u_int>& vec) const
     67  void Stats::accumulate(std::vector<unsigned int>& vec) const
    6868  {
    6969    if (vec.empty()){
     
    8282    for (std::set<std::string>::const_iterator iter(authors().begin());
    8383         iter!=authors().end(); ++iter) {
    84       std::vector<u_int>& code = code_stats()[*iter];
     84      std::vector<unsigned int>& code = code_stats()[*iter];
    8585      accumulate(code);
    86       std::vector<u_int>& comments = comment_stats()[*iter];
     86      std::vector<unsigned int>& comments = comment_stats()[*iter];
    8787      accumulate(comments);
    88       std::vector<u_int>& other = other_stats()[*iter];
     88      std::vector<unsigned int>& other = other_stats()[*iter];
    8989      accumulate(other);
    90       std::vector<u_int>& copyright = copyright_stats()[*iter];
     90      std::vector<unsigned int>& copyright = copyright_stats()[*iter];
    9191      accumulate(copyright);
    9292    }
     
    9494
    9595
    96   void Stats::add(const std::string& user, const u_int& rev,
    97                   const LineTypeParser::line_type& lt, u_int n)
     96  void Stats::add(const std::string& user, const unsigned int& rev,
     97                  const LineTypeParser::line_type& lt, unsigned int n)
    9898  {
    9999    assert(user.size());
     
    101101
    102102    // FIXME: Peter, remove repeat
    103     std::vector<u_int>& code = code_stats()[user];
     103    std::vector<unsigned int>& code = code_stats()[user];
    104104    if (code.size() < rev+1){
    105105      code.reserve(rev+1);
     
    113113      code[rev]+=n;
    114114
    115     std::vector<u_int>& comments = comment_stats()[user];
     115    std::vector<unsigned int>& comments = comment_stats()[user];
    116116    if (comments.size() < rev+1){
    117117      comments.reserve(revision() + 1);
     
    125125      comments[rev]+=n;
    126126
    127     std::vector<u_int>& other = other_stats()[user];
     127    std::vector<unsigned int>& other = other_stats()[user];
    128128    if (other.size() < rev+1){
    129129      other.reserve(revision() + 1);
     
    137137      other[rev]+=n;
    138138
    139     std::vector<u_int>& copy = copyright_stats()[user];
     139    std::vector<unsigned int>& copy = copyright_stats()[user];
    140140    if (copy.size() < rev+1){
    141141      copy.reserve(revision() + 1);
     
    172172  void Stats::calc_all(void)
    173173  {
    174     std::vector<u_int> init(revision()+1);
     174    std::vector<unsigned int> init(revision()+1);
    175175    code_stats()["all"]=std::accumulate(code_stats().begin(),
    176176                                        code_stats().end(), init,
    177                                         PairValuePlus<std::string,u_int>());
     177                                        PairValuePlus<std::string,unsigned int>());
    178178    comment_stats()["all"]=std::accumulate(comment_stats().begin(),
    179179                                           comment_stats().end(), init,
    180                                            PairValuePlus<std::string,u_int>());
     180                                           PairValuePlus<std::string,unsigned int>());
    181181    other_stats()["all"]=std::accumulate(other_stats().begin(),
    182182                                         other_stats().end(), init,
    183                                          PairValuePlus<std::string,u_int>());
     183                                         PairValuePlus<std::string,unsigned int>());
    184184    copyright_stats()["all"]=std::accumulate(copyright_stats().begin(),
    185185                                             copyright_stats().end(), init,
    186                                              PairValuePlus<std::string,u_int>());
    187     VectorPlus<u_int> vp;
     186                                             PairValuePlus<std::string,unsigned int>());
     187    VectorPlus<unsigned int> vp;
    188188    comment_or_copy_stats()["all"] =
    189189      vp(comment_stats()["all"], copyright_stats()["all"]);
     
    199199    for (std::set<std::string>::const_iterator iter(authors().begin());
    200200         iter!=authors().end(); ++iter) {
    201       std::vector<u_int>& code = code_stats()[*iter];
    202       std::vector<u_int>& comments = comment_stats()[*iter];
    203       std::vector<u_int>& other = other_stats()[*iter];
    204       std::vector<u_int>& copy = copyright_stats()[*iter];
    205 
    206       VectorPlus<u_int> vp;
     201      std::vector<unsigned int>& code = code_stats()[*iter];
     202      std::vector<unsigned int>& comments = comment_stats()[*iter];
     203      std::vector<unsigned int>& other = other_stats()[*iter];
     204      std::vector<unsigned int>& copy = copyright_stats()[*iter];
     205
     206      VectorPlus<unsigned int> vp;
    207207      total_stats()[*iter] = vp(vp(vp(code, comments),other),copy);
    208208    }
     
    215215    for (std::set<std::string>::const_iterator iter(authors().begin());
    216216         iter!=authors().end(); ++iter) {
    217       std::vector<u_int>& comments = comment_stats()[*iter];
    218       std::vector<u_int>& copy = copyright_stats()[*iter];
    219 
    220       VectorPlus<u_int> vp;
     217      std::vector<unsigned int>& comments = comment_stats()[*iter];
     218      std::vector<unsigned int>& copy = copyright_stats()[*iter];
     219
     220      VectorPlus<unsigned int> vp;
    221221      comment_or_copy_stats()[*iter] = vp(comments, copy);
    222222    }
     
    225225
    226226
    227   u_int Stats::code(const std::string& user) const
     227  unsigned int Stats::code(const std::string& user) const
    228228  {
    229229    return get_back(code_stats(), user);
     
    231231
    232232
    233   u_int Stats::comments(const std::string& user) const
     233  unsigned int Stats::comments(const std::string& user) const
    234234  {
    235235    return get_back(comment_or_copy_stats(), user);
     
    237237
    238238
    239   u_int Stats::empty(const std::string& user) const
     239  unsigned int Stats::empty(const std::string& user) const
    240240  {
    241241    return get_back(other_stats(), user);
     
    243243
    244244
    245   u_int Stats::get_back(const Author2Vector& m, std::string user) const
     245  unsigned int Stats::get_back(const Author2Vector& m, std::string user) const
    246246  {
    247247    A2VConstIter iter(m.find(std::string(user)));
     
    252252
    253253
    254   const std::vector<u_int>& Stats::get_vector(const Author2Vector& m,
     254  const std::vector<unsigned int>& Stats::get_vector(const Author2Vector& m,
    255255                                              std::string user) const
    256256  {
     
    268268
    269269
    270   u_int Stats::lines(const std::string& user) const
     270  unsigned int Stats::lines(const std::string& user) const
    271271  {
    272272    return get_back(total_stats(), user);
     
    281281      if (name.empty())
    282282        continue;
    283       std::vector<u_int>& vec=m[name];
     283      std::vector<unsigned int>& vec=m[name];
    284284      svn_revnum_t rev=0;
    285285      while (rev < last_changed_rev() && is.good()) {
    286         u_int count;
     286        unsigned int count;
    287287        is >> count;
    288288        if ( rev+1 > static_cast<svn_revnum_t>(vec.size()) )
     
    378378    assert(stat->size());
    379379    assert(stat->find("all")!=stat->end());
    380     std::vector<u_int> total=get_vector(*stat, "all");   
     380    std::vector<unsigned int> total=get_vector(*stat, "all");   
    381381    double yrange_max=1.03*total.back()+1;
    382382    gp->yrange(yrange_max);
    383383
    384     typedef std::vector<std::pair<std::string, std::vector<u_int> > > vec_type;
     384    typedef std::vector<std::pair<std::string, std::vector<unsigned int> > > vec_type;
    385385    vec_type author_cont;
    386386    author_cont.reserve(stat->size());
     
    393393    }
    394394
    395     LessReversed<std::vector<u_int> > lr;
    396     PairSecondCompare<std::string, std::vector<u_int>,
    397       LessReversed<std::vector<u_int> > > compare(lr);
     395    LessReversed<std::vector<unsigned int> > lr;
     396    PairSecondCompare<std::string, std::vector<unsigned int>,
     397      LessReversed<std::vector<unsigned int> > > compare(lr);
    398398    std::sort(author_cont.begin(), author_cont.end(), compare);
    399399
     
    445445    plot_init(filename);
    446446    GnuplotFE* gp=GnuplotFE::instance();
    447     std::vector<u_int> total = get_vector(total_stats(), "all");
     447    std::vector<unsigned int> total = get_vector(total_stats(), "all");
    448448    double yrange_max=1.03*total.back()+1;
    449449    gp->yrange(yrange_max);
     
    451451   
    452452    ss.str("");
    453     std::vector<u_int> x(get_vector(code_stats(), "all"));
     453    std::vector<unsigned int> x(get_vector(code_stats(), "all"));
    454454    ss << x.back() << " code";
    455455    gp->command("set key height 2");
     
    518518    for (size_t i=0; i<stats_.size(); ++i){
    519519      stats_[i].clear();
    520       std::vector<u_int> vec;
     520      std::vector<unsigned int> vec;
    521521      stats_[i]["all"] = vec;
    522522    }
  • trunk/lib/Stats.h

    r552 r589  
    5959    /// @brief adding \a n line(s) to \a user from \a revision to the stats
    6060    ///
    61     void add(const std::string& user, const u_int& revision,
    62              const LineTypeParser::line_type&, u_int n=1);
     61    void add(const std::string& user, const unsigned int& revision,
     62             const LineTypeParser::line_type&, unsigned int n=1);
    6363
    6464    ///
     
    7070    ///
    7171    ///
    72     u_int code(const std::string& user="all") const;
    73 
    74 
    75     ///
    76     ///
    77     ///
    78     u_int comments(const std::string& user="all") const;
    79 
    80     ///
    81     ///
    82     ///
    83     u_int empty(const std::string& user="all") const;
     72    unsigned int code(const std::string& user="all") const;
     73
     74
     75    ///
     76    ///
     77    ///
     78    unsigned int comments(const std::string& user="all") const;
     79
     80    ///
     81    ///
     82    ///
     83    unsigned int empty(const std::string& user="all") const;
    8484
    8585    ///
     
    9191    ///
    9292    ///
    93     u_int lines(const std::string& user="all") const;
     93    unsigned int lines(const std::string& user="all") const;
    9494
    9595    /**
     
    145145
    146146  protected:
    147     typedef std::map<std::string, std::vector<u_int> > Author2Vector;
     147    typedef std::map<std::string, std::vector<unsigned int> > Author2Vector;
    148148    typedef Author2Vector::iterator A2VIter;
    149149    typedef Author2Vector::const_iterator A2VConstIter;
     
    196196    std::set<std::string> authors_;
    197197
    198     const std::vector<u_int>& get_vector(const Author2Vector&,
     198    const std::vector<unsigned int>& get_vector(const Author2Vector&,
    199199                                         std::string user) const;
    200200  private:
    201     void accumulate(std::vector<u_int>& vec) const;
     201    void accumulate(std::vector<unsigned int>& vec) const;
    202202    virtual void do_parse(const std::string&)=0;
    203203   
     
    210210    void calc_comment_or_copy(void);
    211211    void calc_total(void);
    212     u_int get_back(const Author2Vector&, std::string user) const;
     212    unsigned int get_back(const Author2Vector&, std::string user) const;
    213213    void load(std::istream& is, Author2Vector& m);
    214214    void print(std::ostream& os, const Author2Vector& m) const;
  • trunk/lib/html_utility.cc

    r556 r589  
    3838
    3939  std::string anchor(const std::string& url,
    40                      const std::string& name, u_int level,
     40                     const std::string& name, unsigned int level,
    4141                     const std::string& title,
    4242                     const std::string& color)
     
    7474
    7575
    76   void print_header(std::ostream& os, std::string title, u_int level,
     76  void print_header(std::ostream& os, std::string title, unsigned int level,
    7777                    std::string user, std::string item, std::string path,
    7878                    const std::string& stats)
     
    8888       << "<link rel=\"stylesheet\" "
    8989       << "href=\"";
    90     for (u_int i=0; i<level; ++i)
     90    for (unsigned int i=0; i<level; ++i)
    9191      os << "../";
    9292    os << "svndigest.css\" type=\"text/css\" />\n"
  • trunk/lib/html_utility.h

    r546 r589  
    4343  ///
    4444  std::string anchor(const std::string& url,
    45                      const std::string& name, u_int level=0,
     45                     const std::string& name, unsigned int level=0,
    4646                     const std::string& title="",
    4747                     const std::string& color="");
     
    6262  /// \param path current path
    6363  /// \param stats which stats are we in
    64   void print_header(std::ostream& os, std::string name, u_int level,
     64  void print_header(std::ostream& os, std::string name, unsigned int level,
    6565                    std::string user, std::string item, std::string path,
    6666                    const std::string& stats);
  • trunk/lib/utility.cc

    r523 r589  
    4646    }
    4747    int mode=0;
    48     for (u_int i=0; i<bits.length(); ++i)
     48    for (unsigned int i=0; i<bits.length(); ++i)
    4949      switch (bits[i]) {
    5050          case 'r':
     
    129129
    130130
    131   std::string hex(int x, u_int width)
     131  std::string hex(int x, unsigned int width)
    132132  {
    133133    std::stringstream ss;
     
    291291    timeinfo =  gmtime ( &rawtime );
    292292
    293     u_int year, month, day, hour, minute, second;
     293    unsigned int year, month, day, hour, minute, second;
    294294    std::string tmp;
    295295    getline(sstream,tmp,'-');
  • trunk/lib/utility.h

    r519 r589  
    9797  /// @return x in hexadecimal base
    9898  ///
    99   std::string hex(int x, u_int width=0);
     99  std::string hex(int x, unsigned int width=0);
    100100
    101101  ///
  • trunk/test/utility_test.cc

    r523 r589  
    2929#include <string>
    3030
    31 bool test_hex(int, u_int, std::string);
     31bool test_hex(int, unsigned int, std::string);
    3232bool test_equal(bool, std::string, std::string);
    3333bool test_regexp(bool, std::string, std::string,
     
    8080}
    8181
    82 bool test_hex(int x, u_int w, std::string facit)
     82bool test_hex(int x, unsigned int w, std::string facit)
    8383{
    8484  if (theplu::svndigest::hex(x,w)==facit)
Note: See TracChangeset for help on using the changeset viewer.