From 777e19baf455e72d441616522cbb588f04b6cbed Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 9 Dec 2011 14:48:16 +0100 Subject: [PATCH 1/2] const correctness --- commands.c | 2 +- commands.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commands.c b/commands.c index 5e053a4..d431b07 100644 --- a/commands.c +++ b/commands.c @@ -270,7 +270,7 @@ cmd_savef(girara_session_t* session, girara_list_t* argument_list) } bool -cmd_search(girara_session_t* session, char* input, girara_argument_t* argument) +cmd_search(girara_session_t* session, const char* input, girara_argument_t* argument) { g_return_val_if_fail(session != NULL, false); g_return_val_if_fail(input != NULL, false); diff --git a/commands.h b/commands.h index 75cf885..4318430 100644 --- a/commands.h +++ b/commands.h @@ -104,6 +104,6 @@ bool cmd_savef(girara_session_t* session, girara_list_t* argument_list); * @param argument Passed argument * @return true if no error occured */ -bool cmd_search(girara_session_t* session, char* input, girara_argument_t* argument); +bool cmd_search(girara_session_t* session, const char* input, girara_argument_t* argument); #endif // COMMANDS_H From 2cb31a61ea3f84fd081f6a428046849a3b587ab7 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 9 Dec 2011 14:50:35 +0100 Subject: [PATCH 2/2] reuse GIRARA_UNUSED --- callbacks.c | 3 ++- callbacks.h | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/callbacks.c b/callbacks.c index ba7e84b..19a85fb 100644 --- a/callbacks.c +++ b/callbacks.c @@ -98,8 +98,9 @@ cb_pages_per_row_value_changed(girara_session_t* UNUSED(session), const char* UN void cb_index_row_activated(GtkTreeView* tree_view, GtkTreePath* path, - GtkTreeViewColumn* UNUSED(column), zathura_t* zathura) + GtkTreeViewColumn* UNUSED(column), void* data) { + zathura_t* zathura = data; if (tree_view == NULL || zathura == NULL || zathura->ui.session == NULL) { return; } diff --git a/callbacks.h b/callbacks.h index 373443a..70ad94f 100644 --- a/callbacks.h +++ b/callbacks.h @@ -5,8 +5,7 @@ #include #include - -#include "zathura.h" +#include /** * Quits the current zathura session @@ -39,7 +38,7 @@ void cb_view_vadjustment_value_changed(GtkAdjustment *adjustment, gpointer data) * @param session The current girara session * @param setting The "pages-per-row" setting */ -void cb_pages_per_row_value_changed(girara_session_t* UNUSED(session), const char* UNUSED(name), girara_setting_type_t UNUSED(type), void* value, void* data); +void cb_pages_per_row_value_changed(girara_session_t* GIRARA_UNUSED(session), const char* GIRARA_UNUSED(name), girara_setting_type_t GIRARA_UNUSED(type), void* value, void* data); /** * Called when an index element is activated (e.g.: double click) @@ -50,6 +49,6 @@ void cb_pages_per_row_value_changed(girara_session_t* UNUSED(session), const cha * @param zathura Zathura session */ void cb_index_row_activated(GtkTreeView* tree_view, GtkTreePath* path, - GtkTreeViewColumn* column, zathura_t* zathura); + GtkTreeViewColumn* column, void* zathura); #endif // CALLBACKS_H