Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codenav/src/codenavigation.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static void load_configuration(void)
* @return the GtkDialog from Geany
*
*/
GtkWidget *plugin_codenav_configure(G_GNUC_UNUSED GeanyPlugin *plugin, GtkDialog *dialog, G_GNUC_UNUSED gpointer pdata)
static GtkWidget *plugin_codenav_configure(G_GNUC_UNUSED GeanyPlugin *plugin, GtkDialog *dialog, G_GNUC_UNUSED gpointer pdata)
{
GtkWidget *vbox;

Expand Down
3 changes: 1 addition & 2 deletions codenav/src/goto_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ build_file_list(const gchar* dirname, const gchar* prefix)
g_free(pathfile);
}

g_slist_foreach(files_list, (GFunc) g_free, NULL);
g_slist_free(files_list);
g_slist_free_full(files_list, g_free);

return GTK_TREE_MODEL(ret_list);

Expand Down
10 changes: 3 additions & 7 deletions codenav/src/switch_head_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,8 @@ void languages_clean(void)
for(iter = languages ; iter != NULL ; iter = iter->next)
{
Language* lang = (Language*)(iter->data);

g_slist_foreach(lang->head_extensions, (GFunc)(&g_free), NULL);
g_slist_free(lang->head_extensions);

g_slist_foreach(lang->impl_extensions, (GFunc)(&g_free), NULL);
g_slist_free(lang->impl_extensions);
g_slist_free_full(lang->head_extensions, g_free);
g_slist_free_full(lang->impl_extensions, g_free);
}

g_slist_free(languages);
Expand Down Expand Up @@ -427,7 +423,7 @@ menu_item_activate(guint key_id)

/* Free the memory */
free_mem:
g_slist_foreach(filenames_to_test, (GFunc)(&g_free), NULL);
g_slist_free_full(filenames_to_test, g_free);
g_free(dirname);
g_free(basename_no_extension);
g_free(extension);
Expand Down
3 changes: 1 addition & 2 deletions debugger/src/bptree.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,7 @@ static gboolean on_key_pressed(GtkWidget *widget, GdkEvent *event, gpointer user
}

/* free rows list */
g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL);
g_list_free (rows);
g_list_free_full(rows, (GDestroyNotify) gtk_tree_path_free);

return FALSE;
}
Expand Down
27 changes: 9 additions & 18 deletions debugger/src/dbm_gdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,15 @@ static void on_gdb_exit(GPid pid, gint status, gpointer data)
shutdown_channel(&gdb_ch_out);

/* delete autos */
g_list_foreach(autos, (GFunc)g_free, NULL);
g_list_free(autos);
g_list_free_full(autos, g_free);
autos = NULL;

/* delete watches */
g_list_foreach(watches, (GFunc)g_free, NULL);
g_list_free(watches);
g_list_free_full(watches, g_free);
watches = NULL;

/* delete files */
g_list_foreach(files, (GFunc)g_free, NULL);
g_list_free(files);
g_list_free_full(files, g_free);
files = NULL;

g_source_remove(gdb_src_id);
Expand Down Expand Up @@ -277,8 +274,7 @@ static void free_commands_queue(GList *queue)
{
/* all commands completed */
queue = g_list_first(queue);
g_list_foreach(queue, (GFunc)free_queue_item, NULL);
g_list_free(queue);
g_list_free_full(queue, (GDestroyNotify) free_queue_item);
}

/*
Expand Down Expand Up @@ -329,8 +325,7 @@ static gboolean on_read_async_output(GIOChannel * src, GIOCondition cond, gpoint
}

lines = read_until_prompt();
g_list_foreach(lines, (GFunc)g_free, NULL);
g_list_free (lines);
g_list_free_full(lines, g_free);

if (!strcmp(record->klass, "done"))
{
Expand Down Expand Up @@ -680,8 +675,7 @@ static result_class exec_sync_command(const gchar* command, gboolean wait4prompt
gdb_mi_record_free(record);
}

g_list_foreach(lines, (GFunc)g_free, NULL);
g_list_free(lines);
g_list_free_full(lines, g_free);

return rc;
}
Expand Down Expand Up @@ -763,8 +757,7 @@ static gboolean run(const gchar* file, const gchar* commandline, GList* env, GLi
}
g_free(unescaped);
}
g_list_foreach(lines, (GFunc)g_free, NULL);
g_list_free(lines);
g_list_free_full(lines, g_free);

/* add initial watches to the list */
while (witer)
Expand Down Expand Up @@ -1270,8 +1263,7 @@ static void update_files(void)
if (files)
{
/* free previous list */
g_list_foreach(files, (GFunc)g_free, NULL);
g_list_free(files);
g_list_free_full(files, g_free);
files = NULL;
}

