mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-16 23:07:13 +02:00
nullptr
This commit is contained in:
@ -449,7 +449,7 @@ class CmdProxy {
|
||||
}
|
||||
|
||||
inline unsigned int stoiHex(const std::string& s) {
|
||||
unsigned long lresult = stoul(s, 0, 16);
|
||||
unsigned long lresult = stoul(s, nullptr, 16);
|
||||
unsigned int result = lresult;
|
||||
if (result != lresult) {
|
||||
throw std::out_of_range("cannot convert to unsigned int");
|
||||
@ -458,7 +458,7 @@ class CmdProxy {
|
||||
}
|
||||
|
||||
inline unsigned long int stoulHex(const std::string& s) {
|
||||
unsigned long result = stoul(s, 0, 16);
|
||||
unsigned long result = stoul(s, nullptr, 16);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -722,7 +722,7 @@ void slsDetector::updateCachedDetectorVariables() {
|
||||
FORCE_UPDATE) {
|
||||
int n = 0, i32 = 0;
|
||||
int64_t i64 = 0;
|
||||
sls::IpAddr lastClientIP = 0U;
|
||||
sls::IpAddr lastClientIP;
|
||||
n += client.Receive(&lastClientIP, sizeof(lastClientIP));
|
||||
FILE_LOG(logDEBUG1)
|
||||
<< "Updating detector last modified by " << lastClientIP;
|
||||
@ -3152,7 +3152,7 @@ int slsDetector::lockReceiver(int lock) {
|
||||
}
|
||||
|
||||
sls::IpAddr slsDetector::getReceiverLastClientIP() const {
|
||||
sls::IpAddr retval = 0U;
|
||||
sls::IpAddr retval;
|
||||
FILE_LOG(logDEBUG1) << "Getting last client ip to receiver server";
|
||||
if (shm()->useReceiverFlag) {
|
||||
sendToReceiver(F_GET_LAST_RECEIVER_CLIENT_IP, nullptr, retval);
|
||||
@ -3190,7 +3190,7 @@ void slsDetector::updateCachedReceiverVariables() const {
|
||||
int n = 0, i32 = 0;
|
||||
int64_t i64 = 0;
|
||||
char cstring[MAX_STR_LENGTH]{};
|
||||
IpAddr ip = 0U;
|
||||
IpAddr ip;
|
||||
|
||||
n += receiver.Receive(&ip, sizeof(ip));
|
||||
FILE_LOG(logDEBUG1)
|
||||
|
@ -89,7 +89,7 @@ inline std::string NowTime()
|
||||
strftime(buffer, buffer_len, "%X", localtime_r(&t, &r));
|
||||
buffer[buffer_len - 1] = 0;
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, 0);
|
||||
gettimeofday(&tv, nullptr);
|
||||
char result[100];
|
||||
const int result_len = sizeof(result);
|
||||
snprintf(result, result_len, "%s.%03ld", buffer, (long)tv.tv_usec / 1000);
|
||||
|
@ -106,7 +106,7 @@ std::string IpToInterfaceName(const std::string &ip) {
|
||||
strcpy(buf, "none");
|
||||
|
||||
getifaddrs(&addrs);
|
||||
for (iap = addrs; iap != NULL; iap = iap->ifa_next) {
|
||||
for (iap = addrs; iap != nullptr; iap = iap->ifa_next) {
|
||||
if (iap->ifa_addr && (iap->ifa_flags & IFF_UP) &&
|
||||
iap->ifa_addr->sa_family == AF_INET) {
|
||||
sa = (struct sockaddr_in *)(iap->ifa_addr);
|
||||
|
Reference in New Issue
Block a user