diff options
| author | Vincent Richard <[email protected]> | 2005-01-01 11:32:23 +0000 |
|---|---|---|
| committer | Vincent Richard <[email protected]> | 2005-01-01 11:32:23 +0000 |
| commit | fc1c6b08d191b3ee9964bf53ea95767bc54377ee (patch) | |
| tree | 0e6a61589b60909b065523e5e8e1e0039f2fc93d /src/platforms/posix/posixSocket.cpp | |
| parent | Fixed config file for Doxygen. (diff) | |
| download | vmime-fc1c6b08d191b3ee9964bf53ea95767bc54377ee.tar.gz vmime-fc1c6b08d191b3ee9964bf53ea95767bc54377ee.zip | |
Converted all C-style casts to C++-style casts + added unit test for utility::md5.
Diffstat (limited to 'src/platforms/posix/posixSocket.cpp')
| -rw-r--r-- | src/platforms/posix/posixSocket.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/platforms/posix/posixSocket.cpp b/src/platforms/posix/posixSocket.cpp index 09c8820e..40fa71e5 100644 --- a/src/platforms/posix/posixSocket.cpp +++ b/src/platforms/posix/posixSocket.cpp @@ -70,12 +70,12 @@ void posixSocket::connect(const vmime::string& address, const vmime::port_t port memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; - addr.sin_port = htons((unsigned short) port); + addr.sin_port = htons(static_cast <unsigned short>(port)); addr.sin_addr.s_addr = ::inet_addr(address.c_str()); - if (addr.sin_addr.s_addr == (::in_addr_t) -1) + if (addr.sin_addr.s_addr == static_cast <in_addr_t>(-1)) { - ::hostent* hostInfo = (hostent*) ::gethostbyname(address.c_str()); + ::hostent* hostInfo = ::gethostbyname(address.c_str()); if (hostInfo == NULL) { @@ -83,7 +83,7 @@ void posixSocket::connect(const vmime::string& address, const vmime::port_t port throw vmime::exceptions::connection_error(); } - bcopy(hostInfo->h_addr, (char*) &addr.sin_addr, hostInfo->h_length); + bcopy(hostInfo->h_addr, reinterpret_cast <char*>(&addr.sin_addr), hostInfo->h_length); } else { @@ -98,7 +98,7 @@ void posixSocket::connect(const vmime::string& address, const vmime::port_t port throw vmime::exceptions::connection_error(); // Start connection - if (::connect(m_desc, (sockaddr*) &addr, sizeof(addr)) == -1) + if (::connect(m_desc, reinterpret_cast <sockaddr*>(&addr), sizeof(addr)) == -1) { ::close(m_desc); m_desc = -1; |
