[vte/wip/sixels: 26/111] image: Use assert() instead of g_assert_true()




commit ca9b45f5a113c29d7cd14fe63e501bca4388ec8f
Author: Hans Petter Jansson <hpj cl no>
Date:   Sat Aug 8 20:42:48 2020 +0200

    image: Use assert() instead of g_assert_true()
    
    The latter is a C/GLib function and intended for use in tests only. The
    C++ code generally relies on assert() instead.

 src/image.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/image.cc b/src/image.cc
index 05a1912a..c4d67246 100644
--- a/src/image.cc
+++ b/src/image.cc
@@ -84,7 +84,7 @@ Image::is_frozen() const
 bool
 Image::includes(const Image *other) const
 {
-        g_assert_true(other != NULL);
+        assert(other != nullptr);
 
         return other->m_left >= m_left &&
                other->m_top >= m_top &&
@@ -164,7 +164,7 @@ Image::combine(Image *other, gulong char_width, gulong char_height)
 {
         cairo_t *cr;
 
-        g_assert_true(other != NULL);
+        assert(other != nullptr);
 
         gulong offsetx = (other->m_left - m_left) * char_width;
         gulong offsety = (other->m_top - m_top) * char_height;
@@ -249,7 +249,7 @@ Image::read_callback(void *closure, char *data, unsigned int length)
 {
         Image *image = (Image *)closure;
 
-        g_assert_true(image != NULL);
+        assert(image != nullptr);
 
         _vte_stream_read(image->m_stream, image->m_position + image->m_nread, data, length);
         image->m_nread += length;
@@ -262,7 +262,7 @@ Image::write_callback(void *closure, const char *data, unsigned int length)
 {
         Image *image = (Image *)closure;
 
-        g_assert_true (image != NULL);
+        assert(image != nullptr);
 
         _vte_stream_append(image->m_stream, data, length);
         image->m_nwrite += length;


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