diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-06-05 07:16:03 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-06-05 07:19:21 -0700 |
commit | 48a4853ebeabfa32b360e8505caf4ec31a45cdb3 (patch) | |
tree | 3abc325fda2085583555be4cb2a393da25f3ff71 /tensorflow/core/lib/io | |
parent | 7ffc3573255ecdc27b63c6d7dfefa8345225593d (diff) |
Miscellaneous cleanups
PiperOrigin-RevId: 158012131
Diffstat (limited to 'tensorflow/core/lib/io')
-rw-r--r-- | tensorflow/core/lib/io/inputbuffer_test.cc | 6 | ||||
-rw-r--r-- | tensorflow/core/lib/io/zlib_inputstream.cc | 18 |
2 files changed, 11 insertions, 13 deletions
diff --git a/tensorflow/core/lib/io/inputbuffer_test.cc b/tensorflow/core/lib/io/inputbuffer_test.cc index 4571df9a98..6771697a16 100644 --- a/tensorflow/core/lib/io/inputbuffer_test.cc +++ b/tensorflow/core/lib/io/inputbuffer_test.cc @@ -298,9 +298,9 @@ TEST(InputBuffer, ReadVarint32) { // Generates data. std::vector<uint32> data; uint32 i = 0; - for (; i < (1 << 10); i += 1) data.push_back(i); - for (; i < (1 << 15); i += 5) data.push_back(i); - for (; i < (1 << 31); i += 132817) data.push_back(i); + for (; i < (1U << 10); i += 1) data.push_back(i); + for (; i < (1U << 15); i += 5) data.push_back(i); + for (; i < (1U << 31); i += 132817) data.push_back(i); data.push_back(std::numeric_limits<uint32>::max()); // Writes the varints. diff --git a/tensorflow/core/lib/io/zlib_inputstream.cc b/tensorflow/core/lib/io/zlib_inputstream.cc index 3de157a1fc..4999d5cc90 100644 --- a/tensorflow/core/lib/io/zlib_inputstream.cc +++ b/tensorflow/core/lib/io/zlib_inputstream.cc @@ -58,16 +58,14 @@ void ZlibInputStream::InitZlibBuffer() { z_stream_->avail_in = 0; int status = inflateInit2(z_stream_.get(), zlib_options_.window_bits); - if (status != Z_OK) { - LOG(FATAL) << "inflateInit failed with status " << status; - z_stream_.reset(nullptr); - } else { - z_stream_->next_in = z_stream_input_.get(); - z_stream_->next_out = z_stream_output_.get(); - next_unread_byte_ = reinterpret_cast<char*>(z_stream_output_.get()); - z_stream_->avail_in = 0; - z_stream_->avail_out = output_buffer_capacity_; - } + + CHECK_EQ(status, Z_OK) << "inflateInit failed with status " << status; + + z_stream_->next_in = z_stream_input_.get(); + z_stream_->next_out = z_stream_output_.get(); + next_unread_byte_ = reinterpret_cast<char*>(z_stream_output_.get()); + z_stream_->avail_in = 0; + z_stream_->avail_out = output_buffer_capacity_; } Status ZlibInputStream::ReadFromStream() { |