You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/697
-- Commit Summary --
* Use g_return_val_if_fail() to fix build on OS X
-- File Changes --
M src/plugins.c (2)
-- Patch Links --
https://github.com/geany/geany/pull/697.patch https://github.com/geany/geany/pull/697.diff
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/697
@@ -2000,7 +2000,7 @@ gboolean geany_plugin_register_proxy(GeanyPlugin *plugin, const gchar **extensio foreach_list(node, active_proxies.head) { proxy = node->data;
g_return_if_fail(p != proxy->plugin);
g_return_val_if_fail(p != proxy->plugin, FALSE);
@kugel- based on the comment above the loop, why does this need to print an error if the plugin is already registered?
The `g_return_*` functions are only meant for programming errors, see [here](https://developer.gnome.org/glib/stable/glib-Warnings-and-Assertions.html#gl...)
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/697/files#r42182513
@@ -2000,7 +2000,7 @@ gboolean geany_plugin_register_proxy(GeanyPlugin *plugin, const gchar **extensio foreach_list(node, active_proxies.head) { proxy = node->data;
g_return_if_fail(p != proxy->plugin);
g_return_val_if_fail(p != proxy->plugin, FALSE);
Registering twice is currently explicitly unsupported currently, so any attempt is a programming error (though a plugin error so an assert might not be ideal)
The plan is to enable it once the details are fleshed out and code is written, with the intention to enable proxies to change their list of supported files
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/697/files#r42184135
@@ -2000,7 +2000,7 @@ gboolean geany_plugin_register_proxy(GeanyPlugin *plugin, const gchar **extensio foreach_list(node, active_proxies.head) { proxy = node->data;
g_return_if_fail(p != proxy->plugin);
g_return_val_if_fail(p != proxy->plugin, FALSE);
ok, thanks, carry on :)
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/697/files#r42189733
@@ -2000,7 +2000,7 @@ gboolean geany_plugin_register_proxy(GeanyPlugin *plugin, const gchar **extensio foreach_list(node, active_proxies.head) { proxy = node->data;
g_return_if_fail(p != proxy->plugin);
g_return_val_if_fail(p != proxy->plugin, FALSE);
The diff doesn't show but there's a comment about that just above ;-)
/me is sitting on the airport at just after midnight waiting for the flight
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/697/files#r42191417
LGTM. Damn this GCC change hiding those missing return values in `g_return*_if_fail()` :S
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/697#issuecomment-149027258
It would probably be better to unconditionally check and then print a useful error than to use one of these debug assertions, which will, if enabled, only propagate the error, making it harder to find. I guess that's kind of another issue than this PR aims to solve though.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/697#issuecomment-149034040
LGTM. Damn this GCC change hiding those missing return values in `g_return*_if_fail()` :S
https://bugzilla.gnome.org/show_bug.cgi?id=753310 yay!
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/697#issuecomment-149217861
Merged #697.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/697#event-439137856
github-comments@lists.geany.org