]> git.sesse.net Git - cubemap/blobdiff - accesslog.cpp
Use nullptr instead of NULL everywhere.
[cubemap] / accesslog.cpp
index af53872e6ec03c0d68f83b86e4b9c9f83320eb6d..4a54fdb8692b63c72ec6f85b8d37e37db5f7f125 100644 (file)
@@ -14,12 +14,12 @@ using namespace std;
 
 AccessLogThread::AccessLogThread()
 {
-       pthread_mutex_init(&mutex, NULL);
+       pthread_mutex_init(&mutex, nullptr);
 }
 
 AccessLogThread::AccessLogThread(const string &filename)
        : filename(filename) {
-       pthread_mutex_init(&mutex, NULL);
+       pthread_mutex_init(&mutex, nullptr);
 }
 
 void AccessLogThread::write(const ClientStats& client)
@@ -35,10 +35,10 @@ void AccessLogThread::do_work()
 {
        // Open the file.
        if (filename.empty()) {
-               logfp = NULL;
+               logfp = nullptr;
        } else {
                logfp = fopen(filename.c_str(), "a+");
-               if (logfp == NULL) {
+               if (logfp == nullptr) {
                        log_perror(filename.c_str());
                        // Continue as before.
                }
@@ -52,7 +52,7 @@ void AccessLogThread::do_work()
                        swap(pending_writes, writes);
                }
 
-               if (logfp != NULL) {
+               if (logfp != nullptr) {
                        // Do the actual writes.
                        timespec now_monotonic;
                        timespec now_realtime;
@@ -82,14 +82,14 @@ void AccessLogThread::do_work()
 
                // Wait until we are being woken up, either to quit or because
                // there is material in pending_writes.
-               wait_for_wakeup(NULL);
+               wait_for_wakeup(nullptr);
        }
 
-       if (logfp != NULL) {    
+       if (logfp != nullptr) { 
                if (fclose(logfp) == EOF) {
                        log_perror("fclose");
                }
        }
 
-       logfp = NULL;
+       logfp = nullptr;
 }