[gnome-builder] snippets: use new `` syntax to define defaults for g_return_if_fail().
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] snippets: use new `` syntax to define defaults for g_return_if_fail().
- Date: Wed, 10 Sep 2014 10:06:37 +0000 (UTC)
commit 84ad8cc79c4e1f5eaaf95e355c76ea1bc576c054
Author: Christian Hergert <christian hergert me>
Date: Wed Sep 10 03:06:19 2014 -0700
snippets: use new `` syntax to define defaults for g_return_if_fail().
The "fail" snippet, which expands a g_return_if_fail() check, can now
use the current filename to guess the default check. Since most functions
happen to perform this pre-conditional, it saves a bit of typing.
src/resources/snippets/c.snippets | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/resources/snippets/c.snippets b/src/resources/snippets/c.snippets
index fbeadf7..0ab970e 100644
--- a/src/resources/snippets/c.snippets
+++ b/src/resources/snippets/c.snippets
@@ -13,9 +13,9 @@ snippet main
return 0;
}
snippet fail
- g_return_if_fail (${1});$0
+ g_return_if_fail
(${1:`$filename|stripsuffix|functify|namespace|upper`_IS_`$filename|stripsuffix|class|functify|upper`
(`$filename|stripsuffix|instance`)});$0
snippet vfail
- g_return_val_if_fail (${1}, ${2:NULL});$0
+ g_return_val_if_fail
(${1:`$filename|stripsuffix|functify|namespace|upper`_IS_`$filename|stripsuffix|class|functify|upper`
(`$filename|stripsuffix|instance`)}, ${2:NULL});$0
snippet gpl
/* ${1:$filename}
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]