From 12f8e1a94506bc90cc71c4591b21811db43143d0 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Tue, 21 Apr 2026 04:23:04 +0300
Subject: [PATCH 31/31] rgbcolor.[ch]: Replace NULL with nullptr

See RM #2000

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 common/rgbcolor.c | 20 ++++++++++----------
 common/rgbcolor.h |  6 +++---
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/common/rgbcolor.c b/common/rgbcolor.c
index a2de4504e6..23f91dc9a0 100644
--- a/common/rgbcolor.c
+++ b/common/rgbcolor.c
@@ -39,7 +39,7 @@ struct rgbcolor *rgbcolor_new(int r, int g, int b)
   prgbcolor->r = r;
   prgbcolor->g = g;
   prgbcolor->b = b;
-  prgbcolor->color = NULL;
+  prgbcolor->color = nullptr;
 
   return prgbcolor;
 }
@@ -50,7 +50,7 @@ struct rgbcolor *rgbcolor_new(int r, int g, int b)
 ****************************************************************************/
 struct rgbcolor *rgbcolor_copy(const struct rgbcolor *prgbcolor)
 {
-  fc_assert_ret_val(prgbcolor != NULL, NULL);
+  fc_assert_ret_val(prgbcolor != nullptr, nullptr);
 
   return rgbcolor_new(prgbcolor->r, prgbcolor->g, prgbcolor->b);
 }
@@ -61,7 +61,7 @@ struct rgbcolor *rgbcolor_copy(const struct rgbcolor *prgbcolor)
 ****************************************************************************/
 bool rgbcolors_are_equal(const struct rgbcolor *c1, const struct rgbcolor *c2)
 {
-  fc_assert_ret_val(c1 != NULL && c2 != NULL, FALSE);
+  fc_assert_ret_val(c1 != nullptr && c2 != nullptr, FALSE);
 
   /* No check of cached 'color' member -- if values are equal, it should be
    * equivalent */
@@ -94,8 +94,8 @@ bool rgbcolor_load(struct section_file *file, struct rgbcolor **prgbcolor,
   char colorpath[256];
   va_list args;
 
-  fc_assert_ret_val(file != NULL, FALSE);
-  fc_assert_ret_val(*prgbcolor == NULL, FALSE);
+  fc_assert_ret_val(file != nullptr, FALSE);
+  fc_assert_ret_val(*prgbcolor == nullptr, FALSE);
 
   va_start(args, path);
   fc_vsnprintf(colorpath, sizeof(colorpath), path, args);
@@ -124,8 +124,8 @@ void rgbcolor_save(struct section_file *file,
   char colorpath[256];
   va_list args;
 
-  fc_assert_ret(file != NULL);
-  fc_assert_ret(prgbcolor != NULL);
+  fc_assert_ret(file != nullptr);
+  fc_assert_ret(prgbcolor != nullptr);
 
   va_start(args, path);
   fc_vsnprintf(colorpath, sizeof(colorpath), path, args);
@@ -142,7 +142,7 @@ void rgbcolor_save(struct section_file *file,
 bool rgbcolor_to_hex(const struct rgbcolor *prgbcolor, char *hex,
                      size_t hex_len)
 {
-  fc_assert_ret_val(prgbcolor != NULL, FALSE);
+  fc_assert_ret_val(prgbcolor != nullptr, FALSE);
   /* Needs a length greater than 7 ('#' + 6 hex digites and '\0'). */
   fc_assert_ret_val(hex_len > 7, FALSE);
 
@@ -164,8 +164,8 @@ bool rgbcolor_from_hex(struct rgbcolor **prgbcolor, const char *hex)
   int rgb, r, g, b;
   char hex2[16];
 
-  fc_assert_ret_val(*prgbcolor == NULL, FALSE);
-  fc_assert_ret_val(hex != NULL, FALSE);
+  fc_assert_ret_val(*prgbcolor == nullptr, FALSE);
+  fc_assert_ret_val(hex != nullptr, FALSE);
 
   if (hex[0] == '#') {
     hex++;
diff --git a/common/rgbcolor.h b/common/rgbcolor.h
index 646cbab6e6..c4027f30ce 100644
--- a/common/rgbcolor.h
+++ b/common/rgbcolor.h
@@ -27,8 +27,8 @@ struct section_file;
  * rulesets. */
 struct color;
 
-/* An RGBcolor contains the R,G,B bitvalues for a color.  The color itself
- * holds the color structure for this color but may be NULL (it's allocated
+/* An RGBcolor contains the R,G,B bitvalues for a color. The color itself
+ * holds the color structure for this color but may be nullptr (it's allocated
  * on demand at runtime). */
 struct rgbcolor {
   int r, g, b;
@@ -85,4 +85,4 @@ int rgbcolor_brightness_score(struct rgbcolor *prgbcolor);
 }
 #endif /* __cplusplus */
 
-#endif  /* FC__RGBCOLOR_H */
+#endif /* FC__RGBCOLOR_H */
-- 
2.53.0

