Skip to content

Commit

Permalink
fixup! TEMP: nullptr instead of NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
CendioOssman committed Sep 30, 2024
1 parent f0c4377 commit c6fd6d5
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions vncviewer/CConn.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void CConn::framebufferUpdateStart()
CConnection::framebufferUpdateStart();

// For bandwidth estimate
gettimeofday(&updateStartTime, NULL);
gettimeofday(&updateStartTime, nullptr);
updateStartPos = getInStream()->pos();

// Update the screen prematurely for very slow updates
Expand All @@ -253,7 +253,7 @@ void CConn::framebufferUpdateEnd()
updateCount++;

// Calculate bandwidth everything managed to maintain during this update
gettimeofday(&now, NULL);
gettimeofday(&now, nullptr);
elapsed = (now.tv_sec - updateStartTime.tv_sec) * 1000000;
elapsed += now.tv_usec - updateStartTime.tv_usec;
if (elapsed == 0)
Expand Down
2 changes: 1 addition & 1 deletion vncviewer/X11KeyboardHandler.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ bool X11KeyboardHandler::nativeEventFilter(QByteArray const& eventType, void* me
kev.same_screen = xevent->same_screen;
char buffer[10];
KeySym keysym;
XLookupString(&kev, buffer, sizeof(buffer), &keysym, NULL);
XLookupString(&kev, buffer, sizeof(buffer), &keysym, nullptr);

if (keysym == NoSymbol) {
vlog.error(_("No symbol for key code %d (in the current state)"), (int)xevent->detail);
Expand Down
6 changes: 3 additions & 3 deletions vncviewer/cocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ void cocoa_resize(NSView *view, CGImageRef iref)
// OS X >= 10.6 can create a NSImage from a CGImage, but we need to
// support older versions, hence this pesky handling.
NSBitmapImageRep *bitmap = [[[NSBitmapImageRep alloc]
initWithBitmapDataPlanes: NULL
initWithBitmapDataPlanes: nullptr
pixelsWide: iwidth
pixelsHigh: iheight
bitsPerSample: 8
Expand Down Expand Up @@ -283,7 +283,7 @@ CGImageRef cocoa_create_bitmap(int width, int height, unsigned char *data)
int bytesPerPixel = 4; // == R G B PaddingByte
size_t bytesPerRow = width * bytesPerPixel;
size_t bufferLength = width * height * 4;
CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, data, bufferLength, NULL);
CGDataProviderRef provider = CGDataProviderCreateWithData(nullptr, data, bufferLength, nullptr);
size_t bitsPerComponent = 8;
size_t bitsPerPixel = bytesPerPixel * 8;
CGColorSpaceRef colorSpaceRef = CGDisplayCopyColorSpace(CGMainDisplayID());
Expand All @@ -300,7 +300,7 @@ CGImageRef cocoa_create_bitmap(int width, int height, unsigned char *data)
colorSpaceRef,
bitmapInfo,
provider, // data provider
NULL, // decode
nullptr, // decode
YES, // should interpolate
renderingIntent);
CGColorSpaceRelease(colorSpaceRef);
Expand Down
6 changes: 3 additions & 3 deletions vncviewer/loggerconfig.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ QString LoggerConfig::getlocaledir()
static char localebuf[PATH_MAX];

bundle = CFBundleGetMainBundle();
if (bundle == NULL)
if (bundle == nullptr)
return QString();

localeurl = CFBundleCopyResourceURL(bundle, CFSTR("locale"), NULL, NULL);
if (localeurl == NULL)
localeurl = CFBundleCopyResourceURL(bundle, CFSTR("locale"), nullptr, nullptr);
if (localeurl == nullptr)
return QString();

localestr = CFURLCopyFileSystemPath(localeurl, kCFURLPOSIXPathStyle);
Expand Down
2 changes: 1 addition & 1 deletion vncviewer/viewerconfig.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void ViewerConfig::initialize()
if (argv[i][0] == '-' && i + 1 < argc) {
QString name = argv[i].mid(1);
rfb::VoidParameter* param = rfb::Configuration::getParam(name.toStdString().c_str());
if ((param != NULL) && (dynamic_cast<rfb::BoolParameter*>(param) != NULL)) {
if ((param != nullptr) && (dynamic_cast<rfb::BoolParameter*>(param) != nullptr)) {
QString opt = argv[i + 1];
if ((opt.compare("0") == 0) || (opt.compare("1") == 0) || (opt.compare("true", Qt::CaseInsensitive) == 0)
|| (opt.compare("false", Qt::CaseInsensitive) == 0) || (opt.compare("yes", Qt::CaseInsensitive) == 0)
Expand Down
2 changes: 1 addition & 1 deletion vncviewer/vncx11view.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void QVNCX11View::grabPointer()

// We grab for the same events as the window is currently interested in
curmasks = XIGetSelectedEvents(display, winId(), &num_masks);
if (curmasks == NULL) {
if (curmasks == nullptr) {
if (num_masks == -1)
vlog.error(_("Unable to get X Input 2 event mask for window 0x%08llx"), winId());
else
Expand Down
6 changes: 3 additions & 3 deletions vncviewer/x11utils.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bool hasWM(Display* display)

Atom supportingWMCheck = XInternAtom(display, "_NET_SUPPORTING_WM_CHECK", false);

Window* windowFromRoot = NULL;
Window* windowFromRoot = nullptr;
auto supportingWMCheckOk = getWindowPropertyX11(display,
rootWindow,
supportingWMCheck,
Expand All @@ -58,7 +58,7 @@ bool isEWMHsupported(Display* display)

Atom supportingWMCheck = XInternAtom(display, "_NET_SUPPORTING_WM_CHECK", false);

Window* windowFromRoot = NULL;
Window* windowFromRoot = nullptr;
auto supportingWMCheckOk = getWindowPropertyX11(display,
rootWindow,
supportingWMCheck,
Expand All @@ -71,7 +71,7 @@ bool isEWMHsupported(Display* display)

Atom netSupported = XInternAtom(display, "_NET_SUPPORTED", false);

Atom* supportedAtoms = NULL;
Atom* supportedAtoms = nullptr;
auto atomCount = getWindowPropertyX11(display,
rootWindow,
netSupported,
Expand Down

0 comments on commit c6fd6d5

Please sign in to comment.