project wide nullptr fix

This commit is contained in:
Erik Frojdh
2019-01-16 15:15:29 +01:00
parent 80a1a3d796
commit 49f71ffca7
16 changed files with 411 additions and 119 deletions

View File

@ -103,7 +103,7 @@ void SharedMemory::RemoveSharedMemory() {
void* SharedMemory::MapSharedMemory(size_t sz) {
void* addr = mmap(NULL, sz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
void* addr = mmap(nullptr, sz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (addr == MAP_FAILED) {
FILE_LOG(logERROR) << "Mapping shared memory " << name << " failed: " << strerror(errno);
close(fd);
@ -120,7 +120,7 @@ std::string SharedMemory::ConstructSharedMemoryName(int multiId, int slsId) {
// using environment path
std::string sEnvPath = "";
char* envpath = getenv(SHM_ENV_NAME);
if (envpath != NULL) {
if (envpath != nullptr) {
sEnvPath.assign(envpath);
sEnvPath.insert(0,"_");
}

View File

@ -2389,7 +2389,7 @@ std::string slsDetectorCommand::cmdTrimEn(int narg, char *args[], int action, in
myDet->setTrimEn(ip, pos, detPos);
}
}
int npos = myDet->getTrimEn(NULL, detPos);
int npos = myDet->getTrimEn(nullptr, detPos);
if (npos != -1) {
sprintf(answer, "%d", npos);
int opos[npos];
@ -4601,7 +4601,7 @@ std::string slsDetectorCommand::cmdAdvanced(int narg, char *args[], int action,
} else if (cmd == "programfpga") {
if (action == GET_ACTION)
return std::string("cannot get");
if (strstr(args[1], ".pof") == NULL)
if (strstr(args[1], ".pof") == nullptr)
return std::string("wrong usage: programming file should have .pof extension");
std::string sval = std::string(args[1]);
#ifdef VERBOSE

View File

@ -6,7 +6,7 @@
using namespace std;
slsDetectorUsers::slsDetectorUsers(int& ret, int id) : myDetector(0), myCmd(0){
slsDetectorUsers::slsDetectorUsers(int& ret, int id) : myDetector(nullptr), myCmd(nullptr){
try {
myDetector=new multiSlsDetector(id);
} catch(...) {