Constify value

This commit is contained in:
Sebastian Ramacher 2019-04-28 18:31:53 +02:00
parent 641799c45a
commit 6ccfd7f958
4 changed files with 21 additions and 21 deletions

View File

@ -294,7 +294,7 @@ cb_scale_factor(GObject* object, GParamSpec* UNUSED(pspec), gpointer data)
}
void
cb_page_layout_value_changed(girara_session_t* session, const char* name, girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
cb_page_layout_value_changed(girara_session_t* session, const char* name, girara_setting_type_t UNUSED(type), const void* value, void* UNUSED(data))
{
g_return_if_fail(value != NULL);
g_return_if_fail(session != NULL);
@ -303,7 +303,7 @@ cb_page_layout_value_changed(girara_session_t* session, const char* name, girara
/* pages-per-row must not be 0 */
if (g_strcmp0(name, "pages-per-row") == 0) {
unsigned int pages_per_row = *((unsigned int*) value);
unsigned int pages_per_row = *((const unsigned int*) value);
if (pages_per_row == 0) {
pages_per_row = 1;
girara_setting_set(session, name, &pages_per_row);
@ -559,7 +559,7 @@ cb_view_resized(GtkWidget* UNUSED(widget), GtkAllocation* UNUSED(allocation), za
void
cb_setting_recolor_change(girara_session_t* session, const char* name,
girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
girara_setting_type_t UNUSED(type), const void* value, void* UNUSED(data))
{
g_return_if_fail(value != NULL);
g_return_if_fail(session != NULL);
@ -567,7 +567,7 @@ cb_setting_recolor_change(girara_session_t* session, const char* name,
g_return_if_fail(name != NULL);
zathura_t* zathura = session->global.data;
const bool bool_value = *((bool*) value);
const bool bool_value = *((const bool*) value);
if (zathura->sync.render_thread != NULL && zathura_renderer_recolor_enabled(zathura->sync.render_thread) != bool_value) {
zathura_renderer_enable_recolor(zathura->sync.render_thread, bool_value);
@ -577,7 +577,7 @@ cb_setting_recolor_change(girara_session_t* session, const char* name,
void
cb_setting_recolor_keep_hue_change(girara_session_t* session, const char* name,
girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
girara_setting_type_t UNUSED(type), const void* value, void* UNUSED(data))
{
g_return_if_fail(value != NULL);
g_return_if_fail(session != NULL);
@ -585,7 +585,7 @@ cb_setting_recolor_keep_hue_change(girara_session_t* session, const char* name,
g_return_if_fail(name != NULL);
zathura_t* zathura = session->global.data;
const bool bool_value = *((bool*) value);
const bool bool_value = *((const bool*) value);
if (zathura->sync.render_thread != NULL && zathura_renderer_recolor_hue_enabled(zathura->sync.render_thread) != bool_value) {
zathura_renderer_enable_recolor_hue(zathura->sync.render_thread, bool_value);
@ -595,7 +595,7 @@ cb_setting_recolor_keep_hue_change(girara_session_t* session, const char* name,
void
cb_setting_recolor_keep_reverse_video_change(girara_session_t* session, const char* name,
girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
girara_setting_type_t UNUSED(type), const void* value, void* UNUSED(data))
{
g_return_if_fail(value != NULL);
g_return_if_fail(session != NULL);
@ -603,7 +603,7 @@ cb_setting_recolor_keep_reverse_video_change(girara_session_t* session, const ch
g_return_if_fail(name != NULL);
zathura_t* zathura = session->global.data;
const bool bool_value = *((bool*) value);
const bool bool_value = *((const bool*) value);
if (zathura->sync.render_thread != NULL && zathura_renderer_recolor_reverse_video_enabled(zathura->sync.render_thread) != bool_value) {
zathura_renderer_enable_recolor_reverse_video(zathura->sync.render_thread, bool_value);

View File

@ -143,7 +143,7 @@ void cb_scale_factor(GObject* object, GParamSpec* pspec, gpointer data);
* @param data Custom data
*/
void cb_page_layout_value_changed(girara_session_t* session, const char* name,
girara_setting_type_t type, void* value, void* data);
girara_setting_type_t type, const void* value, void* data);
/**
* Called when an index element is activated (e.g.: double click)
@ -211,7 +211,7 @@ gboolean cb_view_resized(GtkWidget* widget, GtkAllocation* allocation, zathura_t
* @param data Custom data
*/
void cb_setting_recolor_change(girara_session_t* session, const char* name,
girara_setting_type_t type, void* value, void* data);
girara_setting_type_t type, const void* value, void* data);
/**
* Emitted when the 'recolor-keephue' setting is changed
@ -223,7 +223,7 @@ void cb_setting_recolor_change(girara_session_t* session, const char* name,
* @param data Custom data
*/
void cb_setting_recolor_keep_hue_change(girara_session_t* session, const char* name,
girara_setting_type_t type, void* value, void* data);
girara_setting_type_t type, const void* value, void* data);
/**
* Emitted when the 'recolor-reverse-video' setting is changed
@ -235,7 +235,7 @@ void cb_setting_recolor_keep_hue_change(girara_session_t* session, const char* n
* @param data Custom data
*/
void cb_setting_recolor_keep_reverse_video_change(girara_session_t* session,
const char* name, girara_setting_type_t type, void* value, void* data);
const char* name, girara_setting_type_t type, const void* value, void* data);
/**
* Unknown command handler which is used to handle the strict numeric goto

View File

@ -23,7 +23,7 @@
static void
cb_jumplist_change(girara_session_t* session, const char* name,
girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
girara_setting_type_t UNUSED(type), const void* value, void* UNUSED(data))
{
g_return_if_fail(value != NULL);
g_return_if_fail(session != NULL);
@ -46,7 +46,7 @@ cb_jumplist_change(girara_session_t* session, const char* name,
static void
cb_color_change(girara_session_t* session, const char* name,
girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
girara_setting_type_t UNUSED(type), const void* value, void* UNUSED(data))
{
g_return_if_fail(value != NULL);
g_return_if_fail(session != NULL);
@ -78,34 +78,34 @@ cb_color_change(girara_session_t* session, const char* name,
static void
cb_nohlsearch_changed(girara_session_t* session, const char* UNUSED(name),
girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
girara_setting_type_t UNUSED(type), const void* value, void* UNUSED(data))
{
g_return_if_fail(value != NULL);
g_return_if_fail(session != NULL);
g_return_if_fail(session->global.data != NULL);
zathura_t* zathura = session->global.data;
bool* bvalue = value;
const bool* bvalue = value;
document_draw_search_results(zathura, !*bvalue);
render_all(zathura);
}
static void
cb_incsearch_changed(girara_session_t* session, const char* UNUSED(name),
girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
girara_setting_type_t UNUSED(type), const void* value, void* UNUSED(data))
{
g_return_if_fail(value != NULL);
g_return_if_fail(session != NULL);
g_return_if_fail(session->global.data != NULL);
bool inc_search = *(bool*) value;
bool inc_search = *(const bool*) value;
girara_special_command_add(session, '/', cmd_search, inc_search, FORWARD, NULL);
girara_special_command_add(session, '?', cmd_search, inc_search, BACKWARD, NULL);
}
static void
cb_sandbox_changed(girara_session_t* session, const char* UNUSED(name),
girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
girara_setting_type_t UNUSED(type), const void* value, void* UNUSED(data))
{
g_return_if_fail(value != NULL);
g_return_if_fail(session != NULL);
@ -126,7 +126,7 @@ cb_sandbox_changed(girara_session_t* session, const char* UNUSED(name),
static void
cb_window_statbusbar_changed(girara_session_t* session, const char* name,
girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
girara_setting_type_t UNUSED(type), const void* value, void* UNUSED(data))
{
g_return_if_fail(value != NULL);
g_return_if_fail(session != NULL);

View File

@ -88,7 +88,7 @@ run_synctex_forward(const char* synctex_fwd, const char* filename,
static zathura_t*
init_zathura(const char* config_dir, const char* data_dir,
const char* cache_dir, const char* plugin_path, char** argv,
char* synctex_editor, Window embed)
const char* synctex_editor, Window embed)
{
/* create zathura session */
zathura_t* zathura = zathura_create();