3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

Use nullptr rather than 0/NULL.

This commit is contained in:
Bruce Mitchener 2018-11-28 14:57:01 +07:00
parent eea9b79035
commit b83d6d77c9
9 changed files with 30 additions and 30 deletions

View file

@ -154,7 +154,7 @@ public:
return static_cast<unsigned>(reinterpret_cast<size_t *>(m_data)[SIZE_IDX]);
}
bool empty() const { return m_data == 0; }
bool empty() const { return m_data == nullptr; }
T & operator[](unsigned idx) {
SASSERT(idx < size());

View file

@ -146,7 +146,7 @@ struct scoped_timer::imp {
#if defined(_WINDOWS) || defined(_CYGWIN)
m_first = true;
CreateTimerQueueTimer(&m_timer,
NULL,
nullptr,
abort_proc,
this,
0,
@ -180,9 +180,9 @@ struct scoped_timer::imp {
m_ms = ms;
m_initialized = false;
m_signal_sent = false;
ENSURE(pthread_mutex_init(&m_mutex, NULL) == 0);
ENSURE(pthread_cond_init(&m_cond, NULL) == 0);
ENSURE(pthread_create(&m_thread_id, NULL, &thread_func, this) == 0);
ENSURE(pthread_mutex_init(&m_mutex, nullptr) == 0);
ENSURE(pthread_cond_init(&m_cond, nullptr) == 0);
ENSURE(pthread_create(&m_thread_id, nullptr, &thread_func, this) == 0);
#else
// Other platforms
#endif
@ -190,7 +190,7 @@ struct scoped_timer::imp {
~imp() {
#if defined(_WINDOWS) || defined(_CYGWIN)
DeleteTimerQueueTimer(NULL,
DeleteTimerQueueTimer(nullptr,
m_timer,
INVALID_HANDLE_VALUE);
#elif defined(__APPLE__) && defined(__MACH__)
@ -242,7 +242,7 @@ struct scoped_timer::imp {
// Perform signal outside of lock to avoid waking timing thread twice.
pthread_cond_signal(&m_cond);
pthread_join(m_thread_id, NULL);
pthread_join(m_thread_id, nullptr);
pthread_cond_destroy(&m_cond);
pthread_mutex_destroy(&m_mutex);
#else

View file

@ -88,7 +88,7 @@ void format2ostream(std::ostream & out, char const* msg, va_list args) {
#ifdef _WINDOWS
size_t msg_len = _vscprintf(msg, args_copy);
#else
size_t msg_len = vsnprintf(NULL, 0, msg, args_copy);
size_t msg_len = vsnprintf(nullptr, 0, msg, args_copy);
#endif
va_end(args_copy);