mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 10:06:01 +01:00
Remove function pointer casts
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
10f8f89726
commit
be717529c2
4 changed files with 15 additions and 11 deletions
|
@ -357,14 +357,16 @@ handle_link(GtkEntry* entry, girara_session_t* session,
|
|||
}
|
||||
|
||||
bool
|
||||
cb_sc_follow(GtkEntry* entry, girara_session_t* session)
|
||||
cb_sc_follow(GtkEntry* entry, void* data)
|
||||
{
|
||||
girara_session_t* session = data;
|
||||
return handle_link(entry, session, ZATHURA_LINK_ACTION_FOLLOW);
|
||||
}
|
||||
|
||||
bool
|
||||
cb_sc_display_link(GtkEntry* entry, girara_session_t* session)
|
||||
cb_sc_display_link(GtkEntry* entry, void* data)
|
||||
{
|
||||
girara_session_t* session = data;
|
||||
return handle_link(entry, session, ZATHURA_LINK_ACTION_DISPLAY);
|
||||
}
|
||||
|
||||
|
@ -395,7 +397,7 @@ password_dialog(gpointer data)
|
|||
"Incorrect password. Enter password:",
|
||||
true,
|
||||
NULL,
|
||||
(girara_callback_inputbar_activate_t) cb_password_dialog,
|
||||
cb_password_dialog,
|
||||
dialog
|
||||
);
|
||||
}
|
||||
|
@ -404,12 +406,14 @@ password_dialog(gpointer data)
|
|||
}
|
||||
|
||||
bool
|
||||
cb_password_dialog(GtkEntry* entry, zathura_password_dialog_info_t* dialog)
|
||||
cb_password_dialog(GtkEntry* entry, void* data)
|
||||
{
|
||||
if (entry == NULL || dialog == NULL) {
|
||||
if (entry == NULL || data == NULL) {
|
||||
goto error_ret;
|
||||
}
|
||||
|
||||
zathura_password_dialog_info_t* dialog = data;
|
||||
|
||||
if (dialog->path == NULL) {
|
||||
free(dialog);
|
||||
goto error_ret;
|
||||
|
|
|
@ -110,7 +110,7 @@ void cb_index_row_activated(GtkTreeView* tree_view, GtkTreePath* path,
|
|||
* @param session The girara session
|
||||
* @return true if no error occurred and the event has been handled
|
||||
*/
|
||||
bool cb_sc_follow(GtkEntry* entry, girara_session_t* session);
|
||||
bool cb_sc_follow(GtkEntry* entry, void* session);
|
||||
|
||||
/**
|
||||
* Called when input has been passed to the sc_display_link dialog
|
||||
|
@ -119,7 +119,7 @@ bool cb_sc_follow(GtkEntry* entry, girara_session_t* session);
|
|||
* @param session The girara session
|
||||
* @return true if no error occurred and the event has been handled
|
||||
*/
|
||||
bool cb_sc_display_link(GtkEntry* entry, girara_session_t* session);
|
||||
bool cb_sc_display_link(GtkEntry* entry, void* session);
|
||||
|
||||
/**
|
||||
* Emitted when file has been changed
|
||||
|
@ -136,7 +136,7 @@ void cb_file_monitor(ZathuraFileMonitor* monitor, girara_session_t* session);
|
|||
* @param dialog The dialog information
|
||||
* @return true if input has been handled
|
||||
*/
|
||||
bool cb_password_dialog(GtkEntry* entry, zathura_password_dialog_info_t* dialog);
|
||||
bool cb_password_dialog(GtkEntry* entry, void* dialog);
|
||||
|
||||
/**
|
||||
* Emitted when the view has been resized
|
||||
|
|
|
@ -135,7 +135,7 @@ sc_display_link(girara_session_t* session, girara_argument_t* UNUSED(argument),
|
|||
if (show_links) {
|
||||
zathura_document_set_adjust_mode(zathura->document, ZATHURA_ADJUST_INPUTBAR);
|
||||
girara_dialog(zathura->ui.session, "Display link:", FALSE, NULL,
|
||||
(girara_callback_inputbar_activate_t) cb_sc_display_link,
|
||||
cb_sc_display_link,
|
||||
zathura->ui.session);
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ sc_follow(girara_session_t* session, girara_argument_t* UNUSED(argument),
|
|||
/* ask for input */
|
||||
if (show_links == true) {
|
||||
zathura_document_set_adjust_mode(zathura->document, ZATHURA_ADJUST_INPUTBAR);
|
||||
girara_dialog(zathura->ui.session, "Follow link:", FALSE, NULL, (girara_callback_inputbar_activate_t) cb_sc_follow, zathura->ui.session);
|
||||
girara_dialog(zathura->ui.session, "Follow link:", FALSE, NULL, cb_sc_follow, zathura->ui.session);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -751,7 +751,7 @@ document_open_password_dialog(gpointer data)
|
|||
zathura_password_dialog_info_t* password_dialog_info = data;
|
||||
|
||||
girara_dialog(password_dialog_info->zathura->ui.session, _("Enter password:"), true, NULL,
|
||||
(girara_callback_inputbar_activate_t) cb_password_dialog, password_dialog_info);
|
||||
cb_password_dialog, password_dialog_info);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue