[vte] ring: Replace some assertions with static_assert
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] ring: Replace some assertions with static_assert
- Date: Mon, 23 Apr 2018 18:52:49 +0000 (UTC)
commit 33a64ff18ea36e2c946678a60ff013f17763ae69
Author: Christian Persch <chpe src gnome org>
Date: Mon Apr 23 20:51:18 2018 +0200
ring: Replace some assertions with static_assert
src/cell.hh | 8 ++++----
src/vterowdata.hh | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/cell.hh b/src/cell.hh
index 261740c..db2042d 100644
--- a/src/cell.hh
+++ b/src/cell.hh
@@ -137,8 +137,8 @@ typedef struct _VTE_GNUC_PACKED VteCellAttr {
CELL_ATTR_BOOL(invisible, INVISIBLE)
/* ATTR_BOOL(boxed, BOXED) */
} VteCellAttr;
-G_STATIC_ASSERT (sizeof (VteCellAttr) == 16);
-G_STATIC_ASSERT (offsetof (VteCellAttr, hyperlink_idx) == VTE_CELL_ATTR_COMMON_BYTES);
+static_assert(sizeof (VteCellAttr) == 16, "VteCellAttr has wrong size");
+static_assert(offsetof (VteCellAttr, hyperlink_idx) == VTE_CELL_ATTR_COMMON_BYTES, "VteCellAttr layout is
wrong");
/*
* VteStreamCellAttr: Variant of VteCellAttr to be stored in attr_stream.
@@ -160,8 +160,8 @@ typedef struct _VTE_GNUC_PACKED _VteStreamCellAttr {
CELL_ATTR_UINT(columns, COLUMNS)
CELL_ATTR_BOOL(fragment, FRAGMENT)
} VteStreamCellAttr;
-G_STATIC_ASSERT (sizeof (VteStreamCellAttr) == 14);
-G_STATIC_ASSERT (offsetof (VteStreamCellAttr, hyperlink_length) == VTE_CELL_ATTR_COMMON_BYTES);
+static_assert(sizeof (VteStreamCellAttr) == 14, "VteStreamCellAttr has wrong size");
+static_assert(offsetof (VteStreamCellAttr, hyperlink_length) == VTE_CELL_ATTR_COMMON_BYTES,
"VteStreamCellAttr layout is wrong");
#undef CELL_ATTR_BOOL
#undef CELL_ATTR_UINT
diff --git a/src/vterowdata.hh b/src/vterowdata.hh
index a55269d..4191ccc 100644
--- a/src/vterowdata.hh
+++ b/src/vterowdata.hh
@@ -38,7 +38,7 @@ G_BEGIN_DECLS
typedef struct _VteRowAttr {
guint8 soft_wrapped: 1;
} VteRowAttr;
-G_STATIC_ASSERT (sizeof (VteRowAttr) == 1);
+static_assert(sizeof (VteRowAttr) == 1, "VteRowAttr has wrong size");
/*
* VteRowData: A single row's data
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]