Changeset 265
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Parser.cc
r262 r265 40 40 { 41 41 std::ifstream is(path.c_str()); 42 assert(is.good()); 42 43 std::vector<std::pair<std::string, std::string> > codon; 43 44 if (match_end(path.rbegin(), path.rend(), ".ac") || … … 116 117 } 117 118 } 118 if (!mode && match_begin(iter,str.end(), codon[mode-1].second)){ 119 assert(mode==0 || mode-1<codon.size()); 120 if (mode && match_begin(iter,str.end(), codon[mode-1].second)){ 119 121 mode=0; 120 122 continue; 121 123 } 122 123 124 // A line of code or comment must contain at least one 124 125 // alphanumerical character. 125 126 if (isalnum(*iter)) { 126 if (!mode) 127 if (!mode) { 127 128 lt=code; 128 else if (mode!=code) 129 } 130 else if (lt!=code) { 129 131 lt=comment; 132 } 130 133 } 131 134 } 132 if ( !mode && codon[mode-1].second==std::string("\n"))135 if (mode && codon[mode-1].second==std::string("\n")) 133 136 mode=0; 134 135 137 type_.push_back(lt); 136 138 } -
trunk/lib/Stats.cc
r244 r265 92 92 93 93 std::vector<u_int>* total = &(total_[user]); 94 assert(total); 94 95 if (total->size() < rev+1){ 95 96 total->reserve(revision_ + 1); … … 101 102 102 103 std::vector<u_int>* code = &(code_[user]); 104 assert(code); 103 105 if (code->size() < rev+1){ 104 106 code->reserve(revision_ + 1); … … 113 115 114 116 std::vector<u_int>* comments = &(comments_[user]); 117 assert(comments); 115 118 if (comments->size() < rev+1){ 116 119 comments->reserve(revision_ + 1); … … 125 128 126 129 std::vector<u_int>* empty = &(empty_[user]); 130 assert(empty); 127 131 if (empty->size() < rev+1){ 128 132 empty->reserve(revision_ + 1); … … 145 149 SVNblame svn_blame(path); 146 150 while (const SVNblame::blame_information * bi=svn_blame.next()) { 151 assert(bi); 147 152 // to handle symbolic links 148 153 if (count==parser.type().end()) 149 154 add(bi->author, bi->revision, Parser::empty); 150 else 155 else { 151 156 add(bi->author, bi->revision, *count); 152 ++count; 157 ++count; 158 } 153 159 } 154 160
Note: See TracChangeset
for help on using the changeset viewer.