poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[COMMITTED] pickles: Use `assert` for integrity checks


From: Mohammad-Reza Nabipoor
Subject: [COMMITTED] pickles: Use `assert` for integrity checks
Date: Thu, 10 Dec 2020 07:04:11 +0330

2020-12-10  Mohammad-Reza Nabipoor  <m.nabipoor@yahoo.com>

        * pickles/color.pk: Use `assert` for integrity check.
        * pickles/rgb24.pk: Likewise.
---
 ChangeLog        | 5 +++++
 pickles/color.pk | 5 ++---
 pickles/rgb24.pk | 5 ++---
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bc116a61..15a6f8db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-12-10  Mohammad-Reza Nabipoor  <m.nabipoor@yahoo.com>
+
+       * pickles/color.pk: Use `assert` for integrity check.
+       * pickles/rgb24.pk: Likewise.
+
 2020-12-07  Jose E. Marchesi  <jemarch@gnu.org>
 
        * Makefile.am (SUBDIRS): Add utils/.
diff --git a/pickles/color.pk b/pickles/color.pk
index a80b6cc2..3ae97af5 100644
--- a/pickles/color.pk
+++ b/pickles/color.pk
@@ -73,9 +73,8 @@ var color_std_names =
 
 /* Sanity check.  */
 
-if (color_std_names'length != color_num_colors)
-  raise Exception {code = EC_generic,
-                   msg = "integrity error in color_name"};
+assert (color_std_names'length == color_num_colors,
+        "integrity error in color_name");
 
 /* Return the printable name of the given color code.  */
 
diff --git a/pickles/rgb24.pk b/pickles/rgb24.pk
index 0bdde330..5f64a2b4 100644
--- a/pickles/rgb24.pk
+++ b/pickles/rgb24.pk
@@ -48,6 +48,5 @@ var rgb24_color =
 
 /* Sanity check.  */
 
-if (rgb24_color'length != color_num_colors)
-  raise Exception {code = EC_generic,
-                   msg = "integrity error in rgb24_color table"};
+assert (rgb24_color'length == color_num_colors,
+        "integrity error in rgb24_color table");
-- 
2.29.2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]