Remove redundant NULL/nullptr parameters
Calling std::unique_ptr<T>::reset(T*) with NULL/nullptr is just
redundant. We can safely remove those NULL/nullptr.
This is a mechanical refactoring. No behavior change is intended.
REF_BUG=9164610
REF_CL=112205175
REF_TIME=2016-01-14T17:01:23-08:00
REF_TIME_RAW=1452819683 -0800
Yohei Yukawa
8 years ago
55 | 55 |
}
|
56 | 56 |
|
57 | 57 |
virtual void TearDown() {
|
58 | |
codegen_stream_.reset(NULL);
|
59 | |
result_stream_.reset(NULL);
|
|
58 |
codegen_stream_.reset();
|
|
59 |
result_stream_.reset();
|
60 | 60 |
}
|
61 | 61 |
|
62 | 62 |
string ExpectedOutput(const string &var_name_base,
|
45 | 45 |
}
|
46 | 46 |
|
47 | 47 |
InputMultiFile::~InputMultiFile() {
|
48 | |
ifs_.reset(NULL);
|
|
48 |
ifs_.reset();
|
49 | 49 |
}
|
50 | 50 |
|
51 | 51 |
bool InputMultiFile::ReadLine(string* line) {
|
137 | 137 |
if (0 != pthread_create(state_->handle_.get(), 0, &Thread::WrapperForPOSIX,
|
138 | 138 |
static_cast<void *>(this))) {
|
139 | 139 |
state_->is_running_ = false;
|
140 | |
state_->handle_.reset(nullptr);
|
|
140 |
state_->handle_.reset();
|
141 | 141 |
}
|
142 | 142 |
}
|
143 | 143 |
|
|
148 | 148 |
void Thread::Detach() {
|
149 | 149 |
if (state_->handle_ != nullptr) {
|
150 | 150 |
pthread_detach(*state_->handle_);
|
151 | |
state_->handle_.reset(nullptr);
|
|
151 |
state_->handle_.reset();
|
152 | 152 |
}
|
153 | 153 |
}
|
154 | 154 |
|
|
160 | 160 |
return;
|
161 | 161 |
}
|
162 | 162 |
pthread_join(*state_->handle_, nullptr);
|
163 | |
state_->handle_.reset(nullptr);
|
|
163 |
state_->handle_.reset();
|
164 | 164 |
}
|
165 | 165 |
|
166 | 166 |
namespace {
|
|
242 | 242 |
// pthread_cancel (or pthread_kill in PThreadCancel on Android) is
|
243 | 243 |
// asynchronous. Join the thread to behave like TerminateThread on Windows.
|
244 | 244 |
Join();
|
245 | |
state_->handle_.reset(nullptr);
|
|
245 |
state_->handle_.reset();
|
246 | 246 |
}
|
247 | 247 |
}
|
248 | 248 |
|
881 | 881 |
num_bytes, &num_bytes)) {
|
882 | 882 |
const DWORD last_error = ::GetLastError();
|
883 | 883 |
DLOG(ERROR) << "GetTokenInformation failed. Last error: " << last_error;
|
884 | |
buffer_.reset(nullptr);
|
|
884 |
buffer_.reset();
|
885 | 885 |
return;
|
886 | 886 |
}
|
887 | 887 |
initialized_ = true;
|
54 | 54 |
}
|
55 | 55 |
|
56 | 56 |
virtual void TearDown() {
|
57 | |
louds_trie_.reset(nullptr);
|
58 | |
louds_trie_builder_.reset(nullptr);
|
|
57 |
louds_trie_.reset();
|
|
58 |
louds_trie_builder_.reset();
|
59 | 59 |
}
|
60 | 60 |
|
61 | 61 |
void AddValue(const string &value) {
|
80 | 80 |
void IPCServer::Wait() {
|
81 | 81 |
if (server_thread_.get() != NULL) {
|
82 | 82 |
server_thread_->Join();
|
83 | |
server_thread_.reset(NULL);
|
|
83 |
server_thread_.reset();
|
84 | 84 |
}
|
85 | 85 |
}
|
86 | 86 |
|
0 | 0 |
MAJOR=2
|
1 | 1 |
MINOR=17
|
2 | |
BUILD=2413
|
|
2 |
BUILD=2414
|
3 | 3 |
REVISION=102
|
4 | 4 |
# NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
|
5 | 5 |
# downloaded by NaCl Mozc.
|
284 | 284 |
CallCommand(client.get(), *(pending_command_.get()));
|
285 | 285 |
}
|
286 | 286 |
}
|
287 | |
pending_command_.reset(NULL);
|
|
287 |
pending_command_.reset();
|
288 | 288 |
|
289 | 289 |
// |renderer_status_| is also protected by mutex.
|
290 | 290 |
// Until this method finsihs, SetPendingCommand is blocked.
|
96 | 96 |
// Unregisters mocked PackedDataManager.
|
97 | 97 |
packed::RegisterPackedDataManager(NULL);
|
98 | 98 |
#endif // MOZC_USE_PACKED_DICTIONARY
|
99 | |
dictionary_mock_.reset(NULL);
|
|
99 |
dictionary_mock_.reset();
|
100 | 100 |
usage_stats::UsageStats::ClearAllStatsForTest();
|
101 | 101 |
}
|
102 | 102 |
|
200 | 200 |
if (!storage_->OpenOrCreate(filename.c_str(),
|
201 | 201 |
kValueSize, kLRUSize, kSeedValue)) {
|
202 | 202 |
LOG(WARNING) << "cannot initialize UserBoundaryHistoryRewriter";
|
203 | |
storage_.reset(NULL);
|
|
203 |
storage_.reset();
|
204 | 204 |
return false;
|
205 | 205 |
}
|
206 | 206 |
|
828 | 828 |
if (!storage_->OpenOrCreate(filename.c_str(),
|
829 | 829 |
kValueSize, kLRUSize, kSeedValue)) {
|
830 | 830 |
LOG(WARNING) << "cannot initialize UserSegmentHistoryRewriter";
|
831 | |
storage_.reset(NULL);
|
|
831 |
storage_.reset();
|
832 | 832 |
return false;
|
833 | 833 |
}
|
834 | 834 |
|
82 | 82 |
|
83 | 83 |
void Louds::Reset() {
|
84 | 84 |
index_.Reset();
|
85 | |
select_cache_.reset(nullptr);
|
|
85 |
select_cache_.reset();
|
86 | 86 |
select0_cache_size_ = 0;
|
87 | 87 |
select1_cache_size_ = 0;
|
88 | 88 |
}
|
56 | 56 |
}
|
57 | 57 |
|
58 | 58 |
virtual void TearDown() {
|
59 | |
mozc_engine_.reset(NULL);
|
|
59 |
mozc_engine_.reset();
|
60 | 60 |
}
|
61 | 61 |
|
62 | 62 |
client::ClientMock* mock_;
|
920 | 920 |
}
|
921 | 921 |
|
922 | 922 |
void InvalidateLangBarInfoCache() {
|
923 | |
langbar_info_cache_.reset(nullptr);
|
|
923 |
langbar_info_cache_.reset();
|
924 | 924 |
}
|
925 | 925 |
|
926 | 926 |
void SetDeferredLangBarUpdate(bool enabled, commands::CompositionMode mode) {
|