Expand Down Expand Up @@ -1381,8 +1373,7 @@ static void update_autos(void)
exec_sync_command(command, TRUE, NULL);
}

g_list_foreach(autos, (GFunc)variable_free, NULL);
g_list_free(autos);
g_list_free_full(autos, (GDestroyNotify) variable_free);
autos = NULL;

/* add current autos to the list */
Expand Down
6 changes: 2 additions & 4 deletions debugger/src/dconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@ static void save_to_keyfile(GKeyFile *keyfile)
env_index++;
iter = iter->next;
}
g_list_foreach(_env, (GFunc)g_free, NULL);
g_list_free(_env);
g_list_free_full(_env, g_free);

/* watches */
watches = wtree_get_watches();
Expand All @@ -230,8 +229,7 @@ static void save_to_keyfile(GKeyFile *keyfile)

watch_index++;
}
g_list_foreach(watches, (GFunc)g_free, NULL);
g_list_free(watches);
g_list_free_full(watches,g_free);

/* breakpoints */
_breaks = breaks_get_all();
Expand Down
26 changes: 9 additions & 17 deletions debugger/src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,17 +496,15 @@ static gboolean on_watch_key_pressed_callback(GtkWidget *widget, GdkEvent *even
gtk_tree_path_free(path_to_select);

/* free references list */
g_list_foreach (references, (GFunc)gtk_tree_row_reference_free, NULL);
g_list_free (references);
g_list_free_full(references, (GDestroyNotify) gtk_tree_row_reference_free);

config_set_debug_changed();
}

gtk_tree_path_free(empty_path);

/* free rows list */
g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL);
g_list_free (rows);
g_list_free_full(rows, (GDestroyNotify) gtk_tree_path_free);

return FALSE;
}
Expand Down Expand Up @@ -640,8 +638,7 @@ static void on_debugger_run (void)
if (stack)
{
remove_stack_markers();
g_list_foreach(stack, (GFunc)frame_unref, NULL);
g_list_free(stack);
g_list_free_full(stack, (GDestroyNotify) frame_unref);
stack = NULL;

stree_remove_frames();
Expand Down Expand Up @@ -795,8 +792,7 @@ static void on_debugger_exited (int code)
if (stack)
{
remove_stack_markers();
g_list_foreach(stack, (GFunc)frame_unref, NULL);
g_list_free(stack);
g_list_free_full(stack, (GDestroyNotify) frame_unref);
stack = NULL;
}

Expand Down Expand Up @@ -975,7 +971,7 @@ static void on_select_thread(int thread_id)

if ((success = active_module->set_active_thread(thread_id)))
{
g_list_free_full(stack, (GDestroyNotify)frame_unref);
g_list_free_full(stack, (GDestroyNotify) frame_unref);
stack = active_module->get_stack();

/* update the stack tree */
Expand Down Expand Up @@ -1122,8 +1118,7 @@ void debug_destroy(void)
if (stack)
{
remove_stack_markers();
g_list_foreach(stack, (GFunc)frame_unref, NULL);
g_list_free(stack);
g_list_free_full(stack, (GDestroyNotify) frame_unref);
stack = NULL;
}

Expand Down Expand Up @@ -1224,11 +1219,9 @@ void debug_run(void)
g_free(target);
g_free(commandline);

g_list_foreach(env, (GFunc)g_free, NULL);
g_list_free(env);
g_list_free_full(env, g_free);

g_list_foreach(watches, (GFunc)g_free, NULL);
g_list_free(watches);
g_list_free_full(watches, g_free);

g_list_free(breaks);
}
Expand Down Expand Up @@ -1409,8 +1402,7 @@ gchar* debug_get_calltip_for_expression(gchar* expression)
{
g_string_append(calltip_str, "\n\t\t........");
}
g_list_foreach(children, (GFunc)variable_free, NULL);
g_list_free(children);
g_list_free_full(children, (GDestroyNotify) variable_free);
}
calltip = g_string_free(calltip_str, FALSE);
}
Expand Down
6 changes: 2 additions & 4 deletions debugger/src/envtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ static void delete_selected_rows(void)
gtk_tree_path_free(path);

/* free references list */
g_list_foreach (references, (GFunc)gtk_tree_row_reference_free, NULL);
g_list_free (references);
g_list_free_full(references, (GDestroyNotify) gtk_tree_row_reference_free);
}

/* free selection reference */
Expand All @@ -176,8 +175,7 @@ static void delete_selected_rows(void)
gtk_tree_path_free(empty_path);

/* free rows list */
g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL);
g_list_free (rows);
g_list_free_full(rows, (GDestroyNotify) gtk_tree_path_free);
}

