aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/Palette.h
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 /common/rfb/Palette.h
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 'common/rfb/Palette.h')
-rw-r--r--common/rfb/Palette.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/common/rfb/Palette.h b/common/rfb/Palette.h
index 6b8cc57e..d22af0dc 100644
--- a/common/rfb/Palette.h
+++ b/common/rfb/Palette.h
@@ -75,10 +75,10 @@ inline bool rfb::Palette::insert(uint32_t colour, int numPixels)
hash_key = genHash(colour);
pnode = hash[hash_key];
- prev_pnode = NULL;
+ prev_pnode = nullptr;
// Do we already have an entry for this colour?
- while (pnode != NULL) {
+ while (pnode != nullptr) {
if (pnode->colour == colour) {
// Yup
@@ -114,12 +114,12 @@ inline bool rfb::Palette::insert(uint32_t colour, int numPixels)
// Create a new colour entry
pnode = &list[numColours];
- pnode->next = NULL;
+ pnode->next = nullptr;
pnode->idx = 0;
pnode->colour = colour;
// Add it to the hash table
- if (prev_pnode != NULL)
+ if (prev_pnode != nullptr)
prev_pnode->next = pnode;
else
hash[hash_key] = pnode;
@@ -152,7 +152,7 @@ inline unsigned char rfb::Palette::lookup(uint32_t colour) const
hash_key = genHash(colour);
pnode = hash[hash_key];
- while (pnode != NULL) {
+ while (pnode != nullptr) {
if (pnode->colour == colour)
return pnode->idx;
pnode = pnode->next;