diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -586,7 +586,7 @@ if (startswith(path, "/dev/")) { std::string filename = path.substr(strlen("/dev/")); EmulatedDriver *drv = p->findDriver(filename); - if (drv != NULL) { + if (drv != nullptr) { // driver's open method will allocate a fd if necessary. DPRINTF_SYSCALL(Verbose, "open%s: passing call to " "driver open with path[%s]\n", @@ -1135,7 +1135,7 @@ return -EINVAL; ThreadContext *ctc; - if ((ctc = p->stealFreeContext()) == NULL) + if ((ctc = p->stealFreeContext()) == nullptr) fatal("clone: no spare thread context in system"); ProcessParams *pp = new ProcessParams(); @@ -1402,7 +1402,7 @@ sim_fd = ffd->getSimFD(); - pmap = (decltype(pmap))mmap(NULL, length, PROT_READ, MAP_PRIVATE, + pmap = (decltype(pmap))mmap(nullptr, length, PROT_READ, MAP_PRIVATE, sim_fd, offset); if (pmap == (decltype(pmap))-1) { # Node ID 3b22b3ca467562233f3e469d2d55bbaa1968268a # Parent 2b1d19988d1e821287c2a0d08691f6ebee6aeb16 diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc --- a/src/sim/syscall_emul.cc +++ b/src/sim/syscall_emul.cc @@ -425,7 +425,7 @@ strncpy((char *)buf.bufferPtr(), cwd.c_str(), size); result = cwd.length(); } else { - if (getcwd((char *)buf.bufferPtr(), size) != NULL) { + if (getcwd((char *)buf.bufferPtr(), size) != nullptr) { result = strlen((char *)buf.bufferPtr()); } else { result = -1; @@ -819,7 +819,7 @@ return 0; } - Process *matched_ph = NULL; + Process *matched_ph = nullptr; System *sysh = tc->getSystemPtr(); // Retrieves process pointer from active/suspended thread contexts. @@ -833,7 +833,7 @@ } } - assert(matched_ph != NULL); + assert(matched_ph != nullptr); matched_ph->setpgid((pgid == 0) ? matched_ph->pid() : pgid); return 0;