Skip to content

Commit 2bcfa1d

Browse files
committed
workbench fix warnings #1588
1 parent 4185054 commit 2bcfa1d

5 files changed

Lines changed: 10 additions & 13 deletions

File tree

workbench/src/search_projects.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "dialogs.h"
2929
#include "sidebar.h"
3030
#include "menu.h"
31+
#include "search_projects.h"
3132

3233

3334
typedef enum

workbench/src/sidebar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,7 @@ static void sidebar_set_context (SIDEBAR_CONTEXT *context, guint dataid, gpointe
16471647

16481648

16491649
/* Internal call foreach function. Traverses the whole sidebar. */
1650-
void sidebar_call_foreach_int(SB_CALLFOREACH_CONTEXT *foreach_cntxt,
1650+
static void sidebar_call_foreach_int(SB_CALLFOREACH_CONTEXT *foreach_cntxt,
16511651
GtkTreeIter *iter)
16521652
{
16531653
guint currentid;

workbench/src/tm_control.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
#include <geanyplugin.h>
2929
#include "idle_queue.h"
30+
#include "tm_control.h"
3031

3132
extern GeanyData *geany_data;
3233
static GHashTable *wb_tm_file_table = NULL;

workbench/src/tm_control.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
void wb_tm_control_init (void);
2323
void wb_tm_control_cleanup (void);
24-
void wb_tm_control_source_file_add(const gchar *filename);
25-
void wb_tm_control_source_file_remove(const gchar *filename);
24+
void wb_tm_control_source_file_add(gchar *filename);
25+
void wb_tm_control_source_file_remove(gchar *filename);
2626
void wb_tm_control_source_files_remove(GPtrArray *files);
2727
void wb_tm_control_source_files_new(GPtrArray *files);
2828

workbench/src/wb_project.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -638,14 +638,11 @@ static GSList *wb_project_dir_scan_directory(WB_PROJECT_DIR *root, const gchar *
638638
filelist = gp_filelist_scan_directory_callback
639639
(searchdir, scan_mode_workbench_cb, &params);
640640

641-
g_slist_foreach(params.file_patterns_list, (GFunc) g_pattern_spec_free, NULL);
642-
g_slist_free(params.file_patterns_list);
641+
g_slist_free_full(params.file_patterns_list, (GDestroyNotify)g_pattern_spec_free);
643642

644-
g_slist_foreach(params.ignored_dirs_list, (GFunc) g_pattern_spec_free, NULL);
645-
g_slist_free(params.ignored_dirs_list);
643+
g_slist_free_full(params.ignored_dirs_list, (GDestroyNotify)g_pattern_spec_free);
646644

647-
g_slist_foreach(params.ignored_file_list, (GFunc) g_pattern_spec_free, NULL);
648-
g_slist_free(params.ignored_file_list);
645+
g_slist_free_full(params.ignored_file_list, (GDestroyNotify)g_pattern_spec_free);
649646
}
650647
else
651648
{
@@ -697,8 +694,7 @@ static guint wb_project_dir_rescan_int(WB_PROJECT *prj, WB_PROJECT_DIR *root)
697694
}
698695
}
699696

700-
g_slist_foreach(lst, (GFunc) g_free, NULL);
701-
g_slist_free(lst);
697+
g_slist_free_full(lst, g_free);
702698

703699
return filenum;
704700
}
@@ -797,8 +793,7 @@ static void wb_project_dir_add_file_int(WB_PROJECT *prj, WB_PROJECT_DIR *root, c
797793
}
798794
}
799795

800-
g_slist_foreach(scanned, (GFunc) g_free, NULL);
801-
g_slist_free(scanned);
796+
g_slist_free_full(scanned, g_free);
802797
}
803798
}
804799

0 commit comments

Comments
 (0)