Fix compiler warning [-Wtautological-undefined-compare]

clang warning:

src/lstm/networkio.cpp:56:15: warning:
 'this' pointer cannot be null in well-defined C++ code;
 comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2018-07-04 21:09:56 +02:00
parent 52d392da50
commit c1be1024be

View File

@ -50,10 +50,9 @@ void NetworkIO::Resize2d(bool int_mode, int width, int num_features) {
// Resizes to a specific stride_map. // Resizes to a specific stride_map.
void NetworkIO::ResizeToMap(bool int_mode, const StrideMap& stride_map, void NetworkIO::ResizeToMap(bool int_mode, const StrideMap& stride_map,
int num_features) { int num_features) {
// If this assert fails, it most likely got here through an uninitialized // If this method crashes with this == nullptr,
// scratch element, ie call NetworkScratch::IO::Resizexxx() not // it most likely got here through an uninitialized scratch element,
// NetworkIO::Resizexxx()!! // ie call NetworkScratch::IO::Resizexxx() not NetworkIO::Resizexxx()!!
ASSERT_HOST(this != nullptr);
stride_map_ = stride_map; stride_map_ = stride_map;
int_mode_ = int_mode; int_mode_ = int_mode;
if (int_mode_) { if (int_mode_) {