[[project @ 2005-05-31 05:59:57 by unknown_lamer] unknown_lamer**20050531055958 Fixed all warnings and a few rarely triggered bugs ] { hunk ./ChangeLog 1 +2005-05-31 Clinton Ebadi + + * source/String.C (operator): Made index signed again, it's not + worth fixing this warning + + * source/Bot.C: Add casts to make this compile with unsigned int + as operator[] in String + + * source/String.C (operator): Made index unsigned + + * source/Utils.C: Made a few things unsigned to kill warnings + + * source/Socket.C (readLine): Made pos unsigned + + * source/Bot.C (Bot): Fixed initializer list order to kill warnings + + * source/BotInterp.C (RunTimers): Removed unused variable (Timer *t) + + * source/StringTokenizer.C (count_tokens): Changed return type to + unsigned int + (more_tokens_p): Made counter unsigned + + * source/StringTokenizer.H (class StringTokenizer): Made pos + std::string::size_type instead of int + + * source/Commands.C (TBan): Returns Ok is the ban is done instead + of falling off the end (oops) + + * source/BotInterp.H: Add general catch case (false) + hunk ./NEWS 14 +- Fixed a number of small bugs and corner cases +- Should compile without warnings (GCC 3.4) hunk ./TODO 8 +* Compile without warnings +* Finish Texinfo manual hunk ./TODO 17 -* Write Texinfo manual -* Use configuration database class -* Improve the help system hunk ./TODO 19 -* Extend AOP to support +v (0 = no op, 1 = +o, 2 = +v) hunk ./TODO 20 + +2.4: +* Use configuration database class +* Extend AOP to support +v (0 = no op, 1 = +o, 2 = +v) hunk ./TODO 26 +* Improve the help system hunk ./source/Bot.C 65 - configFileName(filename), hunk ./source/Bot.C 67 - logFileName(DEFAULT_LOGFILENAME), - logs_dir (DEFAULT_LOGDIR), hunk ./source/Bot.C 69 + connected(false), + debug(debug_on), + stop(false), + sentPing(false), + startTime(time(NULL)), + currentTime(startTime), + lastNickNameChange(startTime), + lastChannelJoin(startTime), + serverConnection(0), + sentUserhostID(0), + receivedUserhostID(0), + logFileName(DEFAULT_LOGFILENAME), + logs_dir (DEFAULT_LOGDIR), + configFileName (filename), hunk ./source/Bot.C 85 - autoexecFileName(DEFAULT_AUTOEXECFILENAME), + autoexecFileName(DEFAULT_AUTOEXECFILENAME) hunk ./source/Bot.C 87 - connected(false), - debug(debug_on), stop(false), sentPing(false), - startTime(time(NULL)), currentTime(startTime), - lastNickNameChange(startTime), lastChannelJoin(startTime), - serverConnection(0), sentUserhostID(0), receivedUserhostID(0) hunk ./source/Bot.C 119 - if (temp[0]=='#') continue; + if (temp[(unsigned int)0]=='#') continue; hunk ./source/Bot.C 212 - if (temp.length() == 0 || temp[0] == '#') { + if (temp.length() == 0 || temp[(unsigned int)0] == '#') { hunk ./source/Bot.C 228 - commandChar = parameters[0]; + commandChar = parameters[(unsigned int)0]; hunk ./source/Bot.C 256 - if (parameters[0] == '/') + if (parameters[(unsigned int)0] == '/') hunk ./source/BotInterp.C 166 - Timer *t; + hunk ./source/BotInterp.H 51 - return true; + { + return true; + } hunk ./source/BotInterp.H 55 - return false; + { + return false; + } hunk ./source/BotInterp.H 59 - return false; + { + return false; + } hunk ./source/BotInterp.H 63 - return false; + { + return false; + } hunk ./source/BotInterp.H 67 - return true; + { + return true; + } + else + { + // NOTE: This should never be reached + return false; + } hunk ./source/Commands.C 679 + String dest; hunk ./source/Commands.C 681 + // Make sure all of the inputs are valid hunk ./source/Commands.C 683 - return NotOnChannel(channel); + { + return NotOnChannel(channel); + } hunk ./source/Commands.C 688 - return NotChannelOp(channel); + { + return NotChannelOp(channel); + } hunk ./source/Commands.C 693 - return InvalidTime(seconds); - - String dest; + { + return InvalidTime(seconds); + } hunk ./source/Commands.C 697 + // Look for user hunk ./source/Commands.C 699 - dest = bot->getUserhost(channel, who); + { + dest = bot->getUserhost(channel, who); + } hunk ./source/Commands.C 703 - dest = who; + { + dest = who; + } hunk ./source/Commands.C 708 - return UserNotFound(who, channel); + { + return UserNotFound(who, channel); + } + hunk ./source/Commands.C 716 + // Make sure the user isn't protected from bans hunk ./source/Commands.C 720 - if (m.matches((*it)->mask) && - (*it)->channelMask.matches(channel) && - (*it)->prot >= User::NO_BAN) - return UserProtected(who, channel); + { + if (m.matches((*it)->mask) && + (*it)->channelMask.matches(channel) && + (*it)->prot >= User::NO_BAN) + { + return UserProtected(who, channel); + } + } hunk ./source/Commands.C 729 + // Clear existing bans on the user hunk ./source/Commands.C 732 - if (m.matches((*it)->banMask)) - QUEUE->sendChannelMode(channel, "-b", (*it)->banMask.getMask()); + { + if (m.matches((*it)->banMask)) + { + QUEUE->sendChannelMode(channel, "-b", (*it)->banMask.getMask()); + } + } hunk ./source/Commands.C 739 + // Ban them hunk ./source/Commands.C 743 + + return Ok; hunk ./source/Socket.C 266 - int pos = 0; // pos in buffer + std::string::size_type pos = 0; // pos in buffer hunk ./source/String.C 174 -String::operator[] (int i) +String::operator[] (int i_) hunk ./source/String.C 176 + unsigned int i = i_; + hunk ./source/String.C 186 -String::operator[](int i) const +String::operator[](int i_) const hunk ./source/String.C 188 + unsigned int i = i_; + hunk ./source/StringTokenizer.C 33 - for (int i = pos; i < st.length(); i++) + for (std::string::size_type i = pos; i < st.length(); i++) hunk ./source/StringTokenizer.C 46 - for (int i = pos; i < st.length(); i++) + for (std::string::size_type i = pos; i < st.length(); i++) hunk ./source/StringTokenizer.C 53 -int +unsigned int hunk ./source/StringTokenizer.C 56 - int i = 0; + unsigned int i = 0; hunk ./source/StringTokenizer.C 68 -int +unsigned int hunk ./source/StringTokenizer.C 71 - int i = 0; + unsigned int i = 0; hunk ./source/StringTokenizer.C 86 - int i = pos; + std::string::size_type i = pos; hunk ./source/StringTokenizer.C 91 - for (int j = i; j < st.length(); j++) + for (std::string::size_type j = i; j < st.length(); j++) hunk ./source/StringTokenizer.C 105 - int i = pos; + std::string::size_type i = pos; + std::string::size_type j = 0; hunk ./source/StringTokenizer.C 109 - i++; - for (int j = i; j < st.length(); j++) - if (st[j] == c) - { - pos = j + 1; - return st.substr (i, j - i); - } + { + i++; + } + + for (j = i; j < st.length(); j++) + { + if (st[j] == c) + { + pos = j + 1; + return st.substr (i, j - i); + } + } hunk ./source/StringTokenizer.H 27 - int pos; + std::string::size_type pos; hunk ./source/StringTokenizer.H 35 - int count_tokens(); - int count_tokens(char); + unsigned int count_tokens(); + unsigned int count_tokens(char); hunk ./source/Utils.C 55 - for (int i = 0; i < host.length(); i++) + for (std::string::size_type i = 0; i < host.length(); i++) hunk ./source/Utils.C 132 - for (int i = 0; i < n.length(); i++) + for (std::string::size_type i = 0; i < n.length(); i++) hunk ./source/Utils.C 220 - num.reserve (512); // reverse a buffer to speed things up + num.reserve (64); // reserve a buffer to speed things up hunk ./source/Utils.C 222 - for (int i = 0; i < str.length(); i++) + for (std::string::size_type i = 0; i < str.length(); i++) }