Skip to content

Commit

Permalink
Const refs (this is about the last of them in the core api)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3694 e03df62e-2008-0410-955e-edbf42e46eb7
  • Loading branch information
braindigitalis committed Mar 12, 2006
1 parent 1135a57 commit 3a7fa16
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion include/ctables.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class command_t
*/
std::string source;

command_t(std::string cmd, char flags, int minpara) : command(cmd), flags_needed(flags), min_params(minpara)
command_t(const std::string &cmd, char flags, int minpara) : command(cmd), flags_needed(flags), min_params(minpara)
{
use_count = total_bytes = 0;
source = "<core>";
Expand Down
10 changes: 5 additions & 5 deletions include/dns.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,22 @@ class DNS
/** This constructor accepts a dns server address. The address must be in dotted
* decimal form, e.g. 1.2.3.4.
*/
DNS(std::string dnsserver);
DNS(const std::string &dnsserver);
/** The destructor frees all used structures.
*/
~DNS();
/** This method will start the reverse lookup of an ip given in dotted decimal
* format, e.g. 1.2.3.4, and returns true if the lookup was successfully
* initiated.
*/
bool ReverseLookup(std::string ip);
bool ReverseLookup(const std::string &ip);
/** This method will start the forward lookup of a hostname, e.g. www.inspircd.org,
* and returns true if the lookup was successfully initiated.
*/
bool ForwardLookup(std::string host);
bool ForwardLookup(const std::string &host);
/** Used by modules to perform a dns lookup but have the socket engine poll a module, instead of the dns object directly.
*/
bool ForwardLookupWithFD(std::string host, int &fd);
bool ForwardLookupWithFD(const std::string &host, int &fd);
/** This method will return true when the lookup is completed. It uses poll internally
* to determine the status of the socket.
*/
Expand All @@ -97,7 +97,7 @@ class DNS
* query is invalid for some reason, e.g. the dns server not responding.
*/
int GetFD();
void SetNS(std::string dnsserver);
void SetNS(const std::string &dnsserver);
};

/** This is the handler function for multi-threaded DNS.
Expand Down
2 changes: 1 addition & 1 deletion include/dnsqueue.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "inspircd.h"
#include "users.h"

bool lookup_dns(std::string nick);
bool lookup_dns(const std::string &nick);
void dns_poll(int fdcheck);
2 changes: 1 addition & 1 deletion include/inspircd_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ int DaemonSeed (void);
bool FileExists (const char* file);
int OpenTCPSocket (void);
int BindSocket (int sockfd, struct sockaddr_in client, struct sockaddr_in server, int port, char* addr);
void WritePID(std::string filename);
void WritePID(const std::string &filename);
int BindPorts();
char* CleanFilename(char* name);

Expand Down
2 changes: 1 addition & 1 deletion include/u_listmode.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ListModeBaseModule : public Module
Server* Srv;
ConfigReader* Conf;
public:
ListModeBaseModule(Server* serv, char modechar, std::string eolstr, std::string lnum, std::string eolnum) : Module::Module(serv)
ListModeBaseModule(Server* serv, char modechar, const std::string &eolstr, const std::string &lnum, const std::string &eolnum) : Module::Module(serv)
{
Srv = serv;
Conf = new ConfigReader;
Expand Down
10 changes: 5 additions & 5 deletions src/dns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,13 +684,13 @@ DNS::DNS()
log(DEBUG,"Create blank DNS");
}

DNS::DNS(std::string dnsserver)
DNS::DNS(const std::string &dnsserver)
{
dns_init_2(dnsserver.c_str());
log(DEBUG,"Create DNS with server '%s'",dnsserver.c_str());
}

void DNS::SetNS(std::string dnsserver)
void DNS::SetNS(const std::string &dnsserver)
{
dns_init_2(dnsserver.c_str());
log(DEBUG,"Set NS");
Expand All @@ -700,7 +700,7 @@ DNS::~DNS()
{
}

bool DNS::ReverseLookup(std::string ip)
bool DNS::ReverseLookup(const std::string &ip)
{
if (ServerInstance && ServerInstance->stats)
ServerInstance->stats->statsDns++;
Expand All @@ -723,7 +723,7 @@ bool DNS::ReverseLookup(std::string ip)
return true;
}

bool DNS::ForwardLookup(std::string host)
bool DNS::ForwardLookup(const std::string &host)
{
if (ServerInstance && ServerInstance->stats)
ServerInstance->stats->statsDns++;
Expand All @@ -740,7 +740,7 @@ bool DNS::ForwardLookup(std::string host)
return true;
}

bool DNS::ForwardLookupWithFD(std::string host, int &fd)
bool DNS::ForwardLookupWithFD(const std::string &host, int &fd)
{
if (ServerInstance && ServerInstance->stats)
ServerInstance->stats->statsDns++;
Expand Down
2 changes: 1 addition & 1 deletion src/dnsqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class Lookup {
}
};

bool lookup_dns(std::string nick)
bool lookup_dns(const std::string &nick)
{
/* First attempt to find the nickname */
userrec* u = Find(nick);
Expand Down
2 changes: 1 addition & 1 deletion src/inspircd_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ void Start (void)
printf("Name concept:\t\t\033[1;32mLord_Zathras\033[0m\n\n");
}

void WritePID(std::string filename)
void WritePID(const std::string &filename)
{
ofstream outfile(filename.c_str());
if (outfile.is_open())
Expand Down

0 comments on commit 3a7fa16

Please sign in to comment.