Skip to content

Commit 3e68ba1

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Fix deprecated use of 0/NULL in gloo/cuda_allreduce_ring_chunked.h + 3
Summary: `nullptr` is typesafe. `0` and `NULL` are not. In the future, only `nullptr` will be allowed. This diff helps us embrace the future _now_ in service of enabling `-Wzero-as-null-pointer-constant`. Reviewed By: meyering Differential Revision: D54163047 fbshipit-source-id: 6f44e83af686111d6f47d51b81a3108ceb01b31e
1 parent 1161c1c commit 3e68ba1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

gloo/cuda_allreduce_ring_chunked.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ class CudaAllreduceRingChunked : public Algorithm {
3737
template <typename U = W>
3838
void init(
3939
typename std::enable_if<std::is_same<U, CudaHostWorkspace<T> >::value,
40-
typename U::Pointer>::type* = 0);
40+
typename U::Pointer>::type* = nullptr);
4141

4242
template <typename U = W>
4343
void init(
4444
typename std::enable_if<std::is_same<U, CudaDeviceWorkspace<T> >::value,
45-
typename U::Pointer>::type* = 0);
45+
typename U::Pointer>::type* = nullptr);
4646

4747
std::vector<CudaDevicePointer<T> > devicePtrs_;
4848
std::vector<CudaStream> streams_;

gloo/transport/tcp/tls/context.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ SSL_CTX *Context::create_ssl_ctx(const char *pkey, const char *cert,
5656
// SSL_load_error_strings();
5757
// SSL_library_init();
5858
_glootls::OPENSSL_init_ssl(
59-
OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
60-
_glootls::OPENSSL_init_ssl(0, NULL);
59+
OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, nullptr);
60+
_glootls::OPENSSL_init_ssl(0, nullptr);
6161
});
6262
SSL_CTX *ssl_ctx = _glootls::SSL_CTX_new(_glootls::TLS_method());
6363
GLOO_ENFORCE(ssl_ctx != nullptr, getSSLErrorMessage());

0 commit comments

Comments
 (0)