Skip to content

Commit

Permalink
"Fix" some GCC -Wparentheses warnings
Browse files Browse the repository at this point in the history
It's a useful warning in general, so explicitly parenthesize cases that
actually do it on purpose.
  • Loading branch information
b4n committed Oct 7, 2023
1 parent e912791 commit f3f0cf1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/symbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ static void tag_list_add_groups(GtkTreeStore *tree_store, TMParserType lang)

g_return_if_fail(top_level_iter_names);

for (i = 0; title = tm_parser_get_sidebar_info(lang, i, &icon_id); i++)
for (i = 0; (title = tm_parser_get_sidebar_info(lang, i, &icon_id)) != NULL; i++)
{
GtkTreeIter *iter = &tv_iters[i];
GdkPixbuf *icon = NULL;
Expand Down
6 changes: 3 additions & 3 deletions src/tagmanager/tm_workspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ static GHashTable *get_includes(TMSourceFile *source, GPtrArray **header_candida
return includes;

src_basename = g_strdup(source->short_name);
if (ptr = strrchr(src_basename, '.'))
if ((ptr = strrchr(src_basename, '.')) != NULL)
*ptr = '\0';

headers = tm_tags_extract(source->tags_array, tm_tag_include_t);
Expand All @@ -863,7 +863,7 @@ static GHashTable *get_includes(TMSourceFile *source, GPtrArray **header_candida
if (!*header_candidates)
{
gchar *hdr_basename = g_strdup(hdr_name);
if (ptr = strrchr(hdr_basename, '.'))
if ((ptr = strrchr(hdr_basename, '.')) != NULL)
*ptr = '\0';

if (g_strcmp0(hdr_basename, src_basename) == 0)
Expand Down Expand Up @@ -1103,7 +1103,7 @@ find_scope_members_tags (const GPtrArray *all, TMTag *type_tag, gboolean namespa

g_free(stripped);

for (i = 0; parent = split_strv[i]; i++)
for (i = 0; (parent = split_strv[i]) != NULL; i++)
{
GPtrArray *parent_tags;

Expand Down

0 comments on commit f3f0cf1

Please sign in to comment.