Changeset 589
- Timestamp:
- Apr 12, 2008, 6:53:33 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/BlameStats.cc
r552 r589 68 68 for (std::set<std::string>::const_iterator iter(authors().begin()); 69 69 iter!=authors().end(); ++iter) { 70 std::vector<u _int>& vec = a2v[*iter];70 std::vector<unsigned int>& vec = a2v[*iter]; 71 71 vec.resize(revision()+1); 72 72 assert(rev<static_cast<svn_revnum_t>(vec.size())); -
trunk/lib/Date.cc
r519 r589 69 69 struct tm* last = std::gmtime(&t1); 70 70 71 u _int year=0;71 unsigned int year=0; 72 72 while (t0<=t1) { 73 73 ++year; … … 85 85 } 86 86 87 u _int month=0;87 unsigned int month=0; 88 88 while (t0<=t1) { 89 89 ++month; … … 102 102 103 103 104 u _int day = (t1-t0)/24/60/60;104 unsigned int day = (t1-t0)/24/60/60; 105 105 ss << day << " day"; 106 106 if (day!=1) … … 118 118 time_t timezone_correction = timeinfo->tm_gmtoff; 119 119 120 u _int year, month, day, hour, minute, second;120 unsigned int year, month, day, hour, minute, second; 121 121 std::string tmp; 122 122 std::getline(sstream,tmp,'-'); -
trunk/lib/Directory.cc
r546 r589 49 49 50 50 51 Directory::Directory(const u _int level, const std::string& path,51 Directory::Directory(const unsigned int level, const std::string& path, 52 52 const std::string& output) 53 53 : Node(level,path,output) -
trunk/lib/Directory.h
r538 r589 53 53 /// traversed. 54 54 /// 55 Directory(const u _int level, const std::string& path,55 Directory(const unsigned int level, const std::string& path, 56 56 const std::string& output=""); 57 57 -
trunk/lib/File.cc
r579 r589 48 48 49 49 50 File::File(const u _int level, const std::string& path,50 File::File(const unsigned int level, const std::string& path, 51 51 const std::string& output) 52 52 : Node(level,path,output) -
trunk/lib/File.h
r538 r589 39 39 /// @brief Default Constructor 40 40 /// 41 File(const u _int level, const std::string& path,41 File(const unsigned int level, const std::string& path, 42 42 const std::string& output=""); 43 43 -
trunk/lib/GnuplotFE.cc
r519 r589 38 38 39 39 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) 41 41 { 42 42 if (!date_.empty()) { … … 58 58 59 59 60 void GnuplotFE::replot(std::vector<u _int>& y)60 void GnuplotFE::replot(std::vector<unsigned int>& y) 61 61 { 62 62 if (!date_.empty()) { -
trunk/lib/GnuplotFE.h
r519 r589 79 79 /// shorter than \a y vector. 80 80 /// 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"); 82 82 83 83 /// … … 86 86 /// axis data and possible modifications of \a y. 87 87 /// 88 void replot(std::vector<u _int>& y);88 void replot(std::vector<unsigned int>& y); 89 89 90 90 /// -
trunk/lib/Node.cc
r532 r589 44 44 std::string Node::project_=std::string(); 45 45 46 Node::Node(const u _int level, const std::string& path,46 Node::Node(const unsigned int level, const std::string& path, 47 47 const std::string& local_path) 48 48 : level_(level), path_(path), stats_(path), log_(NULL), -
trunk/lib/Node.h
r538 r589 58 58 /// @brief Constructor 59 59 /// 60 Node(const u _int, const std::string&, const std::string&);60 Node(const unsigned int, const std::string&, const std::string&); 61 61 62 62 /// … … 198 198 void path_anchor(std::ostream& os) const; 199 199 200 u _int level_;200 unsigned int level_; 201 201 std::string local_path_; // path from root 202 202 std::string output_dir_; -
trunk/lib/Stats.cc
r556 r589 65 65 66 66 67 void Stats::accumulate(std::vector<u _int>& vec) const67 void Stats::accumulate(std::vector<unsigned int>& vec) const 68 68 { 69 69 if (vec.empty()){ … … 82 82 for (std::set<std::string>::const_iterator iter(authors().begin()); 83 83 iter!=authors().end(); ++iter) { 84 std::vector<u _int>& code = code_stats()[*iter];84 std::vector<unsigned int>& code = code_stats()[*iter]; 85 85 accumulate(code); 86 std::vector<u _int>& comments = comment_stats()[*iter];86 std::vector<unsigned int>& comments = comment_stats()[*iter]; 87 87 accumulate(comments); 88 std::vector<u _int>& other = other_stats()[*iter];88 std::vector<unsigned int>& other = other_stats()[*iter]; 89 89 accumulate(other); 90 std::vector<u _int>& copyright = copyright_stats()[*iter];90 std::vector<unsigned int>& copyright = copyright_stats()[*iter]; 91 91 accumulate(copyright); 92 92 } … … 94 94 95 95 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) 98 98 { 99 99 assert(user.size()); … … 101 101 102 102 // FIXME: Peter, remove repeat 103 std::vector<u _int>& code = code_stats()[user];103 std::vector<unsigned int>& code = code_stats()[user]; 104 104 if (code.size() < rev+1){ 105 105 code.reserve(rev+1); … … 113 113 code[rev]+=n; 114 114 115 std::vector<u _int>& comments = comment_stats()[user];115 std::vector<unsigned int>& comments = comment_stats()[user]; 116 116 if (comments.size() < rev+1){ 117 117 comments.reserve(revision() + 1); … … 125 125 comments[rev]+=n; 126 126 127 std::vector<u _int>& other = other_stats()[user];127 std::vector<unsigned int>& other = other_stats()[user]; 128 128 if (other.size() < rev+1){ 129 129 other.reserve(revision() + 1); … … 137 137 other[rev]+=n; 138 138 139 std::vector<u _int>& copy = copyright_stats()[user];139 std::vector<unsigned int>& copy = copyright_stats()[user]; 140 140 if (copy.size() < rev+1){ 141 141 copy.reserve(revision() + 1); … … 172 172 void Stats::calc_all(void) 173 173 { 174 std::vector<u _int> init(revision()+1);174 std::vector<unsigned int> init(revision()+1); 175 175 code_stats()["all"]=std::accumulate(code_stats().begin(), 176 176 code_stats().end(), init, 177 PairValuePlus<std::string,u _int>());177 PairValuePlus<std::string,unsigned int>()); 178 178 comment_stats()["all"]=std::accumulate(comment_stats().begin(), 179 179 comment_stats().end(), init, 180 PairValuePlus<std::string,u _int>());180 PairValuePlus<std::string,unsigned int>()); 181 181 other_stats()["all"]=std::accumulate(other_stats().begin(), 182 182 other_stats().end(), init, 183 PairValuePlus<std::string,u _int>());183 PairValuePlus<std::string,unsigned int>()); 184 184 copyright_stats()["all"]=std::accumulate(copyright_stats().begin(), 185 185 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; 188 188 comment_or_copy_stats()["all"] = 189 189 vp(comment_stats()["all"], copyright_stats()["all"]); … … 199 199 for (std::set<std::string>::const_iterator iter(authors().begin()); 200 200 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; 207 207 total_stats()[*iter] = vp(vp(vp(code, comments),other),copy); 208 208 } … … 215 215 for (std::set<std::string>::const_iterator iter(authors().begin()); 216 216 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; 221 221 comment_or_copy_stats()[*iter] = vp(comments, copy); 222 222 } … … 225 225 226 226 227 u _int Stats::code(const std::string& user) const227 unsigned int Stats::code(const std::string& user) const 228 228 { 229 229 return get_back(code_stats(), user); … … 231 231 232 232 233 u _int Stats::comments(const std::string& user) const233 unsigned int Stats::comments(const std::string& user) const 234 234 { 235 235 return get_back(comment_or_copy_stats(), user); … … 237 237 238 238 239 u _int Stats::empty(const std::string& user) const239 unsigned int Stats::empty(const std::string& user) const 240 240 { 241 241 return get_back(other_stats(), user); … … 243 243 244 244 245 u _int Stats::get_back(const Author2Vector& m, std::string user) const245 unsigned int Stats::get_back(const Author2Vector& m, std::string user) const 246 246 { 247 247 A2VConstIter iter(m.find(std::string(user))); … … 252 252 253 253 254 const std::vector<u _int>& Stats::get_vector(const Author2Vector& m,254 const std::vector<unsigned int>& Stats::get_vector(const Author2Vector& m, 255 255 std::string user) const 256 256 { … … 268 268 269 269 270 u _int Stats::lines(const std::string& user) const270 unsigned int Stats::lines(const std::string& user) const 271 271 { 272 272 return get_back(total_stats(), user); … … 281 281 if (name.empty()) 282 282 continue; 283 std::vector<u _int>& vec=m[name];283 std::vector<unsigned int>& vec=m[name]; 284 284 svn_revnum_t rev=0; 285 285 while (rev < last_changed_rev() && is.good()) { 286 u _int count;286 unsigned int count; 287 287 is >> count; 288 288 if ( rev+1 > static_cast<svn_revnum_t>(vec.size()) ) … … 378 378 assert(stat->size()); 379 379 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"); 381 381 double yrange_max=1.03*total.back()+1; 382 382 gp->yrange(yrange_max); 383 383 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; 385 385 vec_type author_cont; 386 386 author_cont.reserve(stat->size()); … … 393 393 } 394 394 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); 398 398 std::sort(author_cont.begin(), author_cont.end(), compare); 399 399 … … 445 445 plot_init(filename); 446 446 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"); 448 448 double yrange_max=1.03*total.back()+1; 449 449 gp->yrange(yrange_max); … … 451 451 452 452 ss.str(""); 453 std::vector<u _int> x(get_vector(code_stats(), "all"));453 std::vector<unsigned int> x(get_vector(code_stats(), "all")); 454 454 ss << x.back() << " code"; 455 455 gp->command("set key height 2"); … … 518 518 for (size_t i=0; i<stats_.size(); ++i){ 519 519 stats_[i].clear(); 520 std::vector<u _int> vec;520 std::vector<unsigned int> vec; 521 521 stats_[i]["all"] = vec; 522 522 } -
trunk/lib/Stats.h
r552 r589 59 59 /// @brief adding \a n line(s) to \a user from \a revision to the stats 60 60 /// 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); 63 63 64 64 /// … … 70 70 /// 71 71 /// 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; 84 84 85 85 /// … … 91 91 /// 92 92 /// 93 u _int lines(const std::string& user="all") const;93 unsigned int lines(const std::string& user="all") const; 94 94 95 95 /** … … 145 145 146 146 protected: 147 typedef std::map<std::string, std::vector<u _int> > Author2Vector;147 typedef std::map<std::string, std::vector<unsigned int> > Author2Vector; 148 148 typedef Author2Vector::iterator A2VIter; 149 149 typedef Author2Vector::const_iterator A2VConstIter; … … 196 196 std::set<std::string> authors_; 197 197 198 const std::vector<u _int>& get_vector(const Author2Vector&,198 const std::vector<unsigned int>& get_vector(const Author2Vector&, 199 199 std::string user) const; 200 200 private: 201 void accumulate(std::vector<u _int>& vec) const;201 void accumulate(std::vector<unsigned int>& vec) const; 202 202 virtual void do_parse(const std::string&)=0; 203 203 … … 210 210 void calc_comment_or_copy(void); 211 211 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; 213 213 void load(std::istream& is, Author2Vector& m); 214 214 void print(std::ostream& os, const Author2Vector& m) const; -
trunk/lib/html_utility.cc
r556 r589 38 38 39 39 std::string anchor(const std::string& url, 40 const std::string& name, u _int level,40 const std::string& name, unsigned int level, 41 41 const std::string& title, 42 42 const std::string& color) … … 74 74 75 75 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, 77 77 std::string user, std::string item, std::string path, 78 78 const std::string& stats) … … 88 88 << "<link rel=\"stylesheet\" " 89 89 << "href=\""; 90 for (u _int i=0; i<level; ++i)90 for (unsigned int i=0; i<level; ++i) 91 91 os << "../"; 92 92 os << "svndigest.css\" type=\"text/css\" />\n" -
trunk/lib/html_utility.h
r546 r589 43 43 /// 44 44 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, 46 46 const std::string& title="", 47 47 const std::string& color=""); … … 62 62 /// \param path current path 63 63 /// \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, 65 65 std::string user, std::string item, std::string path, 66 66 const std::string& stats); -
trunk/lib/utility.cc
r523 r589 46 46 } 47 47 int mode=0; 48 for (u _int i=0; i<bits.length(); ++i)48 for (unsigned int i=0; i<bits.length(); ++i) 49 49 switch (bits[i]) { 50 50 case 'r': … … 129 129 130 130 131 std::string hex(int x, u _int width)131 std::string hex(int x, unsigned int width) 132 132 { 133 133 std::stringstream ss; … … 291 291 timeinfo = gmtime ( &rawtime ); 292 292 293 u _int year, month, day, hour, minute, second;293 unsigned int year, month, day, hour, minute, second; 294 294 std::string tmp; 295 295 getline(sstream,tmp,'-'); -
trunk/lib/utility.h
r519 r589 97 97 /// @return x in hexadecimal base 98 98 /// 99 std::string hex(int x, u _int width=0);99 std::string hex(int x, unsigned int width=0); 100 100 101 101 /// -
trunk/test/utility_test.cc
r523 r589 29 29 #include <string> 30 30 31 bool test_hex(int, u _int, std::string);31 bool test_hex(int, unsigned int, std::string); 32 32 bool test_equal(bool, std::string, std::string); 33 33 bool test_regexp(bool, std::string, std::string, … … 80 80 } 81 81 82 bool test_hex(int x, u _int w, std::string facit)82 bool test_hex(int x, unsigned int w, std::string facit) 83 83 { 84 84 if (theplu::svndigest::hex(x,w)==facit)
Note: See TracChangeset
for help on using the changeset viewer.