[vte] Use G_STATIC_ASSERT
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] Use G_STATIC_ASSERT
- Date: Sat, 10 Apr 2010 14:39:00 +0000 (UTC)
commit a9642829fbbd027bf39df6205efc1d7cb8383c02
Author: Christian Persch <chpe gnome org>
Date: Sat Apr 10 01:41:52 2010 +0200
Use G_STATIC_ASSERT
Now that we depend on glib 2.22, remove our private static assert macro
and just use G_STATIC_ASSERT.
src/debug.h | 4 ----
src/vterowdata.h | 10 +++++-----
2 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/src/debug.h b/src/debug.h
index b9d23c6..77f8dce 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -86,10 +86,6 @@ static void _vte_debug_print(guint flags, const char *fmt, ...)
}
#endif
-#define _ASSERT_STATIC1(_line, _cond) typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1]
-#define _ASSERT_STATIC0(_line, _cond) _ASSERT_STATIC1 (_line, (_cond))
-#define ASSERT_STATIC(_cond) _ASSERT_STATIC0 (__LINE__, (_cond))
-
G_END_DECLS
#endif
diff --git a/src/vterowdata.h b/src/vterowdata.h
index 769deec..a911500 100644
--- a/src/vterowdata.h
+++ b/src/vterowdata.h
@@ -68,13 +68,13 @@ typedef struct _VteCellAttr {
/* 30 bits */
} VteCellAttr;
-ASSERT_STATIC (sizeof (VteCellAttr) == 4);
+G_STATIC_ASSERT (sizeof (VteCellAttr) == 4);
typedef union _VteIntCellAttr {
VteCellAttr s;
guint32 i;
} VteIntCellAttr;
-ASSERT_STATIC (sizeof (VteCellAttr) == sizeof (VteIntCellAttr));
+G_STATIC_ASSERT (sizeof (VteCellAttr) == sizeof (VteIntCellAttr));
/*
* VteCell: A single cell's data
@@ -84,7 +84,7 @@ typedef struct _VteCell {
vteunistr c;
VteCellAttr attr;
} VteCell;
-ASSERT_STATIC (sizeof (VteCell) == 8);
+G_STATIC_ASSERT (sizeof (VteCell) == 8);
typedef union _VteIntCell {
VteCell cell;
@@ -93,7 +93,7 @@ typedef union _VteIntCell {
guint32 attr;
} i;
} VteIntCell;
-ASSERT_STATIC (sizeof (VteCell) == sizeof (VteIntCell));
+G_STATIC_ASSERT (sizeof (VteCell) == sizeof (VteIntCell));
static const VteIntCell basic_cell = {
{
@@ -126,7 +126,7 @@ static const VteIntCell basic_cell = {
typedef struct _VteRowAttr {
guint8 soft_wrapped: 1;
} VteRowAttr;
-ASSERT_STATIC (sizeof (VteRowAttr) == 1);
+G_STATIC_ASSERT (sizeof (VteRowAttr) == 1);
/*
* VteRowData: A single row's data
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]