Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cast 0 so comparisons with pointers doesn't generate a compiler warning

  • Loading branch information...
commit 57a4e9c2c32202cd8625a807f7bd5f55e4bf8933 1 parent 2f7a683
Rob Savoye authored
View
2  cygnal/libamf/element.cpp
@@ -481,7 +481,7 @@ Element::encode(bool notobject)
if (!notobject) {
*buf = Element::OBJECT_AMF0;
}
- if (_name > 0) {
+ if (_name > static_cast<char *>(0)) {
size_t length = getNameSize();
boost::uint16_t enclength = length;
swapBytes(&enclength, 2);
View
4 cygnal/libamf/lcshm.cpp
@@ -516,7 +516,7 @@ LcShm::connect(const string& names)
return false;
}
- if (SharedMem::begin() <= 0) {
+ if (SharedMem::begin() <= static_cast<unsigned char *>(0)) {
log_error(_("Failed to open shared memory segment: \"%s\""), names.c_str());
return false;
}
@@ -557,7 +557,7 @@ LcShm::connect(key_t key)
return false;
}
- if (SharedMem::begin() <= 0) {
+ if (SharedMem::begin() <= static_cast<unsigned char *>(0)) {
log_error(_("Failed to open shared memory segment: 0x%x"), key);
return false;
}
View
2  cygnal/libnet/network.cpp
@@ -564,7 +564,7 @@ Network::createClient(const string &hostname, short port)
}
const struct hostent *hent = ::gethostbyname(hostname.c_str());
- if (hent > 0) {
+ if (hent > static_cast< const struct hostent *>(0)) {
::memcpy(&sock_in.sin_addr, hent->h_addr, hent->h_length);
}
sock_in.sin_family = AF_INET;
View
2  utilities/soldumper.cpp
@@ -173,7 +173,7 @@ main(int argc, char *argv[])
entry = readdir(library_dir);
}
if (library_dir != NULL) {
- for (i=0; entry>0; i++) {
+ for (i=0; entry>static_cast<struct dirent *>(0); i++) {
entry = readdir(library_dir);
if (entry != NULL) {
//string::size_type pos;
Please sign in to comment.
Something went wrong with that request. Please try again.