diff options
author | Thomas Haller <thaller@redhat.com> | 2017-02-02 21:47:03 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-02-10 14:33:52 +0100 |
commit | 7d6b8bab70d5d347652db0a7b567b61658b1d29d (patch) | |
tree | c8b36d90562301a4ec535e3e00d525d511e5adb3 /shared | |
parent | 8538b61eb6690486a6245d3f3a1eb075c4f5fb35 (diff) | |
download | NetworkManager-7d6b8bab70d5d347652db0a7b567b61658b1d29d.tar.gz |
all: use NM_CACHED_QUARK_FCN() instead of G_DEFINE_QUARK()
I think NM_CACHED_QUARK_FCN() is better because:
- the implementation is in our hand, meaning it is clear that
putting a "static" before NM_CACHED_QUARK_FCN() is guaranteed to
work -- without relying on G_DEFINE_QUARK() to be defined in a way
that this works (in fact, we currently never do that and instead
make all functions non-static).
- it does not construct function names by appending "_quark".
Thus you can grep for the entire function name and finding
the place where it is implemented.
- same with the stings, where the new macro doesn't stringify the
argument, which is less surpising. Again, now you can grep
for the string including the double quoting.
(yes, I really use grep to understand the source-code)
Diffstat (limited to 'shared')
-rw-r--r-- | shared/nm-utils/nm-shared-utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/shared/nm-utils/nm-shared-utils.c b/shared/nm-utils/nm-shared-utils.c index fc048fe893..413526dc2a 100644 --- a/shared/nm-utils/nm-shared-utils.c +++ b/shared/nm-utils/nm-shared-utils.c @@ -240,7 +240,7 @@ _nm_utils_ascii_str_to_bool (const char *str, /*****************************************************************************/ -G_DEFINE_QUARK (nm-utils-error-quark, nm_utils_error) +NM_CACHED_QUARK_FCN ("nm-utils-error-quark", nm_utils_error_quark) void nm_utils_error_set_cancelled (GError **error, |