Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1a15625 authored by Yi Kong's avatar Yi Kong
Browse files

Modernize codebase by replacing NULL with nullptr

Fixes -Wzero-as-null-pointer-constant warning for binder.

Test: m
Bug: 68236239
Change-Id: I8184bd6aa4ebff1bd8c88dad16886e98df853b03
parent d73414c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ struct log_msg {
      hdr_size = sizeof(entry_v1);
    }
    if ((hdr_size < sizeof(entry_v1)) || (hdr_size > sizeof(entry))) {
      return NULL;
      return nullptr;
    }
    return reinterpret_cast<char*>(buf) + hdr_size;
  }
+1 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ inline bool createThreadEtc(thread_func_t entryFunction,
                            const char* threadName = "android:unnamed_thread",
                            int32_t threadPriority = PRIORITY_DEFAULT,
                            size_t threadStackSize = 0,
                            thread_id_t *threadId = 0)
                            thread_id_t *threadId = nullptr)
{
    return androidCreateThreadEtc(entryFunction, userData, threadName,
        threadPriority, threadStackSize, threadId) ? true : false;
+3 −3
Original line number Diff line number Diff line
@@ -49,13 +49,13 @@ public:
    // Dump a stack trace to the log using the supplied logtag.
    void log(const char* logtag,
             android_LogPriority priority = ANDROID_LOG_DEBUG,
             const char* prefix = 0) const;
             const char* prefix = nullptr) const;

    // Dump a stack trace to the specified file descriptor.
    void dump(int fd, int indent = 0, const char* prefix = 0) const;
    void dump(int fd, int indent = 0, const char* prefix = nullptr) const;

    // Return a string (possibly very long) containing the complete stack trace.
    String8 toString(const char* prefix = 0) const;
    String8 toString(const char* prefix = nullptr) const;

    // Dump a serialized representation of the stack trace to the specified printer.
    void print(Printer& printer) const;
+2 −2
Original line number Diff line number Diff line
@@ -262,7 +262,7 @@ public:
     */
    int pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outData);
    inline int pollOnce(int timeoutMillis) {
        return pollOnce(timeoutMillis, NULL, NULL, NULL);
        return pollOnce(timeoutMillis, nullptr, nullptr, nullptr);
    }

    /**
@@ -272,7 +272,7 @@ public:
     */
    int pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData);
    inline int pollAll(int timeoutMillis) {
        return pollAll(timeoutMillis, NULL, NULL, NULL);
        return pollAll(timeoutMillis, nullptr, nullptr, nullptr);
    }

    /**
+4 −4
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ class CAPABILITY("mutex") Mutex {

    Mutex();
    explicit Mutex(const char* name);
    explicit Mutex(int type, const char* name = NULL);
    explicit Mutex(int type, const char* name = nullptr);
    ~Mutex();

    // lock or unlock the mutex
@@ -160,10 +160,10 @@ class CAPABILITY("mutex") Mutex {
#if !defined(_WIN32)

inline Mutex::Mutex() {
    pthread_mutex_init(&mMutex, NULL);
    pthread_mutex_init(&mMutex, nullptr);
}
inline Mutex::Mutex(__attribute__((unused)) const char* name) {
    pthread_mutex_init(&mMutex, NULL);
    pthread_mutex_init(&mMutex, nullptr);
}
inline Mutex::Mutex(int type, __attribute__((unused)) const char* name) {
    if (type == SHARED) {
@@ -173,7 +173,7 @@ inline Mutex::Mutex(int type, __attribute__((unused)) const char* name) {
        pthread_mutex_init(&mMutex, &attr);
        pthread_mutexattr_destroy(&attr);
    } else {
        pthread_mutex_init(&mMutex, NULL);
        pthread_mutex_init(&mMutex, nullptr);
    }
}
inline Mutex::~Mutex() {
Loading