[Github-comments] [geany/geany] build.c: ASSIGNIF -> assign_cmd (#2256)
Thomas Martitz
notifications at xxxxx
Tue Aug 13 06:02:11 UTC 2019
kugel- requested changes on this pull request.
I think the commit message lacks a bit of story. Yes, the change fixes a TODO in the code but the message could mention just that.
> @@ -2291,6 +2291,22 @@ static void build_load_menu_grp(GKeyFile *config, GeanyBuildCommand **dst, gint
}
+/* set GeanyBuildCommand if it doesn't already exist and there is a command */
+static void assign_cmd(GeanyBuildCommand *type, guint id,
+ const gchar *label, gchar *value)
+{
+ if (!EMPTY(value) && ! type[GBO_TO_CMD(id)].exists)
+ {
+ type[GBO_TO_CMD(id)].exists = TRUE;
+ SETPTR(type[GBO_TO_CMD(id)].label, g_strdup(label));
+ SETPTR(type[GBO_TO_CMD(id)].command, value);
+ SETPTR(type[GBO_TO_CMD(id)].working_dir, NULL);
+ type[GBO_TO_CMD(id)].old = TRUE;
The readablity could be improved by using a temporary variable for `GBO_TO_CMD(id)` or even the whole `type[GBO_TO_CMD(id)`
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2256#pullrequestreview-274074280
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190812/946ed28d/attachment-0001.html>
More information about the Github-comments
mailing list