<p><b>@ntrel</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/2270#discussion_r317349517">src/build.c</a>:</p>
<pre style='color:#555'>> @@ -2577,15 +2565,20 @@ void build_save_menu(GKeyFile *config, gpointer ptr, GeanyBuildSource src)
                                g_key_file_remove_key(config, build_grp_name, "error_regex", NULL);
                        if (pj->priv->build_filetypes_list != NULL)
                        {
-                               data.config = config;
-                               data.ft_names = g_ptr_array_new();
-                               g_ptr_array_foreach(pj->priv->build_filetypes_list, foreach_project_filetype, (gpointer)(&data));
-                               if (data.ft_names->pdata != NULL)
+                               GPtrArray *ft_names = g_ptr_array_new();
+                               guint i;
+                               
+                               foreach_ptr_array(ft, i, pj->priv->build_filetypes_list)
</pre>
<p><a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=181177" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/codebrainz">@codebrainz</a> <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=811085" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/elextr">@elextr</a><br>
BTW I wrote the macros not to 'save a line or two of code' but to encapsulate iteration so when seeing the macro invocation you know there are no bugs in iteration (that was the intent anyway).</p>
<p>I accept the counter-argument that things like array iteration are simple and a custom macro is a geany-specific thing to learn, and it could possibly make debugging more confusing if the macro was passed a wrongly typed parameter.</p>
<p>But what about things that people often get wrong, like not checking <code>doc->is_valid</code>, I think the <code>foreach_document</code> macro is worth having. <code>is_valid</code> <em>is</em> a Geany-specific thing, so it's easy to justify a macro here. Sure, make it upper-case though.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/2270?email_source=notifications&email_token=AAIOWJ5A6DKOLCUJW5Q7CN3QGDSXNA5CNFSM4IOW2V4KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCCSXWCA#discussion_r317349517">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ6YD2VYKPIDQXMJCE3QGDSXNANCNFSM4IOW2V4A">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAIOWJYQS7M3CT7IENT62G3QGDSXNA5CNFSM4IOW2V4KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCCSXWCA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/2270?email_source=notifications\u0026email_token=AAIOWJ5A6DKOLCUJW5Q7CN3QGDSXNA5CNFSM4IOW2V4KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCCSXWCA#discussion_r317349517",
"url": "https://github.com/geany/geany/pull/2270?email_source=notifications\u0026email_token=AAIOWJ5A6DKOLCUJW5Q7CN3QGDSXNA5CNFSM4IOW2V4KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCCSXWCA#discussion_r317349517",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>