aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer/fltk
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2024-04-02 16:13:23 +0200
committerPierre Ossman <ossman@cendio.se>2024-06-24 13:42:54 +0200
commit139f0e8a4b81fe3dcd9476ec5ee16ea5e74af901 (patch)
tree8d06ede9e14516516a44c5ed710058003088eec2 /vncviewer/fltk
parent45198e5235f4b724277665b242cf855a0ff4518b (diff)
downloadtigervnc-139f0e8a4b81fe3dcd9476ec5ee16ea5e74af901.tar.gz
tigervnc-139f0e8a4b81fe3dcd9476ec5ee16ea5e74af901.zip
Use nullptr in all C++ code
It's more readable than 0, and a bit safer than NULL, so let's try to follow modern norms.
Diffstat (limited to 'vncviewer/fltk')
-rw-r--r--vncviewer/fltk/Fl_Monitor_Arrangement.cxx10
-rw-r--r--vncviewer/fltk/Fl_Navigation.cxx4
-rw-r--r--vncviewer/fltk/theme.cxx6
-rw-r--r--vncviewer/fltk/util.h2
4 files changed, 11 insertions, 11 deletions
diff --git a/vncviewer/fltk/Fl_Monitor_Arrangement.cxx b/vncviewer/fltk/Fl_Monitor_Arrangement.cxx
index 7c72ff68..02011e1f 100644
--- a/vncviewer/fltk/Fl_Monitor_Arrangement.cxx
+++ b/vncviewer/fltk/Fl_Monitor_Arrangement.cxx
@@ -379,7 +379,7 @@ std::string Fl_Monitor_Arrangement::get_monitor_name(int m)
Fl::screen_xywh(x, y, w, h, m);
- EnumDisplayMonitors(NULL, NULL, EnumDisplayMonitorsCallback,
+ EnumDisplayMonitors(nullptr, nullptr, EnumDisplayMonitorsCallback,
(LPARAM)&sys_monitors);
for (iter = sys_monitors.begin(); iter != sys_monitors.end(); ++iter) {
@@ -441,11 +441,11 @@ std::string Fl_Monitor_Arrangement::get_monitor_name(int m)
info = IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID),
kIODisplayOnlyPreferredName);
- if (info == NULL)
+ if (info == nullptr)
return "";
dict = (CFDictionaryRef) CFDictionaryGetValue(info, CFSTR(kDisplayProductName));
- if (dict == NULL) {
+ if (dict == nullptr) {
CFRelease(info);
return "";
}
@@ -454,7 +454,7 @@ std::string Fl_Monitor_Arrangement::get_monitor_name(int m)
if (dict_len > 0) {
CFTypeRef * names = new CFTypeRef[dict_len];
- CFDictionaryGetKeysAndValues(dict, NULL, (const void **) names);
+ CFDictionaryGetKeysAndValues(dict, nullptr, (const void **) names);
if (names[0]) {
@@ -496,7 +496,7 @@ std::string Fl_Monitor_Arrangement::get_monitor_name(int m)
std::string name;
fl_open_display();
- assert(fl_display != NULL);
+ assert(fl_display != nullptr);
Fl::screen_xywh(x, y, w, h, m);
if (!XQueryExtension(fl_display, "RANDR", &xi_major, &ev, &err))
diff --git a/vncviewer/fltk/Fl_Navigation.cxx b/vncviewer/fltk/Fl_Navigation.cxx
index 603c69ce..d3117aae 100644
--- a/vncviewer/fltk/Fl_Navigation.cxx
+++ b/vncviewer/fltk/Fl_Navigation.cxx
@@ -72,7 +72,7 @@ Fl_Widget *Fl_Navigation::value()
return pages->child(i);
}
- return NULL;
+ return nullptr;
}
int Fl_Navigation::value(Fl_Widget *newpage)
@@ -145,7 +145,7 @@ void Fl_Navigation::update_labels()
int i, offset;
labels->clear();
- labels->resizable(NULL);
+ labels->resizable(nullptr);
if (!pages->children())
return;
diff --git a/vncviewer/fltk/theme.cxx b/vncviewer/fltk/theme.cxx
index 22e04dc6..2b37fb6e 100644
--- a/vncviewer/fltk/theme.cxx
+++ b/vncviewer/fltk/theme.cxx
@@ -313,10 +313,10 @@ void init_theme()
CTFontRef font;
CFStringRef name;
- font = CTFontCreateUIFontForLanguage(kCTFontSystemFontType, 0.0, NULL);
- if (font != NULL) {
+ font = CTFontCreateUIFontForLanguage(kCTFontSystemFontType, 0.0, nullptr);
+ if (font != nullptr) {
name = CTFontCopyFullName(font);
- if (name != NULL) {
+ if (name != nullptr) {
CFStringGetCString(name, font_name, sizeof(font_name),
kCFStringEncodingUTF8);
diff --git a/vncviewer/fltk/util.h b/vncviewer/fltk/util.h
index 87765396..9ce3c7aa 100644
--- a/vncviewer/fltk/util.h
+++ b/vncviewer/fltk/util.h
@@ -97,7 +97,7 @@ static inline size_t fltk_menu_escape(const char *in, char *out, size_t maxlen)
/* Helper to add menu entries safely */
static inline void fltk_menu_add(Fl_Menu_ *menu, const char *text,
int shortcut, Fl_Callback *cb,
- void *data = 0, int flags = 0)
+ void *data=nullptr, int flags=0)
{
char buffer[1024];