aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-04 11:04:54 (GMT)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-04 11:04:54 (GMT)
commit4b38b0d68956bcaa7e47fd46941a8b9fc72cc692 (patch)
treecdde897ab3814e8264a2e2e09ffcc4c1d0d40530
parent58c707029d7a4d1632c1bdc51b52891397570716 (diff)
callbacks: fix the notification functions
As warned by gcc, the way it is, those functions do nothing, as they're not passing a pointer to the data that should be updated. Fix them. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--src/callbacks.c12
-rw-r--r--src/callbacks.h6
-rw-r--r--src/main.c14
3 files changed, 16 insertions, 16 deletions
diff --git a/src/callbacks.c b/src/callbacks.c
index 2a7884e..8ce2ec3 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -197,32 +197,32 @@ void rts_func (GtkWidget * rb, cam_t *cam)
void
gconf_notify_func (GConfClient * client, guint cnxn_id, GConfEntry * entry,
- char *str)
+ char **str)
{
GConfValue *value;
value = gconf_entry_get_value (entry);
- str = g_strdup (gconf_value_get_string (value));
+ *str = g_strdup (gconf_value_get_string (value));
}
void
gconf_notify_func_bool (GConfClient * client, guint cnxn_id,
- GConfEntry * entry, gboolean val)
+ GConfEntry * entry, gboolean *val)
{
GConfValue *value;
value = gconf_entry_get_value (entry);
- val = gconf_value_get_bool (value);
+ *val = gconf_value_get_bool (value);
}
void
gconf_notify_func_int (GConfClient * client, guint cnxn_id,
- GConfEntry * entry, int val)
+ GConfEntry * entry, int *val)
{
GConfValue *value;
value = gconf_entry_get_value (entry);
- val = gconf_value_get_int (value);
+ *val = gconf_value_get_int (value);
}
diff --git a/src/callbacks.h b/src/callbacks.h
index d38fe4b..83efcc8 100644
--- a/src/callbacks.h
+++ b/src/callbacks.h
@@ -10,11 +10,11 @@ G_BEGIN_DECLS
void on_change_size_activate (GtkWidget * widget, cam_t *cam);
void on_quit_activate (GtkMenuItem * menuitem, gpointer user_data);
void gconf_notify_func (GConfClient * client, guint cnxn_id,
- GConfEntry * entry, char *);
+ GConfEntry * entry, char **);
void gconf_notify_func_bool (GConfClient * client, guint cnxn_id,
- GConfEntry * entry, gboolean val);
+ GConfEntry * entry, gboolean *val);
void gconf_notify_func_int (GConfClient * client, guint cnxn_id,
- GConfEntry * entry, int val);
+ GConfEntry * entry, int *val);
int delete_event (GtkWidget *, gpointer data);
void cap_func (GtkWidget *, cam_t *);
void rcap_func (GtkWidget *, cam_t *);
diff --git a/src/main.c b/src/main.c
index a759120..02216ad 100644
--- a/src/main.c
+++ b/src/main.c
@@ -107,23 +107,23 @@ main(int argc, char *argv[]) {
gconf_client_add_dir (cam->gc, PATH, GCONF_CLIENT_PRELOAD_NONE, NULL);
gconf_client_notify_add (cam->gc, KEY1, (void *) gconf_notify_func,
- cam->pixdir, NULL, NULL);
+ &cam->pixdir, NULL, NULL);
gconf_client_notify_add (cam->gc, KEY2, (void *) gconf_notify_func,
- cam->capturefile, NULL, NULL);
+ &cam->capturefile, NULL, NULL);
gconf_client_notify_add (cam->gc, KEY3,
(void *) gconf_notify_func_int,
- GINT_TO_POINTER (cam->savetype), NULL, NULL);
+ &cam->savetype, NULL, NULL);
gconf_client_notify_add (cam->gc, KEY4,
(void *) gconf_notify_func_bool,
&cam->timestamp, NULL, NULL);
gconf_client_notify_add (cam->gc, KEY5, (void *) gconf_notify_func,
- cam->host, NULL, NULL);
+ &cam->host, NULL, NULL);
gconf_client_notify_add (cam->gc, KEY6, (void *) gconf_notify_func,
- cam->proto, NULL, NULL);
+ &cam->proto, NULL, NULL);
gconf_client_notify_add (cam->gc, KEY8, (void *) gconf_notify_func,
- cam->rdir, NULL, NULL);
+ &cam->rdir, NULL, NULL);
gconf_client_notify_add (cam->gc, KEY9, (void *) gconf_notify_func,
- cam->rcapturefile, NULL, NULL);
+ &cam->rcapturefile, NULL, NULL);
if (!poopoo) {
gchar const* gconf_device = gconf_client_get_string(cam->gc, KEY_DEVICE, NULL);

Privacy Policy