Don't use G_LIKELY() in macros commonly used in g_return_if_fail()

g_return_if_fail() puts itself its condition in a G_LIKELY() clause,
and nested G_LIKELY() lead to warnings about shadowed variables, as
well as not being of any use.

Also, hiding G_LIKELY() in a macro may lead to unexpected use of it
which may hint the compiler incorrectly.
This commit is contained in:
Colomban Wendling 2014-01-18 15:15:11 +01:00
parent 7473e4b1d9
commit c2dcec7107

View File

@ -146,7 +146,7 @@ extern GPtrArray *documents_array;
* @note This should not be used to check the result of the main API functions,
* these only need a NULL-pointer check - @c document_get_current() != @c NULL. */
#define DOC_VALID(doc_ptr) \
(G_LIKELY((doc_ptr) != NULL && (doc_ptr)->is_valid))
((doc_ptr) != NULL && (doc_ptr)->is_valid)
/**
* Returns the filename of the document passed or @c GEANY_STRING_UNTITLED