[geany/geany-plugins] e40d76: debugger: Mark local functions as static
Colomban Wendling
git-noreply at xxxxx
Fri Jun 8 16:37:19 UTC 2012
Branch: refs/heads/master
Author: Colomban Wendling <ban at herbesfolles.org>
Committer: Colomban Wendling <ban at herbesfolles.org>
Date: Fri, 08 Jun 2012 16:37:19
Commit: e40d760e77c670124c0f739a53b2a8daea42a19c
https://github.com/geany/geany-plugins/commit/e40d760e77c670124c0f739a53b2a8daea42a19c
Log Message:
-----------
debugger: Mark local functions as static
This prevents from polluting symbol table and may help the compiler to
better optimize those functions.
Modified Paths:
--------------
debugger/src/bptree.c
debugger/src/breakpoints.c
debugger/src/btnpanel.c
debugger/src/callbacks.c
debugger/src/dbm_gdb.c
debugger/src/dconfig.c
debugger/src/debug.c
debugger/src/plugin.c
debugger/src/vtree.c
debugger/src/watch_model.c
debugger/src/wtree.c
Modified: debugger/src/bptree.c
16 files changed, 8 insertions(+), 8 deletions(-)
===================================================================
@@ -81,7 +81,7 @@ enum
/*
* gets tree row reference for an unsected row at the same depth
*/
-GtkTreeRowReference* get_unselected_sibling(GtkTreePath *path)
+static GtkTreeRowReference* get_unselected_sibling(GtkTreePath *path)
{
GtkTreeRowReference *sibling = NULL;
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree));
@@ -212,7 +212,7 @@ static void on_render_filename(GtkTreeViewColumn *tree_column, GtkCellRenderer *
/*
* hides file checkbox for breaks rows
*/
-void on_render_enable_for_file(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model,
+static void on_render_enable_for_file(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model,
GtkTreeIter *iter, gpointer data)
{
GtkTreePath *path = gtk_tree_model_get_path(model, iter);
@@ -223,7 +223,7 @@ void on_render_enable_for_file(GtkTreeViewColumn *tree_column, GtkCellRenderer *
/*
* hides break pixbuf for file rows
*/
-void on_render_enable_break(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model,
+static void on_render_enable_break(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model,
GtkTreeIter *iter, gpointer data)
{
GtkTreePath *path = gtk_tree_model_get_path(model, iter);
@@ -234,7 +234,7 @@ void on_render_enable_break(GtkTreeViewColumn *tree_column, GtkCellRenderer *cel
/*
* makes condition and hitscount uneditable and empty for file rows
*/
-void on_render(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model,
+static void on_render(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model,
GtkTreeIter *iter, gpointer data)
{
GtkTreePath *path = gtk_tree_model_get_path(model, iter);
@@ -296,7 +296,7 @@ static void on_row_double_click(GtkTreeView *tree_view, GtkTreePath *path, GtkTr
/*
* editing "condition" column value finished
*/
-void on_condition_changed(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer user_data)
+static void on_condition_changed(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer user_data)
{
gchar *file;
int line;
@@ -335,7 +335,7 @@ void on_condition_changed(GtkCellRendererText *renderer, gchar *path, gchar *new
/*
* editing "hitscount" column value finished
*/
-void on_hitscount_changed(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer user_data)
+static void on_hitscount_changed(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer user_data)
{
GtkTreeIter iter, parent_iter;
GtkTreePath *tree_path;
@@ -379,7 +379,7 @@ void on_hitscount_changed(GtkCellRendererText *renderer, gchar *path, gchar *new
/*
* enable / disable all breaks for a file when it's checkbox icon has been clicked
*/
-void on_enable_for_file(GtkCellRendererToggle *cell_renderer, gchar *path, gpointer user_data)
+static void on_enable_for_file(GtkCellRendererToggle *cell_renderer, gchar *path, gpointer user_data)
{
GtkTreeIter iter;
GtkTreePath *tree_path;
@@ -419,7 +419,7 @@ void on_enable_for_file(GtkCellRendererToggle *cell_renderer, gchar *path, gpoin
/*
* enable / disable particulary break when it's icon has been clicked
*/
-void on_enable_break(CellRendererBreakIcon *cell_renderer, gchar *path, gpointer user_data)
+static void on_enable_break(CellRendererBreakIcon *cell_renderer, gchar *path, gpointer user_data)
{
GtkTreeIter iter;
GtkTreePath *tree_path;
Modified: debugger/src/breakpoints.c
10 files changed, 5 insertions(+), 5 deletions(-)
===================================================================
@@ -49,7 +49,7 @@
/*
* Iterates through GTree for the particular file
*/
-gboolean tree_foreach_call_function(gpointer key, gpointer value, gpointer data)
+static gboolean tree_foreach_call_function(gpointer key, gpointer value, gpointer data)
{
((breaks_iterate_function)data)(value);
return FALSE;
@@ -58,7 +58,7 @@ gboolean tree_foreach_call_function(gpointer key, gpointer value, gpointer data)
/*
* Iterates through hash table of GTree-s
*/
-void hash_table_foreach_call_function(gpointer key, gpointer value, gpointer user_data)
+static void hash_table_foreach_call_function(gpointer key, gpointer value, gpointer user_data)
{
g_tree_foreach((GTree*)value, tree_foreach_call_function, user_data);
}
@@ -67,7 +67,7 @@ void hash_table_foreach_call_function(gpointer key, gpointer value, gpointer use
* Iterates through GTree
* adding each item to GList that is passed through data variable
*/
-gboolean tree_foreach_add_to_list(gpointer key, gpointer value, gpointer data)
+static gboolean tree_foreach_add_to_list(gpointer key, gpointer value, gpointer data)
{
GList **list = (GList**)data;
*list = g_list_append(*list, value);
@@ -78,7 +78,7 @@ gboolean tree_foreach_add_to_list(gpointer key, gpointer value, gpointer data)
* Iterates through hash table of GTree-s
* calling list collection functions on each tree
*/
-void hash_table_foreach_add_to_list(gpointer key, gpointer value, gpointer user_data)
+static void hash_table_foreach_add_to_list(gpointer key, gpointer value, gpointer user_data)
{
g_tree_foreach((GTree*)value, tree_foreach_add_to_list, user_data);
}
@@ -170,7 +170,7 @@ static void on_remove_list(GList *list)
* b - second integer
* user_data - not used
*/
-gint compare_func(gconstpointer a, gconstpointer b, gpointer user_data)
+static gint compare_func(gconstpointer a, gconstpointer b, gpointer user_data)
{
return GPOINTER_TO_INT(a) - GPOINTER_TO_INT(b);
}
Modified: debugger/src/btnpanel.c
4 files changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -60,7 +60,7 @@
/*
* calls settings dialog
*/
-void on_settings(GtkButton *button, gpointer user_data)
+static void on_settings(GtkButton *button, gpointer user_data)
{
plugin_show_configure(geany_plugin);
}
@@ -68,7 +68,7 @@ void on_settings(GtkButton *button, gpointer user_data)
/*
* gets current file and line and calls debug function
*/
-void on_execute_until(GtkButton *button, gpointer user_data)
+static void on_execute_until(GtkButton *button, gpointer user_data)
{
GeanyDocument *doc = document_get_current();
if (doc)
Modified: debugger/src/callbacks.c
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -49,7 +49,7 @@
/*
* Set breakpoint and stack markers for a file
*/
-void set_markers_for_file(const gchar* file)
+static void set_markers_for_file(const gchar* file)
{
GList *breaks;
if ( (breaks = breaks_get_for_document(file)) )
Modified: debugger/src/dbm_gdb.c
82 files changed, 41 insertions(+), 41 deletions(-)
===================================================================
@@ -122,16 +122,16 @@ enum sr {
static int active_frame = 0;
/* forward declarations */
-void stop(void);
-variable* add_watch(gchar* expression);
-void update_watches(void);
-void update_autos(void);
-void update_files(void);
+static void stop(void);
+static variable* add_watch(gchar* expression);
+static void update_watches(void);
+static void update_autos(void);
+static void update_files(void);
/*
* print message using color, based on message type
*/
-void colorize_message(gchar *message)
+static void colorize_message(gchar *message)
{
const gchar *color;
if ('=' == *message)
@@ -221,7 +221,7 @@ static GList* read_until_prompt(void)
/*
* write a command to a gdb channel and flush with a newlinw character
*/
-void gdb_input_write_line(const gchar *line)
+static void gdb_input_write_line(const gchar *line)
{
GIOStatus st;
GError *err = NULL;
@@ -302,7 +302,7 @@ static GList* add_to_queue(GList* queue, const gchar *message, const gchar *comm
* reads from startup async commands.
* looks for a command completion (normal or abnormal), if noraml - executes next command
*/
-void exec_async_command(const gchar* command);
+static void exec_async_command(const gchar* command);
static gboolean on_read_async_output(GIOChannel * src, GIOCondition cond, gpointer data)
{
gchar *line;
@@ -615,7 +615,7 @@ static gboolean on_read_from_gdb(GIOChannel * src, GIOCondition cond, gpointer d
* connects reader to output channel and exits
* after execution
*/
-void exec_async_command(const gchar* command)
+static void exec_async_command(const gchar* command)
{
#ifdef DEBUG_OUTPUT
dbg_cbs->send_message(command, "red");
@@ -632,7 +632,7 @@ void exec_async_command(const gchar* command)
* i.e. reading output right
* after execution
*/
-result_class exec_sync_command(const gchar* command, gboolean wait4prompt, gchar** command_record)
+static result_class exec_sync_command(const gchar* command, gboolean wait4prompt, gchar** command_record)
{
GList *lines, *iter;
result_class rc;
@@ -708,7 +708,7 @@ result_class exec_sync_command(const gchar* command, gboolean wait4prompt, gchar
/*
* starts gdb, collects commands and start the first one
*/
-gboolean run(const gchar* file, const gchar* commandline, GList* env, GList *witer, GList *biter, const gchar* terminal_device, dbg_callbacks* callbacks)
+static gboolean run(const gchar* file, const gchar* commandline, GList* env, GList *witer, GList *biter, const gchar* terminal_device, dbg_callbacks* callbacks)
{
GError *err = NULL;
const gchar *exclude[] = { "LANG", NULL };
@@ -888,7 +888,7 @@ gboolean run(const gchar* file, const gchar* commandline, GList* env, GList *wit
/*
* starts debugging
*/
-void restart(char* terminal_device)
+static void restart(char* terminal_device)
{
dbg_cbs->clear_messages();
exec_async_command("-exec-run &");
@@ -897,7 +897,7 @@ void restart(char* terminal_device)
/*
* stops GDB
*/
-void stop(void)
+static void stop(void)
{
exec_sync_command("-gdb-exit", FALSE, NULL);
}
@@ -905,7 +905,7 @@ void stop(void)
/*
* resumes GDB
*/
-void resume(void)
+static void resume(void)
{
exec_async_command("-exec-continue");
}
@@ -913,7 +913,7 @@ void resume(void)
/*
* step over
*/
-void step_over(void)
+static void step_over(void)
{
exec_async_command("-exec-next");
}
@@ -921,7 +921,7 @@ void step_over(void)
/*
* step into
*/
-void step_into(void)
+static void step_into(void)
{
exec_async_command("-exec-step");
}
@@ -929,7 +929,7 @@ void step_into(void)
/*
* step out
*/
-void step_out(void)
+static void step_out(void)
{
exec_async_command("-exec-finish");
}
@@ -937,7 +937,7 @@ void step_out(void)
/*
* execute until
*/
-void execute_until(const gchar *file, int line)
+static void execute_until(const gchar *file, int line)
{
gchar command[1000];
sprintf(command, "-exec-until %s:%i", file, line);
@@ -947,7 +947,7 @@ void execute_until(const gchar *file, int line)
/*
* gets breakpoint number by file and line
*/
-int get_break_number(char* file, int line)
+static int get_break_number(char* file, int line)
{
gchar *record, *bstart;
@@ -993,7 +993,7 @@ int get_break_number(char* file, int line)
/*
* set breakpoint
*/
-gboolean set_break(breakpoint* bp, break_set_activity bsa)
+static gboolean set_break(breakpoint* bp, break_set_activity bsa)
{
char command[1000];
if (BSA_NEW_BREAK == bsa)
@@ -1066,7 +1066,7 @@ gboolean set_break(breakpoint* bp, break_set_activity bsa)
/*
* removes breakpoint
*/
-gboolean remove_break(breakpoint* bp)
+static gboolean remove_break(breakpoint* bp)
{
/* find break number */
int number = get_break_number(bp->file, bp->line);
@@ -1086,7 +1086,7 @@ gboolean remove_break(breakpoint* bp)
/*
* get active frame
*/
-int get_active_frame(void)
+static int get_active_frame(void)
{
return active_frame;
}
@@ -1094,7 +1094,7 @@ int get_active_frame(void)
/*
* select frame
*/
-void set_active_frame(int frame_number)
+static void set_active_frame(int frame_number)
{
gchar *command = g_strdup_printf("-stack-select-frame %i", frame_number);
if (RC_DONE == exec_sync_command(command, TRUE, NULL))
@@ -1109,7 +1109,7 @@ void set_active_frame(int frame_number)
/*
* gets stack
*/
-GList* get_stack(void)
+static GList* get_stack(void)
{
gchar* record = NULL;
GList *stack = NULL;
@@ -1204,7 +1204,7 @@ GList* get_stack(void)
* unescapes hex values (\0xXXX) to readable chars
* converting it from wide character value to char
*/
-gchar* unescape_hex_values(gchar *src)
+static gchar* unescape_hex_values(gchar *src)
{
GString *dest = g_string_new("");
@@ -1255,7 +1255,7 @@ gchar* unescape_hex_values(gchar *src)
* checks if pc pointer points to the
* valid printable charater
*/
-gboolean isvalidcharacter(gchar *pc, gboolean utf8)
+static gboolean isvalidcharacter(gchar *pc, gboolean utf8)
{
if (utf8)
return -1 != g_utf8_get_char_validated(pc, -1);
@@ -1266,7 +1266,7 @@ gboolean isvalidcharacter(gchar *pc, gboolean utf8)
/*
* unescapes string, handles octal characters representations
*/
-gchar* unescape_octal_values(gchar *text)
+static gchar* unescape_octal_values(gchar *text)
{
GString *value = g_string_new("");
@@ -1317,7 +1317,7 @@ gchar* unescape_octal_values(gchar *text)
/*
* unescapes value string, handles hexidecimal and octal characters representations
*/
-gchar *unescape(gchar *text)
+static gchar *unescape(gchar *text)
{
gchar *retval = NULL;
@@ -1342,7 +1342,7 @@ gchar *unescape(gchar *text)
/*
* updates variables from vars list
*/
-void get_variables (GList *vars)
+static void get_variables (GList *vars)
{
while (vars)
{
@@ -1409,7 +1409,7 @@ void get_variables (GList *vars)
/*
* updates files list
*/
-void update_files(void)
+static void update_files(void)
{
GHashTable *ht = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL);
gchar *record = NULL;
@@ -1445,7 +1445,7 @@ void update_files(void)
/*
* updates watches list
*/
-void update_watches(void)
+static void update_watches(void)
{
gchar command[1000];
GList *updating = NULL;
@@ -1512,7 +1512,7 @@ void update_watches(void)
/*
* updates autos list
*/
-void update_autos(void)
+static void update_autos(void)
{
gchar command[1000];
GList *unevaluated = NULL, *iter;
@@ -1594,7 +1594,7 @@ void update_autos(void)
/*
* get autos list
*/
-GList* get_autos (void)
+static GList* get_autos (void)
{
return g_list_copy(autos);
}
@@ -1602,7 +1602,7 @@ GList* get_autos (void)
/*
* get watches list
*/
-GList* get_watches (void)
+static GList* get_watches (void)
{
return g_list_copy(watches);
}
@@ -1610,7 +1610,7 @@ GList* get_watches (void)
/*
* get files list
*/
-GList* get_files (void)
+static GList* get_files (void)
{
return g_list_copy(files);
}
@@ -1618,7 +1618,7 @@ GList* get_files (void)
/*
* get list of children
*/
-GList* get_children (gchar* path)
+static GList* get_children (gchar* path)
{
GList *children = NULL;
@@ -1683,7 +1683,7 @@ GList* get_children (gchar* path)
/*
* add new watch
*/
-variable* add_watch(gchar* expression)
+static variable* add_watch(gchar* expression)
{
gchar command[1000];
gchar *record = NULL, *escaped, *pos;
@@ -1720,7 +1720,7 @@ variable* add_watch(gchar* expression)
/*
* remove watch
*/
-void remove_watch(gchar* internal)
+static void remove_watch(gchar* internal)
{
GList *iter = watches;
while (iter)
@@ -1741,7 +1741,7 @@ void remove_watch(gchar* internal)
/*
* evaluates given expression and returns the result
*/
-gchar *evaluate_expression(gchar *expression)
+static gchar *evaluate_expression(gchar *expression)
{
gchar *record = NULL, *pos;
char command[1000];
@@ -1765,7 +1765,7 @@ gchar *evaluate_expression(gchar *expression)
/*
* request GDB interrupt
*/
-gboolean request_interrupt(void)
+static gboolean request_interrupt(void)
{
#ifdef DEBUG_OUTPUT
char msg[1000];
@@ -1782,7 +1782,7 @@ gboolean request_interrupt(void)
/*
* get GDB error messages
*/
-gchar* error_message(void)
+static gchar* error_message(void)
{
return err_message;
}
Modified: debugger/src/dconfig.c
10 files changed, 5 insertions(+), 5 deletions(-)
===================================================================
@@ -79,7 +79,7 @@
/*
* creates a copy of a specified keyfile
*/
-GKeyFile *create_copy_keyfile(GKeyFile *keyfile)
+static GKeyFile *create_copy_keyfile(GKeyFile *keyfile)
{
gchar *path, *config_data;
GKeyFile *copy;
@@ -102,7 +102,7 @@ GKeyFile *create_copy_keyfile(GKeyFile *keyfile)
/*
* loads debug session from a keyfile and updates GUI
*/
-void debug_load_from_keyfile(GKeyFile *keyfile)
+static void debug_load_from_keyfile(GKeyFile *keyfile)
{
gchar *value;
int i, count;
@@ -183,7 +183,7 @@ void debug_load_from_keyfile(GKeyFile *keyfile)
/*
* saves debug session to a keyfile using values from GUI
*/
-void save_to_keyfile(GKeyFile *keyfile)
+static void save_to_keyfile(GKeyFile *keyfile)
{
GList *_env, *watches, *_breaks, *iter;
int env_index, watch_index, bp_index;
@@ -409,7 +409,7 @@ void config_set_panel(int config_part, gpointer config_value, ...)
/*
* set default debug session values to a keyfile
*/
-void config_set_debug_defaults(GKeyFile *keyfile)
+static void config_set_debug_defaults(GKeyFile *keyfile)
{
g_key_file_set_string(keyfile, DEBUGGER_GROUP, "target", "");
g_key_file_set_string(keyfile, DEBUGGER_GROUP, "debugger", "");
@@ -423,7 +423,7 @@ void config_set_debug_defaults(GKeyFile *keyfile)
/*
* set default panel config values in a GKeyFile
*/
-void config_set_panel_defaults(GKeyFile *keyfile)
+static void config_set_panel_defaults(GKeyFile *keyfile)
{
int all_tabs[] = { TID_TARGET, TID_BREAKS, TID_AUTOS, TID_WATCH, TID_STACK, TID_TERMINAL, TID_MESSAGES };
int left_tabs[] = { TID_TARGET, TID_BREAKS, TID_AUTOS, TID_WATCH };
Modified: debugger/src/debug.c
6 files changed, 3 insertions(+), 3 deletions(-)
===================================================================
@@ -153,7 +153,7 @@
/*
* remove stack margin markers
*/
- void remove_stack_markers(void)
+static void remove_stack_markers(void)
{
int active_frame_index = active_module->get_active_frame();
@@ -502,7 +502,7 @@ static gboolean on_watch_key_pressed_callback(GtkWidget *widget, GdkEvent *even
/*
* mouse button has been pressed while being in watch(autos) tree view
*/
-gboolean on_watch_button_pressed_callback(GtkWidget *treeview, GdkEventButton *event, gpointer userdata)
+static gboolean on_watch_button_pressed_callback(GtkWidget *treeview, GdkEventButton *event, gpointer userdata)
{
if (event->type == GDK_2BUTTON_PRESS && event->button == 1)
{
@@ -844,7 +844,7 @@ static void on_debugger_exited (int code)
/*
* called from debugger module to show a message in debugger messages pane
*/
-void on_debugger_message (const gchar* message, const gchar *color)
+static void on_debugger_message (const gchar* message, const gchar *color)
{
gchar *msg = g_strdup_printf("%s\n", message);
Modified: debugger/src/plugin.c
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -77,7 +77,7 @@
{ NULL, NULL, FALSE, NULL }
};
-void on_paned_mode_changed(GtkToggleButton *button, gpointer user_data)
+static void on_paned_mode_changed(GtkToggleButton *button, gpointer user_data)
{
gboolean state = gtk_toggle_button_get_active(button);
dpaned_set_tabbed(state);
Modified: debugger/src/vtree.c
4 files changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -76,7 +76,7 @@ static gboolean on_key_pressed(GtkWidget *widget, GdkEvent *event, gpointer user
/*
* value rendere function
*/
-void render_icon(GtkTreeViewColumn *tree_column,
+static void render_icon(GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell,
GtkTreeModel *tree_model,
GtkTreeIter *iter,
@@ -113,7 +113,7 @@ void render_icon(GtkTreeViewColumn *tree_column,
/*
* value rendere function
*/
-void render_value(GtkTreeViewColumn *tree_column,
+static void render_value(GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell,
GtkTreeModel *tree_model,
GtkTreeIter *iter,
Modified: debugger/src/watch_model.c
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -213,7 +213,7 @@ void free_variables_list(GList *vars)
/*
* updates iterator according to variable
*/
-void update_variable(GtkTreeStore *store, GtkTreeIter *iter, variable *var, gboolean changed)
+static void update_variable(GtkTreeStore *store, GtkTreeIter *iter, variable *var, gboolean changed)
{
gtk_tree_store_set (store, iter,
W_NAME, var->name->str,
Modified: debugger/src/wtree.c
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -123,7 +123,7 @@ GtkTreePath* wtree_empty_path(void)
/*
* iterating function to collect all watches
*/
-gboolean watches_foreach_collect(GtkTreeModel *_model,
+static gboolean watches_foreach_collect(GtkTreeModel *_model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data)
@@ Diff output truncated at 100000 characters. @@
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
More information about the Plugins-Commits
mailing list