summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-02 00:43:56 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-02 00:43:56 +0000
commitdeb6822302cb9009adc3450dd405817cc0dae9cd (patch)
tree660eb4ce263fe529c95a756fe46bd20c70fecf25 /src/modules
parente35dd5cbb8b7d0d39a83b35c5837c1f062977eea (diff)
Cast rework: use C++ style static_cast<> instead of C-style casts
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11595 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_mssql.cpp2
-rw-r--r--src/modules/extra/m_mysql.cpp2
-rw-r--r--src/modules/extra/m_pgsql.cpp2
-rw-r--r--src/modules/extra/m_sqlite3.cpp2
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp14
5 files changed, 11 insertions, 11 deletions
diff --git a/src/modules/extra/m_mssql.cpp b/src/modules/extra/m_mssql.cpp
index 9cc7a567c..1ad8a087a 100644
--- a/src/modules/extra/m_mssql.cpp
+++ b/src/modules/extra/m_mssql.cpp
@@ -35,7 +35,7 @@ typedef std::deque<MsSQLResult*> ResultQueue;
unsigned long count(const char * const str, char a)
{
unsigned long n = 0;
- for (const char *p = reinterpret_cast<const char *>(str); *p; ++p)
+ for (const char *p = str; *p; ++p)
{
if (*p == '?')
++n;
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index 224bf0f56..06c2a13b6 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -73,7 +73,7 @@ typedef std::deque<SQLresult*> ResultQueue;
unsigned long count(const char * const str, char a)
{
unsigned long n = 0;
- for (const char *p = reinterpret_cast<const char *>(str); *p; ++p)
+ for (const char *p = str; *p; ++p)
{
if (*p == '?')
++n;
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp
index b417fc019..520450575 100644
--- a/src/modules/extra/m_pgsql.cpp
+++ b/src/modules/extra/m_pgsql.cpp
@@ -47,7 +47,7 @@ enum SQLstatus { CREAD, CWRITE, WREAD, WWRITE, RREAD, RWRITE };
unsigned long count(const char * const str, char a)
{
unsigned long n = 0;
- for (const char *p = reinterpret_cast<const char *>(str); *p; ++p)
+ for (const char *p = str; *p; ++p)
{
if (*p == '?')
++n;
diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp
index 548af82cc..ea76fbc1d 100644
--- a/src/modules/extra/m_sqlite3.cpp
+++ b/src/modules/extra/m_sqlite3.cpp
@@ -34,7 +34,7 @@ typedef std::deque<SQLite3Result*> ResultQueue;
unsigned long count(const char * const str, char a)
{
unsigned long n = 0;
- for (const char *p = reinterpret_cast<const char *>(str); *p; ++p)
+ for (const char *p = str; *p; ++p)
{
if (*p == '?')
++n;
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index b7b225384..665a6723f 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -301,7 +301,7 @@ class ModuleSSLGnuTLS : public Module
{
if(target_type == TYPE_USER)
{
- User* user = (User*)item;
+ User* user = static_cast<User*>(item);
if (user->GetIOHook() == this)
{
@@ -357,7 +357,7 @@ class ModuleSSLGnuTLS : public Module
virtual const char* OnRequest(Request* request)
{
- ISHRequest* ISR = (ISHRequest*)request;
+ ISHRequest* ISR = static_cast<ISHRequest*>(request);
if (strcmp("IS_NAME", request->GetId()) == 0)
{
return "gnutls";
@@ -367,7 +367,7 @@ class ModuleSSLGnuTLS : public Module
const char* ret = "OK";
try
{
- ret = ISR->Sock->AddIOHook((Module*)this) ? "OK" : NULL;
+ ret = ISR->Sock->AddIOHook(this) ? "OK" : NULL;
}
catch (ModuleException &e)
{
@@ -394,9 +394,9 @@ class ModuleSSLGnuTLS : public Module
issl_session* session = &sessions[ISR->Sock->GetFd()];
if (session->sess)
{
- if ((Extensible*)ServerInstance->SE->GetRef(ISR->Sock->GetFd()) == (Extensible*)(ISR->Sock))
+ if (static_cast<Extensible*>(ServerInstance->SE->GetRef(ISR->Sock->GetFd())) == static_cast<Extensible*>(ISR->Sock))
{
- VerifyCertificate(session, (BufferedSocket*)ISR->Sock);
+ VerifyCertificate(session, ISR->Sock);
return "OK";
}
}
@@ -438,7 +438,7 @@ class ModuleSSLGnuTLS : public Module
gnutls_credentials_set(session->sess, GNUTLS_CRD_CERTIFICATE, x509_cred);
gnutls_dh_set_prime_bits(session->sess, dh_bits);
- gnutls_transport_set_ptr(session->sess, (gnutls_transport_ptr_t) fd); // Give gnutls the fd for the socket.
+ gnutls_transport_set_ptr(session->sess, reinterpret_cast<gnutls_transport_ptr_t>(fd)); // Give gnutls the fd for the socket.
gnutls_certificate_server_set_request(session->sess, GNUTLS_CERT_REQUEST); // Request client certificate if any.
@@ -458,7 +458,7 @@ class ModuleSSLGnuTLS : public Module
gnutls_set_default_priority(session->sess); // Avoid calling all the priority functions, defaults are adequate.
gnutls_credentials_set(session->sess, GNUTLS_CRD_CERTIFICATE, x509_cred);
gnutls_dh_set_prime_bits(session->sess, dh_bits);
- gnutls_transport_set_ptr(session->sess, (gnutls_transport_ptr_t) fd); // Give gnutls the fd for the socket.
+ gnutls_transport_set_ptr(session->sess, reinterpret_cast<gnutls_transport_ptr_t>(fd)); // Give gnutls the fd for the socket.
Handshake(session, fd);
}