[Remove String->const char* conversion operator in favor of c_str method clinton@unknownlamer.org**20090223234338 Ignore-this: 61564b24ce222d336330f5dc07713854 This was dumb to begin with (I reserve the right to be mean to my younger self) and really only caused a number of evil cases of ambiguious overloading whenever a String and std::string are used together. ] { hunk ./source/Bot.C 133 - std::ifstream initFile(initFileName); + std::ifstream initFile(initFileName.c_str ()); hunk ./source/Bot.C 238 - std::ifstream file(configFileName); + std::ifstream file(configFileName.c_str ()); hunk ./source/Bot.C 327 - MAX_NICKLENGTH = std::atoi (parameters); + MAX_NICKLENGTH = std::atoi (parameters.c_str ()); hunk ./source/Bot.C 756 - logFileName = name; + logFileName = logs_dir + name; hunk ./source/Bot.C 760 - logFile.open(logs_dir + logFileName, std::ios_base::out | + logFile.open(logFileName.c_str (), std::ios_base::out | hunk ./source/Bot.C 763 - logFile.open(logs_dir + logFileName, ios::out | ios::ate + logFile.open(logFileName.c_str (), ios::out | ios::ate hunk ./source/Bot.C 775 - DIR *temp = opendir (logs_dir); + DIR *temp = opendir (logs_dir.c_str ()); hunk ./source/Bot.C 779 - mkdir (logs_dir, S_IRWXU); + mkdir (logs_dir.c_str (), S_IRWXU); hunk ./source/Interp.C 153 - scm_from_locale_string (String(PREFIX) + - "/share/bobotpp/scripts/")); + scm_from_locale_string ((String(PREFIX) + + "/share/bobotpp/scripts/").c_str ())); hunk ./source/Interp.C 289 - (scm_from_locale_string (String(PREFIX) + - "/share/bobotpp/scripts/bobot-utils.scm")); + (scm_from_locale_string ((String(PREFIX) + + "/share/bobotpp/scripts/bobot-utils.scm").c_str ())); hunk ./source/Interp.C 329 - (scm_t_catch_body) lazy_eval_string, (void *) static_cast (command), + (scm_t_catch_body) lazy_eval_string, (void *) static_cast (command.c_str ()), hunk ./source/Interp.C 349 - (void *)static_cast(filename), + (void *)static_cast(filename.c_str ()), hunk ./source/Main.C 203 - if (! (temp = opendir (String(getenv ("HOME")) + "/.bobotpp/logs"))) + if (! (temp = opendir ((String(getenv ("HOME")) + "/.bobotpp/logs").c_str ()))) hunk ./source/Main.C 205 - mkdir (String(getenv ("HOME")) + "/.bobotpp/logs", + mkdir ((String(getenv ("HOME")) + "/.bobotpp/logs").c_str (), hunk ./source/Mask.C 35 - return match((const char *)mask, (const char *)s); + return match(mask.c_str (), s.c_str ()); hunk ./source/Mask.C 41 - return match((const char *)mask, (const char *)m.mask); + return match(mask.c_str (), m.mask.c_str ()); hunk ./source/ShitList.C 51 - std::ifstream file(listFileName); + std::ifstream file(listFileName.c_str ()); hunk ./source/ShitList.C 69 - l.push_back (new ShitEntry(mask, channelMask, std::atoi(level), - std::atol(expiration), reason)); + l.push_back (new ShitEntry(mask, channelMask, std::atoi(level.c_str ()), + std::atol(expiration.c_str ()), reason)); hunk ./source/ShitList.C 80 - std::ofstream file(listFileName); + std::ofstream file(listFileName.c_str ()); hunk ./source/Socket.C 97 - if ((host = gethostbyname((const char *)hostname)) == 0) + if ((host = gethostbyname(hostname.c_str ())) == 0) hunk ./source/Socket.C 126 - if ((host = gethostbyname((const char *)hostname)) == 0) + if ((host = gethostbyname(hostname.c_str ())) == 0) hunk ./source/Socket.C 240 - if (::write(fd->fd, (const char *)s, s.length()) + + if (::write(fd->fd, s.c_str (), s.length()) + hunk ./source/Socket.C 245 - if (::write(fd->fd, (const char *)s, s.length()) + + if (::write(fd->fd, s.c_str (), s.length()) + hunk ./source/String.C 295 -String::operator const char *() const -{ - return my_string.c_str (); -} +const char* +String::c_str () const + { + return my_string.c_str (); + } hunk ./source/String.H 85 - operator const char *() const; + const char* c_str () const; hunk ./source/UserCommands.C 132 - l = atoi((const char *)level); + l = atoi(level.c_str ()); hunk ./source/UserCommands.C 139 - p = atoi((const char *)prot); + p = atoi(prot.c_str ()); hunk ./source/UserCommands.C 142 - a = (bool)atoi((const char *)aop); + a = (bool)atoi(aop.c_str ()); hunk ./source/UserCommands.C 187 - port = atoi((const char *)temp); + port = atoi(temp.c_str ()); hunk ./source/UserCommands.C 243 - l = atoi((const char *)level); + l = atoi(level.c_str ()); hunk ./source/UserCommands.C 420 - from->sendNotice(String("\002I am currently on channel(s):\002 ") + + from->sendNotice(String("\002I am currently on channel(s):\002 ") hunk ./source/UserCommands.C 478 - int serverNumber = atoi(rest); + int serverNumber = atoi(rest.c_str ()); hunk ./source/UserCommands.C 643 - std::ifstream helpFile(cnx->bot->helpFileName); + std::ifstream helpFile(cnx->bot->helpFileName.c_str ()); hunk ./source/UserCommands.C 1173 - serverNumber = atoi(rest); + serverNumber = atoi(rest.c_str ()); hunk ./source/UserCommands.C 1217 - Message m = Commands::SetFloodRate (cnx->bot, std::atoi (rest)); + Message m = Commands::SetFloodRate (cnx->bot, std::atoi (rest.c_str ())); hunk ./source/UserCommands.C 1221 - from->sendNotice ("Flood Rate set to:" + String(std::atol(rest))); + from->sendNotice ("Flood Rate set to:" + String(std::atol(rest.c_str ()))); hunk ./source/UserList.C 42 - std::ifstream file(listFilename); + std::ifstream file(listFilename.c_str ()); hunk ./source/UserList.C 78 - l.push_back(new UserListItem(mask, maskChannel, std::atoi(level), - std::atoi(prot), std::atoi(aop), - std::atol(expiration), password)); + l.push_back(new UserListItem(mask, maskChannel, std::atoi(level.c_str ()), + std::atoi(prot.c_str ()), std::atoi(aop.c_str ()), + std::atol(expiration.c_str ()), password)); hunk ./source/UserList.C 91 - std::ofstream file(listFilename); + std::ofstream file(listFilename.c_str ()); }