/*
Expand Down
3 changes: 1 addition & 2 deletions debugger/src/vtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ static gboolean on_key_pressed(GtkWidget *widget, GdkEvent *event, gpointer user
else
gtk_tree_view_collapse_row(GTK_TREE_VIEW(widget), (GtkTreePath*)rows->data);

g_list_foreach(rows, (GFunc)gtk_tree_path_free, NULL);
g_list_free(rows);
g_list_free_full(rows, (GDestroyNotify)gtk_tree_path_free);
}
}

Expand Down
3 changes: 1 addition & 2 deletions debugger/src/watch_model.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,7 @@ inline static GList *lookup_variable(GList *vars, gchar *name)
*/
void free_variables_list(GList *vars)
{
g_list_foreach(vars, (GFunc)variable_free, NULL);
g_list_free(vars);
g_list_free_full(vars, (GDestroyNotify) variable_free);
}

/*
Expand Down
3 changes: 2 additions & 1 deletion geanyctags/src/geanyctags.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static gchar *get_tags_filename(void)
}
return ret;
}

#ifndef G_OS_WIN32
static gchar *generate_find_string(GeanyProject *prj)
{
gchar *ret;
Expand All @@ -198,6 +198,7 @@ static gchar *generate_find_string(GeanyProject *prj)
}
return ret;
}
#endif


static gchar *get_base_path(void)
Expand Down
6 changes: 6 additions & 0 deletions geanylua/glspi.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ void glspi_init_sci_funcs(lua_State *L);
void glspi_init_gsdlg_module(lua_State *L, GsDlgRunHook hook, GtkWindow *toplevel);
void glspi_run_script(const gchar *script_file, gint caller, GKeyFile*proj, const gchar *script_dir);

gint luaopen_libgeanylua(lua_State *L);
void glspi_init (GeanyData *data, GeanyPlugin *plugin);
void glspi_cleanup(void);
void glspi_configure(GtkWidget *parent);


/* Pass TRUE to create hashes, FALSE to destroy them */
void glspi_set_sci_cmd_hash(gboolean create);
void glspi_set_key_cmd_hash(gboolean create);
Expand Down
8 changes: 1 addition & 7 deletions geanylua/glspi_kfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
#include "glspi_kfile.h"

#define LUA_MODULE_NAME "keyfile"
#define MetaName "_g_key_file_metatable"
Expand Down Expand Up @@ -63,15 +64,8 @@ static gint fail_arg_type(lua_State *L, const gchar *func, gint argnum, const gc

static const gchar*LuaKeyFileType="GKeyFile";

typedef struct _LuaKeyFile
{
const gchar*id;
GKeyFile*kf;
gboolean managed;
} LuaKeyFile;


typedef gint (*KeyfileAssignFunc) (lua_State *L, GKeyFile*kf);

static gint glspi_kfile_assign(lua_State *L, GKeyFile*kf)
{
Expand Down
22 changes: 22 additions & 0 deletions geanylua/glspi_kfile.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* glspi_kfile.h - This file is part of the Lua scripting plugin for the Geany IDE
* See the file "geanylua.c" for copyright information.
*/

/* Minimal interface to a GKeyFile object */

#ifndef __GLSPI_KFILE_H
#define __GLSPI_KFILE_H

typedef struct _LuaKeyFile
{
const gchar*id;
GKeyFile*kf;
gboolean managed;
} LuaKeyFile;


typedef gint (*KeyfileAssignFunc) (lua_State *L, GKeyFile*kf);

void glspi_init_kfile_module(lua_State *L, KeyfileAssignFunc *func);
#endif
2 changes: 2 additions & 0 deletions geanylua/gsdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ which case the GSDLG_API functions will be available externally.
#define GSDLG_API
#endif

#include <lua.h>
#include <gtk/gtk.h>

typedef const gchar* GsDlgStr;
Expand Down Expand Up @@ -77,6 +78,7 @@ typedef void (*GsDlgRunHook) (gboolean running, gpointer user_data);
*/
#ifndef DIALOG_LIB
GSDLG_API void gsdlg_set_run_hook(GsDlgRunHook cb);
void glspi_init_gsdlg_module(lua_State *L, GsDlgRunHook hook, GtkWindow *toplevel);
#endif


Expand Down
3 changes: 1 addition & 2 deletions geanyprj/src/project.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@ void geany_project_regenerate_file_list(struct GeanyPrj *prj)
lst = get_file_list(prj->base_path, NULL, project_type_filter[prj->type], NULL);
geany_project_set_tags_from_list(prj, lst);

g_slist_foreach(lst, (GFunc) g_free, NULL);
g_slist_free(lst);
g_slist_free_full(lst, g_free);
}


Expand Down
Loading