This is an automated email from the ASF dual-hosted git repository.
marcoabreu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new 2becd76 [MXNET-860] Update to modern nullptr usage (#12352)
2becd76 is described below
commit 2becd7641fbe264b72425fe6b1ded00cea19d3a8
Author: Kellen Sunderland <[email protected]>
AuthorDate: Thu Sep 20 14:49:54 2018 -0700
[MXNET-860] Update to modern nullptr usage (#12352)
* [MXNET-860] Update to modern nullptr usage
* [MXNET-860] Add nullptr rule to .clang-tidy rules
---
.clang-tidy | 2 +-
src/c_api/c_api_executor.cc | 2 +-
src/io/iter_image_det_recordio.cc | 4 ++--
src/io/iter_image_recordio.cc | 2 +-
src/io/iter_image_recordio_2.cc | 6 +++---
src/io/iter_mnist.cc | 4 ++--
src/ndarray/ndarray.cc | 2 +-
src/operator/bilinear_sampler.cc | 2 +-
src/operator/contrib/count_sketch.cc | 2 +-
src/operator/contrib/deformable_convolution.cc | 2 +-
src/operator/contrib/deformable_psroi_pooling.cc | 2 +-
src/operator/contrib/deformable_psroi_pooling.cu | 2 +-
src/operator/contrib/fft.cc | 2 +-
src/operator/contrib/ifft.cc | 2 +-
src/operator/contrib/multibox_detection.cc | 2 +-
src/operator/contrib/multibox_prior.cc | 2 +-
src/operator/contrib/multibox_target.cc | 2 +-
src/operator/contrib/psroi_pooling.cc | 2 +-
src/operator/contrib/psroi_pooling.cu | 2 +-
src/operator/convolution_v1.cc | 2 +-
src/operator/correlation.cc | 2 +-
src/operator/correlation.cu | 2 +-
src/operator/custom/custom.cc | 4 ++--
src/operator/grid_generator.cc | 2 +-
src/operator/l2_normalization.cc | 2 +-
src/operator/l2_normalization.cu | 2 +-
src/operator/leaky_relu.cc | 2 +-
src/operator/leaky_relu.cu | 2 +-
src/operator/make_loss.cc | 2 +-
src/operator/pad.cc | 2 +-
src/operator/pooling_v1.cc | 4 ++--
src/operator/rnn.cc | 2 +-
src/operator/roi_pooling.cc | 2 +-
src/operator/roi_pooling.cu | 2 +-
src/operator/sequence_last.cc | 2 +-
src/operator/sequence_mask.cc | 2 +-
src/operator/sequence_reverse.cc | 2 +-
src/operator/sequence_reverse.cu | 2 +-
src/operator/softmax_output.cc | 2 +-
src/operator/spatial_transformer.cc | 2 +-
src/operator/svm_output.cc | 2 +-
src/operator/swapaxis.cc | 2 +-
42 files changed, 48 insertions(+), 48 deletions(-)
diff --git a/.clang-tidy b/.clang-tidy
index c84ba32..af99026 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -54,7 +54,7 @@ Checks: >
# In order to trigger an error, you must have a rule defined both in checks
and in this section.
WarningsAsErrors: >
- cppcoreguidelines-no-malloc, performance-unnecessary-copy-initialization
+ cppcoreguidelines-no-malloc, modernize-use-nullptr,
performance-unnecessary-copy-initialization
# Todo: define a better regex match that includes most project headers, but
excludes third party
# code.
diff --git a/src/c_api/c_api_executor.cc b/src/c_api/c_api_executor.cc
index b993505..c3a6473 100644
--- a/src/c_api/c_api_executor.cc
+++ b/src/c_api/c_api_executor.cc
@@ -130,7 +130,7 @@ int MXExecutorBindX(SymbolHandle symbol_handle,
num_map_keys, map_keys, map_dev_types, map_dev_ids,
len, in_args, arg_grad_store, grad_req_type,
aux_states_len, aux_states,
- NULL, out);
+ nullptr, out);
}
int MXExecutorBindEX(SymbolHandle symbol_handle,
diff --git a/src/io/iter_image_det_recordio.cc
b/src/io/iter_image_det_recordio.cc
index b933700..62e362c 100644
--- a/src/io/iter_image_det_recordio.cc
+++ b/src/io/iter_image_det_recordio.cc
@@ -303,7 +303,7 @@ inline void ImageDetRecordIOParser<DType>::Init(
dmlc::InputSplit::Blob blob;
while (reader.NextRecord(&blob)) {
rec.Load(blob.dptr, blob.size);
- if (rec.label != NULL) {
+ if (rec.label != nullptr) {
if (param_.label_width > 0) {
CHECK_EQ(param_.label_width, rec.num_label)
<< "rec file provide " << rec.num_label << "-dimensional label
"
@@ -416,7 +416,7 @@ ParseNext(std::vector<InstVector<DType>> *out_vec) {
std::vector<float> label_buf;
if (this->label_map_ != nullptr) {
label_buf = label_map_->FindCopy(rec.image_index());
- } else if (rec.label != NULL) {
+ } else if (rec.label != nullptr) {
if (param_.label_width > 0) {
CHECK_EQ(param_.label_width, rec.num_label)
<< "rec file provide " << rec.num_label << "-dimensional label "
diff --git a/src/io/iter_image_recordio.cc b/src/io/iter_image_recordio.cc
index e8dcbef..066cad9 100644
--- a/src/io/iter_image_recordio.cc
+++ b/src/io/iter_image_recordio.cc
@@ -226,7 +226,7 @@ ParseNext(std::vector<InstVector<DType>> *out_vec) {
mshadow::Tensor<cpu, 1> label = out.label().Back();
if (label_map_ != nullptr) {
mshadow::Copy(label, label_map_->Find(rec.image_index()));
- } else if (rec.label != NULL) {
+ } else if (rec.label != nullptr) {
CHECK_EQ(param_.label_width, rec.num_label)
<< "rec file provide " << rec.num_label << "-dimensional label "
"but label_width is set to " << param_.label_width;
diff --git a/src/io/iter_image_recordio_2.cc b/src/io/iter_image_recordio_2.cc
index b6ff6e9..846d1ab 100644
--- a/src/io/iter_image_recordio_2.cc
+++ b/src/io/iter_image_recordio_2.cc
@@ -303,7 +303,7 @@ inline bool
ImageRecordIOParser2<DType>::ParseNext(DataBatch *out) {
if (!legacy_shuffle_) {
n_to_out = ParseChunk(data_dptr, label_dptr, current_size, &chunk);
} else {
- n_to_out = ParseChunk(NULL, NULL, batch_param_.batch_size, &chunk);
+ n_to_out = ParseChunk(nullptr, nullptr, batch_param_.batch_size,
&chunk);
}
// Count number of parsed images that do not fit into current out
n_parsed_ = inst_order_.size();
@@ -542,7 +542,7 @@ inline unsigned
ImageRecordIOParser2<DType>::ParseChunk(DType* data_dptr, real_t
std::vector<float> label_buf;
if (label_map_ != nullptr) {
label_buf = label_map_->FindCopy(rec.image_index());
- } else if (rec.label != NULL) {
+ } else if (rec.label != nullptr) {
CHECK_EQ(param_.label_width, rec.num_label)
<< "rec file provide " << rec.num_label << "-dimensional label "
"but label_width is set to " << param_.label_width;
@@ -624,7 +624,7 @@ inline void
ImageRecordIOParser2<DType>::CreateMeanImg(void) {
while (source_->NextChunk(&chunk)) {
inst_order_.clear();
// Parse chunk w/o putting anything in out
- ParseChunk(NULL, NULL, batch_param_.batch_size, &chunk);
+ ParseChunk(nullptr, nullptr, batch_param_.batch_size, &chunk);
for (unsigned i = 0; i < inst_order_.size(); ++i) {
std::pair<unsigned, unsigned> place = inst_order_[i];
mshadow::Tensor<cpu, 3> outimg =
diff --git a/src/io/iter_mnist.cc b/src/io/iter_mnist.cc
index 1882a56..4022347 100644
--- a/src/io/iter_mnist.cc
+++ b/src/io/iter_mnist.cc
@@ -80,11 +80,11 @@ struct MNISTParam : public dmlc::Parameter<MNISTParam> {
class MNISTIter: public IIterator<TBlobBatch> {
public:
MNISTIter(void) : loc_(0), inst_offset_(0) {
- img_.dptr_ = NULL;
+ img_.dptr_ = nullptr;
out_.data.resize(2);
}
virtual ~MNISTIter(void) {
- if (img_.dptr_ != NULL) delete []img_.dptr_;
+ if (img_.dptr_ != nullptr) delete []img_.dptr_;
}
// intialize iterator loads data in
virtual void Init(const std::vector<std::pair<std::string, std::string> >&
kwargs) {
diff --git a/src/ndarray/ndarray.cc b/src/ndarray/ndarray.cc
index ddffa28..b443d5d 100644
--- a/src/ndarray/ndarray.cc
+++ b/src/ndarray/ndarray.cc
@@ -2046,7 +2046,7 @@ void Imdecode(NDArray *ret, NDArray mean, size_t index,
#if MXNET_USE_OPENCV
cv::Mat buf(1, size, CV_8U, str_img);
cv::Mat res = cv::imdecode(buf, n_channels == 1 ? 0 : -1);
- CHECK(res.data != NULL) << "OpenCV Failed to decode image";
+ CHECK(res.data != nullptr) << "OpenCV Failed to decode image";
CHECK_LE(n_channels, static_cast<size_t>(res.channels()));
if (y1 - y0 == 0) {
x0 = 0;
diff --git a/src/operator/bilinear_sampler.cc b/src/operator/bilinear_sampler.cc
index a3b7d57..c435fde 100644
--- a/src/operator/bilinear_sampler.cc
+++ b/src/operator/bilinear_sampler.cc
@@ -163,7 +163,7 @@ namespace mxnet {
namespace op {
template<>
Operator* CreateOp<cpu>(BilinearSamplerParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new BilinearSamplerOp<cpu, DType>(param);
})
diff --git a/src/operator/contrib/count_sketch.cc
b/src/operator/contrib/count_sketch.cc
index 1281411..ca239b6 100644
--- a/src/operator/contrib/count_sketch.cc
+++ b/src/operator/contrib/count_sketch.cc
@@ -30,7 +30,7 @@ namespace op {
template<>
Operator *CreateOp<cpu>(CountSketchParam param, int dtype) {
LOG(FATAL) << "CountSketch is only available for GPU.";
- return NULL;
+ return nullptr;
}
Operator *CountSketchProp::CreateOperatorEx(Context ctx, std::vector<TShape>
*in_shape,
std::vector<int> *in_type) const {
diff --git a/src/operator/contrib/deformable_convolution.cc
b/src/operator/contrib/deformable_convolution.cc
index 352baa1..78a7a12 100644
--- a/src/operator/contrib/deformable_convolution.cc
+++ b/src/operator/contrib/deformable_convolution.cc
@@ -36,7 +36,7 @@ Operator* CreateOp<cpu>(DeformableConvolutionParam param, int
dtype,
std::vector<TShape> *in_shape,
std::vector<TShape> *out_shape,
Context ctx) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new DeformableConvolutionOp<cpu, DType>(param);
})
diff --git a/src/operator/contrib/deformable_psroi_pooling.cc
b/src/operator/contrib/deformable_psroi_pooling.cc
index 42cf6f1..6aaf607 100644
--- a/src/operator/contrib/deformable_psroi_pooling.cc
+++ b/src/operator/contrib/deformable_psroi_pooling.cc
@@ -81,7 +81,7 @@ namespace op {
template<>
Operator *CreateOp<cpu>(DeformablePSROIPoolingParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new DeformablePSROIPoolingOp<cpu, DType>(param);
});
diff --git a/src/operator/contrib/deformable_psroi_pooling.cu
b/src/operator/contrib/deformable_psroi_pooling.cu
index 71bbd4c..bf7d1c0 100644
--- a/src/operator/contrib/deformable_psroi_pooling.cu
+++ b/src/operator/contrib/deformable_psroi_pooling.cu
@@ -423,7 +423,7 @@ namespace op {
template<>
Operator* CreateOp<gpu>(DeformablePSROIPoolingParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new DeformablePSROIPoolingOp<gpu, DType>(param);
});
diff --git a/src/operator/contrib/fft.cc b/src/operator/contrib/fft.cc
index 8332451..4a43958 100644
--- a/src/operator/contrib/fft.cc
+++ b/src/operator/contrib/fft.cc
@@ -30,7 +30,7 @@ namespace op {
template<>
Operator *CreateOp<cpu>(FFTParam param, int dtype) {
LOG(FATAL) << "fft is only available for GPU.";
- return NULL;
+ return nullptr;
}
Operator *FFTProp::CreateOperatorEx(Context ctx, std::vector<TShape> *in_shape,
diff --git a/src/operator/contrib/ifft.cc b/src/operator/contrib/ifft.cc
index 26e7041..cb4605d 100644
--- a/src/operator/contrib/ifft.cc
+++ b/src/operator/contrib/ifft.cc
@@ -31,7 +31,7 @@ namespace op {
template<>
Operator *CreateOp<cpu>(IFFTParam param, int dtype) {
LOG(FATAL) << "ifft is only available for GPU.";
- return NULL;
+ return nullptr;
}
Operator *IFFTProp::CreateOperatorEx(Context ctx, std::vector<TShape>
*in_shape,
diff --git a/src/operator/contrib/multibox_detection.cc
b/src/operator/contrib/multibox_detection.cc
index f92460e..c005dfa 100644
--- a/src/operator/contrib/multibox_detection.cc
+++ b/src/operator/contrib/multibox_detection.cc
@@ -198,7 +198,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(MultiBoxDetectionParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new MultiBoxDetectionOp<cpu, DType>(param);
});
diff --git a/src/operator/contrib/multibox_prior.cc
b/src/operator/contrib/multibox_prior.cc
index 22a9c10..579ea60 100644
--- a/src/operator/contrib/multibox_prior.cc
+++ b/src/operator/contrib/multibox_prior.cc
@@ -76,7 +76,7 @@ namespace mxnet {
namespace op {
template<>
Operator* CreateOp<cpu>(MultiBoxPriorParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new MultiBoxPriorOp<cpu, DType>(param);
});
diff --git a/src/operator/contrib/multibox_target.cc
b/src/operator/contrib/multibox_target.cc
index 2fa041d..093234b 100644
--- a/src/operator/contrib/multibox_target.cc
+++ b/src/operator/contrib/multibox_target.cc
@@ -284,7 +284,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(MultiBoxTargetParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new MultiBoxTargetOp<cpu, DType>(param);
});
diff --git a/src/operator/contrib/psroi_pooling.cc
b/src/operator/contrib/psroi_pooling.cc
index 75b5334..d3a3871 100644
--- a/src/operator/contrib/psroi_pooling.cc
+++ b/src/operator/contrib/psroi_pooling.cc
@@ -66,7 +66,7 @@ namespace op {
template<>
Operator *CreateOp<cpu>(PSROIPoolingParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new PSROIPoolingOp<cpu, DType>(param);
});
diff --git a/src/operator/contrib/psroi_pooling.cu
b/src/operator/contrib/psroi_pooling.cu
index 4721316..e4de924 100644
--- a/src/operator/contrib/psroi_pooling.cu
+++ b/src/operator/contrib/psroi_pooling.cu
@@ -268,7 +268,7 @@ namespace op {
template<>
Operator* CreateOp<gpu>(PSROIPoolingParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new PSROIPoolingOp<gpu, DType>(param);
});
diff --git a/src/operator/convolution_v1.cc b/src/operator/convolution_v1.cc
index 86c0fbb..b6250a7 100644
--- a/src/operator/convolution_v1.cc
+++ b/src/operator/convolution_v1.cc
@@ -38,7 +38,7 @@ Operator* CreateOp<cpu>(ConvolutionV1Param param, int dtype,
std::vector<TShape> *in_shape,
std::vector<TShape> *out_shape,
Context ctx) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new ConvolutionV1Op<cpu, DType>(param);
})
diff --git a/src/operator/correlation.cc b/src/operator/correlation.cc
index fe89e84..d0c664a 100644
--- a/src/operator/correlation.cc
+++ b/src/operator/correlation.cc
@@ -149,7 +149,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(CorrelationParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new CorrelationOp<cpu, DType>(param);
});
diff --git a/src/operator/correlation.cu b/src/operator/correlation.cu
index 6bc16cd..821b900 100644
--- a/src/operator/correlation.cu
+++ b/src/operator/correlation.cu
@@ -622,7 +622,7 @@ namespace mxnet {
namespace op {
template<>
Operator* CreateOp<gpu>(CorrelationParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new CorrelationOp<gpu, DType>(param);
});
diff --git a/src/operator/custom/custom.cc b/src/operator/custom/custom.cc
index d117a28..4cda137 100644
--- a/src/operator/custom/custom.cc
+++ b/src/operator/custom/custom.cc
@@ -75,12 +75,12 @@ inline void AllocateNDArrayCopy(NDArray** nd,
template<CustomOpPropCallbacks Type>
std::vector<std::string> List(const NodeAttrs& attrs) {
const CustomParam& params = nnvm::get<CustomParam>(attrs.parsed);
- char ** args = NULL;
+ char ** args = nullptr;
CHECK(reinterpret_cast<CustomOpListFunc>(
params.info->callbacks[Type])(
&args, params.info->contexts[Type]));
std::vector<std::string> ret;
- for (int i = 0; args[i] != NULL; ++i) {
+ for (int i = 0; args[i] != nullptr; ++i) {
ret.push_back(args[i]);
}
return ret;
diff --git a/src/operator/grid_generator.cc b/src/operator/grid_generator.cc
index ea6e661..96ec5d5 100644
--- a/src/operator/grid_generator.cc
+++ b/src/operator/grid_generator.cc
@@ -30,7 +30,7 @@ namespace mxnet {
namespace op {
template<>
Operator* CreateOp<cpu>(GridGeneratorParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
if (dtype == mshadow::kFloat32) {
op = new GridGeneratorOp<cpu, float>(param);
} else {
diff --git a/src/operator/l2_normalization.cc b/src/operator/l2_normalization.cc
index c313b44..f2f485a 100644
--- a/src/operator/l2_normalization.cc
+++ b/src/operator/l2_normalization.cc
@@ -27,7 +27,7 @@ namespace mxnet {
namespace op {
template<>
Operator* CreateOp<cpu>(L2NormalizationParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new L2NormalizationOp<cpu, DType>(param);
});
diff --git a/src/operator/l2_normalization.cu b/src/operator/l2_normalization.cu
index 2034f98..e515781 100644
--- a/src/operator/l2_normalization.cu
+++ b/src/operator/l2_normalization.cu
@@ -27,7 +27,7 @@ namespace mxnet {
namespace op {
template<>
Operator* CreateOp<gpu>(L2NormalizationParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new L2NormalizationOp<gpu, DType>(param);
});
diff --git a/src/operator/leaky_relu.cc b/src/operator/leaky_relu.cc
index 4bb2423..45f9511 100644
--- a/src/operator/leaky_relu.cc
+++ b/src/operator/leaky_relu.cc
@@ -31,7 +31,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(LeakyReLUParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new LeakyReLUOp<cpu, DType>(param);
});
diff --git a/src/operator/leaky_relu.cu b/src/operator/leaky_relu.cu
index 74b444d..a2e0e95 100644
--- a/src/operator/leaky_relu.cu
+++ b/src/operator/leaky_relu.cu
@@ -30,7 +30,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<gpu>(LeakyReLUParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new LeakyReLUOp<gpu, DType>(param);
});
diff --git a/src/operator/make_loss.cc b/src/operator/make_loss.cc
index 14304d3..7e45f4c 100644
--- a/src/operator/make_loss.cc
+++ b/src/operator/make_loss.cc
@@ -28,7 +28,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(MakeLossParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new MakeLossOp<cpu, DType>(param);
});
diff --git a/src/operator/pad.cc b/src/operator/pad.cc
index 2332c93..6c66b29 100644
--- a/src/operator/pad.cc
+++ b/src/operator/pad.cc
@@ -668,7 +668,7 @@ namespace mxnet {
namespace op {
template <>
Operator *CreateOp<cpu>(PadParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, { op = new PadOp<cpu, DType>(param);
})
return op;
}
diff --git a/src/operator/pooling_v1.cc b/src/operator/pooling_v1.cc
index 5b68a08..afb51d7 100644
--- a/src/operator/pooling_v1.cc
+++ b/src/operator/pooling_v1.cc
@@ -30,7 +30,7 @@ namespace op {
template<>
Operator *CreateOp<cpu>(PoolingV1Param param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
switch (param.pool_type) {
case pool_v1_enum::kMaxPooling:
@@ -44,7 +44,7 @@ Operator *CreateOp<cpu>(PoolingV1Param param, int dtype) {
break;
default:
LOG(FATAL) << "unknown pooling type";
- return NULL;
+ return nullptr;
}
})
diff --git a/src/operator/rnn.cc b/src/operator/rnn.cc
index 73ef4f0..9ba7649 100644
--- a/src/operator/rnn.cc
+++ b/src/operator/rnn.cc
@@ -29,7 +29,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(RNNParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new RNNOp<DType>(param);
});
diff --git a/src/operator/roi_pooling.cc b/src/operator/roi_pooling.cc
index 124d811..7f15dcb 100644
--- a/src/operator/roi_pooling.cc
+++ b/src/operator/roi_pooling.cc
@@ -234,7 +234,7 @@ namespace op {
template<>
Operator *CreateOp<cpu>(ROIPoolingParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new ROIPoolingOp<cpu, DType>(param);
});
diff --git a/src/operator/roi_pooling.cu b/src/operator/roi_pooling.cu
index 066c2ff..9ea99b3 100644
--- a/src/operator/roi_pooling.cu
+++ b/src/operator/roi_pooling.cu
@@ -264,7 +264,7 @@ namespace op {
template<>
Operator* CreateOp<gpu>(ROIPoolingParam param, int dtype) {
- Operator* op = NULL;
+ Operator* op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new ROIPoolingOp<gpu, DType>(param);
});
diff --git a/src/operator/sequence_last.cc b/src/operator/sequence_last.cc
index f87400b..345524b 100644
--- a/src/operator/sequence_last.cc
+++ b/src/operator/sequence_last.cc
@@ -29,7 +29,7 @@ namespace mxnet {
namespace op {
template <>
Operator *CreateOp<cpu>(SequenceLastParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_TYPE_SWITCH(dtype, DType,
{ op = new SequenceLastOp<cpu, DType>(param); })
return op;
diff --git a/src/operator/sequence_mask.cc b/src/operator/sequence_mask.cc
index 047634c..e02c57b 100644
--- a/src/operator/sequence_mask.cc
+++ b/src/operator/sequence_mask.cc
@@ -29,7 +29,7 @@ namespace mxnet {
namespace op {
template <>
Operator *CreateOp<cpu>(SequenceMaskParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_TYPE_SWITCH(dtype, DType,
{ op = new SequenceMaskOp<cpu, DType>(param); })
return op;
diff --git a/src/operator/sequence_reverse.cc b/src/operator/sequence_reverse.cc
index 834e4f4..21cab78 100644
--- a/src/operator/sequence_reverse.cc
+++ b/src/operator/sequence_reverse.cc
@@ -29,7 +29,7 @@ namespace mxnet {
namespace op {
template <>
Operator *CreateOp<cpu>(SequenceReverseParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_TYPE_SWITCH(dtype, DType,
{ op = new SequenceReverseOp<cpu, DType>(param); })
return op;
diff --git a/src/operator/sequence_reverse.cu b/src/operator/sequence_reverse.cu
index 9c15748..1edc9c1 100644
--- a/src/operator/sequence_reverse.cu
+++ b/src/operator/sequence_reverse.cu
@@ -29,7 +29,7 @@
namespace mxnet {
namespace op {
template <> Operator *CreateOp<gpu>(SequenceReverseParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_TYPE_SWITCH(dtype, DType, {
op = new SequenceReverseOp<gpu, DType>(param);
})
diff --git a/src/operator/softmax_output.cc b/src/operator/softmax_output.cc
index 27b3295..5ba421f 100644
--- a/src/operator/softmax_output.cc
+++ b/src/operator/softmax_output.cc
@@ -29,7 +29,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(SoftmaxOutputParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new SoftmaxOutputOp<cpu, DType>(param);
})
diff --git a/src/operator/spatial_transformer.cc
b/src/operator/spatial_transformer.cc
index 8c6779d..2dcb427 100644
--- a/src/operator/spatial_transformer.cc
+++ b/src/operator/spatial_transformer.cc
@@ -153,7 +153,7 @@ namespace mxnet {
namespace op {
template<>
Operator* CreateOp<cpu>(SpatialTransformerParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new SpatialTransformerOp<cpu, DType>(param);
})
diff --git a/src/operator/svm_output.cc b/src/operator/svm_output.cc
index c84c2af..a291f72 100644
--- a/src/operator/svm_output.cc
+++ b/src/operator/svm_output.cc
@@ -71,7 +71,7 @@ namespace mxnet {
namespace op {
template<>
Operator *CreateOp<cpu>(SVMOutputParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_REAL_TYPE_SWITCH(dtype, DType, {
op = new SVMOutputOp<cpu, DType>(param);
})
diff --git a/src/operator/swapaxis.cc b/src/operator/swapaxis.cc
index 12bc52e..b78062f 100644
--- a/src/operator/swapaxis.cc
+++ b/src/operator/swapaxis.cc
@@ -31,7 +31,7 @@ namespace op {
template<>
Operator* CreateOp<cpu>(SwapAxisParam param, int dtype) {
- Operator *op = NULL;
+ Operator *op = nullptr;
MSHADOW_TYPE_SWITCH(dtype, DType, {
op = new SwapAxisOp<cpu, DType>(param);
});