mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 10:30:41 +02:00
clang-tidy nullptr
This commit is contained in:
parent
265e96d675
commit
5f91198328
@ -722,7 +722,7 @@ int DetectorImpl::InsertGapPixels(char *image, char *&gpImage, bool quadEnable,
|
|||||||
"Sending dummy data without gap pixels.\n";
|
"Sending dummy data without gap pixels.\n";
|
||||||
double bytesPerPixel = (double)dr / 8.00;
|
double bytesPerPixel = (double)dr / 8.00;
|
||||||
int imagesize = nPixelsy * nPixelsx * bytesPerPixel;
|
int imagesize = nPixelsy * nPixelsx * bytesPerPixel;
|
||||||
if (gpImage == NULL) {
|
if (gpImage == nullptr) {
|
||||||
gpImage = new char[imagesize];
|
gpImage = new char[imagesize];
|
||||||
}
|
}
|
||||||
memset(gpImage, 0xFF, imagesize);
|
memset(gpImage, 0xFF, imagesize);
|
||||||
@ -789,7 +789,7 @@ int DetectorImpl::InsertGapPixels(char *image, char *&gpImage, bool quadEnable,
|
|||||||
<< "nMod1TotPixelsx: " << nMod1TotPixelsx << "\n\t"
|
<< "nMod1TotPixelsx: " << nMod1TotPixelsx << "\n\t"
|
||||||
<< "divisionValue: " << divisionValue << "\n\n";
|
<< "divisionValue: " << divisionValue << "\n\n";
|
||||||
|
|
||||||
if (gpImage == NULL) {
|
if (gpImage == nullptr) {
|
||||||
gpImage = new char[imagesize];
|
gpImage = new char[imagesize];
|
||||||
}
|
}
|
||||||
memset(gpImage, 0xFF, imagesize);
|
memset(gpImage, 0xFF, imagesize);
|
||||||
|
@ -22,7 +22,7 @@ UdpRxSocket::UdpRxSocket(int port, ssize_t packet_size, const char *hostname,
|
|||||||
hints.ai_socktype = SOCK_DGRAM;
|
hints.ai_socktype = SOCK_DGRAM;
|
||||||
hints.ai_protocol = 0;
|
hints.ai_protocol = 0;
|
||||||
hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
|
hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
|
||||||
struct addrinfo *res = 0;
|
struct addrinfo *res = nullptr;
|
||||||
|
|
||||||
const std::string portname = std::to_string(port);
|
const std::string portname = std::to_string(port);
|
||||||
if (getaddrinfo(hostname, portname.c_str(), &hints, &res)) {
|
if (getaddrinfo(hostname, portname.c_str(), &hints, &res)) {
|
||||||
|
@ -129,12 +129,12 @@ IpAddr InterfaceNameToIp(const std::string &ifn) {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
|
for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) {
|
||||||
if (ifa->ifa_addr == NULL)
|
if (ifa->ifa_addr == nullptr)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
auto s = getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in), host,
|
auto s = getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in), host,
|
||||||
NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
|
NI_MAXHOST, nullptr, 0, NI_NUMERICHOST);
|
||||||
|
|
||||||
if ((strcmp(ifa->ifa_name, ifn.c_str()) == 0) &&
|
if ((strcmp(ifa->ifa_name, ifn.c_str()) == 0) &&
|
||||||
(ifa->ifa_addr->sa_family == AF_INET)) {
|
(ifa->ifa_addr->sa_family == AF_INET)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user