[mutter] README: Clarify how to name flag types
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] README: Clarify how to name flag types
- Date: Tue, 9 Mar 2021 21:18:47 +0000 (UTC)
commit dcbd96df38f69b10e6ad9eb213c89f5193240381
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Tue Mar 9 20:40:39 2021 +0100
README: Clarify how to name flag types
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1765>
README.md | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/README.md b/README.md
index cedaf25b4e..d57296a7c7 100644
--- a/README.md
+++ b/README.md
@@ -63,7 +63,16 @@ with some additions:
that may have side effects.
- Instead of boolean arguments in functions, prefer enums or flags when
- they're more expressive.
+ they're more expressive. The naming convention for flags is
+
+```c
+typedef _MetaSomeThingFlags
+{
+ META_SOME_THING_FLAG_NONE = 0,
+ META_SOME_THING_FLAG_ALTER_REALITY = 1 << 0,
+ META_SOME_THING_FLAG_MANIPULATE_PERCEPTION = 1 << 1,
+} MetaSomeThingFlags;
+```
- Use `g_new0()` etc instead of `g_slice_new0()`.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]