mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
project wide nullptr fix
This commit is contained in:
@ -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,"_");
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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(...) {
|
||||
|
Reference in New Issue
Block a user