Skip to content

Commit

Permalink
More usage of nullptr
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Heller committed Oct 20, 2017
1 parent 6e7cbb5 commit 096bf5e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion hpx/components/performance_counters/papi/server/papi.hpp
Expand Up @@ -184,7 +184,7 @@ namespace hpx { namespace performance_counters { namespace papi { namespace serv

papi_counter():
event_(PAPI_NULL), index_(-1), value_(0), timestamp_(-1),
status_(PAPI_COUNTER_STOPPED), counters_(0) { }
status_(PAPI_COUNTER_STOPPED), counters_(nullptr) { }
papi_counter(hpx::performance_counters::counter_info const& info);

// start the counter
Expand Down
4 changes: 2 additions & 2 deletions hpx/components/performance_counters/papi/util/papi.hpp
Expand Up @@ -91,9 +91,9 @@ namespace hpx { namespace performance_counters { namespace papi { namespace util

PAPI_event_info_t const *operator()()
{
if (!active_) return 0;
if (!active_) return nullptr;
while (!get_info())
if (!(active_ = get_next_event())) return 0;
if (!(active_ = get_next_event())) return nullptr;
active_ = get_next_event();
return &info_;
}
Expand Down
2 changes: 1 addition & 1 deletion hpx/util/detail/yield_k.hpp
Expand Up @@ -65,7 +65,7 @@ namespace hpx { namespace util { namespace detail
rqtp.tv_sec = 0;
rqtp.tv_nsec = 1000;

nanosleep( &rqtp, 0 );
nanosleep( &rqtp, nullptr );
#else
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/iostreams/standard_streams.cpp
Expand Up @@ -111,7 +111,7 @@ namespace hpx { namespace iostreams

std::stringstream const& get_consolestream()
{
if (get_runtime_ptr() != 0 && !agas::is_console())
if (get_runtime_ptr() != nullptr && !agas::is_console())
{
HPX_THROW_EXCEPTION(service_unavailable,
"hpx::iostreams::get_consolestream",
Expand Down
2 changes: 1 addition & 1 deletion src/components/performance_counters/papi/papi_startup.cpp
Expand Up @@ -131,7 +131,7 @@ namespace hpx { namespace performance_counters { namespace papi
{
typename boost::generator_iterator_generator<T>::type gi =
boost::make_generator_iterator(gen);
for ( ; *gi != 0; ++gi)
for ( ; *gi != nullptr; ++gi)
{
std::set<std::string>::const_iterator it;
// iterate over known thread names
Expand Down
4 changes: 2 additions & 2 deletions src/components/performance_counters/papi/util/papi.cpp
Expand Up @@ -202,7 +202,7 @@ namespace hpx { namespace performance_counters { namespace papi { namespace util
// collect available events and print their descriptions
avail_preset_info_gen gen;
boost::generator_iterator_generator<avail_preset_info_gen>::type it;
for (it = boost::make_generator_iterator(gen); *it != 0; ++it)
for (it = boost::make_generator_iterator(gen); *it != nullptr; ++it)
{
hpx::util::format_to(std::cout,
"Event : %s\n"
Expand Down Expand Up @@ -271,7 +271,7 @@ namespace hpx { namespace performance_counters { namespace papi { namespace util
native_info_gen gen(ci);
boost::generator_iterator_generator<native_info_gen>::type it =
boost::make_generator_iterator(gen);
for ( ; *it != 0; ++it)
for ( ; *it != nullptr; ++it)
print_native_info(**it);
}
}
Expand Down

0 comments on commit 096bf5e

Please sign in to comment.