diff options
author | rbuj <[email protected]> | 2020-05-06 21:23:19 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2020-06-12 13:18:07 +0200 |
commit | 4a4c2d5ac322d61e789a7d732e2ac25951984c3f (patch) | |
tree | 0950cb43e05f5ffb4c21b066a7921045eb63a6af /src/daemon | |
parent | 1092c4c309e12e039c19ff815bb725f1802afb6c (diff) | |
download | mate-notification-daemon-4a4c2d5ac322d61e789a7d732e2ac25951984c3f.tar.bz2 mate-notification-daemon-4a4c2d5ac322d61e789a7d732e2ac25951984c3f.tar.xz |
Remove conversion warnings
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/daemon.c | 47 | ||||
-rw-r--r-- | src/daemon/engines.c | 2 | ||||
-rw-r--r-- | src/daemon/stack.c | 14 |
3 files changed, 32 insertions, 31 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c index 441e75f..8711864 100644 --- a/src/daemon/daemon.c +++ b/src/daemon/daemon.c @@ -96,7 +96,7 @@ typedef struct { typedef struct { NotifyStack** stacks; - int n_stacks; + gsize n_stacks; Atom workarea_atom; } NotifyScreen; @@ -309,27 +309,27 @@ static void on_screen_monitors_changed(GdkScreen* screen, NotifyDaemon* daemon) n_monitors = gdk_display_get_n_monitors(display); - if (n_monitors > nscreen->n_stacks) + if (n_monitors > (int) nscreen->n_stacks) { /* grow */ - nscreen->stacks = g_renew(NotifyStack *, nscreen->stacks, n_monitors); + nscreen->stacks = g_renew(NotifyStack *, nscreen->stacks, (gsize) n_monitors); /* add more stacks */ - for (i = nscreen->n_stacks; i < n_monitors; i++) + for (i = (int) nscreen->n_stacks; i < n_monitors; i++) { create_stack_for_monitor(daemon, screen, gdk_display_get_monitor (display, i)); } - nscreen->n_stacks = n_monitors; + nscreen->n_stacks = (gsize) n_monitors; } - else if (n_monitors < nscreen->n_stacks) + else if (n_monitors < (int) nscreen->n_stacks) { NotifyStack* last_stack; last_stack = nscreen->stacks[n_monitors - 1]; /* transfer items before removing stacks */ - for (i = n_monitors; i < nscreen->n_stacks; i++) + for (i = n_monitors; i < (int) nscreen->n_stacks; i++) { NotifyStack* stack = nscreen->stacks[i]; GList* windows = g_list_copy(notify_stack_get_windows(stack)); @@ -349,8 +349,8 @@ static void on_screen_monitors_changed(GdkScreen* screen, NotifyDaemon* daemon) } /* remove the extra stacks */ - nscreen->stacks = g_renew(NotifyStack*, nscreen->stacks, n_monitors); - nscreen->n_stacks = n_monitors; + nscreen->stacks = g_renew(NotifyStack*, nscreen->stacks, (gsize) n_monitors); + nscreen->n_stacks = (gsize) n_monitors; } } @@ -358,12 +358,13 @@ static void create_stacks_for_screen(NotifyDaemon* daemon, GdkScreen *screen) { GdkDisplay *display; NotifyScreen* nscreen; - int i; + int i, n_monitors; nscreen = daemon->screen; display = gdk_screen_get_display (screen); + n_monitors = gdk_display_get_n_monitors(display); - nscreen->n_stacks = gdk_display_get_n_monitors(display); + nscreen->n_stacks = (gsize) n_monitors; nscreen->stacks = g_renew(NotifyStack*, nscreen->stacks, nscreen->n_stacks); @@ -924,6 +925,7 @@ static GdkPixbuf * _notify_daemon_pixbuf_from_data_hint (GVariant *icon_data) GVariant *data_variant; gsize expected_len; guchar *data; + gsize data_size; GdkPixbuf *pixbuf; g_variant_get (icon_data, @@ -936,8 +938,7 @@ static GdkPixbuf * _notify_daemon_pixbuf_from_data_hint (GVariant *icon_data) &n_channels, &data_variant); - expected_len = (height - 1) * rowstride + width - * ((n_channels * bits_per_sample + 7) / 8); + expected_len = (gsize) ((height - 1) * rowstride + width * ((n_channels * bits_per_sample + 7) / 8)); if (expected_len != g_variant_get_size (data_variant)) { g_warning ("Expected image data to be of length %" G_GSIZE_FORMAT @@ -947,8 +948,8 @@ static GdkPixbuf * _notify_daemon_pixbuf_from_data_hint (GVariant *icon_data) return NULL; } - data = (guchar *) g_memdup (g_variant_get_data (data_variant), - g_variant_get_size (data_variant)); + data_size = g_variant_get_size (data_variant); + data = (guchar *) g_memdup (g_variant_get_data (data_variant), (guint) data_size); pixbuf = gdk_pixbuf_new_from_data (data, GDK_COLORSPACE_RGB, @@ -1033,12 +1034,12 @@ static GdkPixbuf* _notify_daemon_scale_pixbuf(GdkPixbuf *pixbuf, gboolean no_str int scale_x; int scale_y; - scale_x = (int) (pw * scale_factor); - scale_y = (int) (ph * scale_factor); + scale_x = (int) (((float) pw) * scale_factor); + scale_y = (int) (((float) ph) * scale_factor); return gdk_pixbuf_scale_simple (pixbuf, - scale_x, - scale_y, - GDK_INTERP_BILINEAR); + scale_x, + scale_y, + GDK_INTERP_BILINEAR); } else { @@ -1271,8 +1272,8 @@ static void sync_notification_position(NotifyDaemon* daemon, GtkWindow* nw, Wind return; } - x += width / 2; - y += height / 2; + x += (int)width / 2; + y += (int)height / 2; theme_set_notification_arrow (nw, TRUE, x, y); theme_move_notification (nw, x, y); @@ -1534,7 +1535,7 @@ static gboolean notify_daemon_notify_handler(NotifyDaemonNotifications *object, { /* screw it - dump it on the last one we'll get a monitors-changed signal soon enough*/ - monitor_id = gdk_display_get_monitor (gdk_display_get_default(), daemon->screen->n_stacks - 1); + monitor_id = gdk_display_get_monitor (gdk_display_get_default(), (int) daemon->screen->n_stacks - 1); } notify_stack_add_window (daemon->screen->stacks[_gtk_get_monitor_num (monitor_id)], nw, new_notification); diff --git a/src/daemon/engines.c b/src/daemon/engines.c index dc71bf1..db50e8b 100644 --- a/src/daemon/engines.c +++ b/src/daemon/engines.c @@ -50,7 +50,7 @@ typedef struct { } ThemeEngine; -static guint theme_prop_notify_id = 0; +static gulong theme_prop_notify_id = 0; static ThemeEngine* active_engine = NULL; static ThemeEngine* load_theme_engine(const char *name) diff --git a/src/daemon/stack.c b/src/daemon/stack.c index d1a02db..4faa588 100644 --- a/src/daemon/stack.c +++ b/src/daemon/stack.c @@ -57,7 +57,7 @@ get_work_area (NotifyStack *stack, int format; gulong num; gulong leftovers; - gulong max_len = 4 * 32; + long max_len = 4 * 32; guchar *ret_workarea; long *workareas; int result; @@ -103,10 +103,10 @@ get_work_area (NotifyStack *stack, } workareas = (long *) ret_workarea; - rect->x = workareas[disp_screen * 4]; - rect->y = workareas[disp_screen * 4 + 1]; - rect->width = workareas[disp_screen * 4 + 2]; - rect->height = workareas[disp_screen * 4 + 3]; + rect->x = (int) workareas[disp_screen * 4]; + rect->y = (int) workareas[disp_screen * 4 + 1]; + rect->width = (int) workareas[disp_screen * 4 + 2]; + rect->height = (int) workareas[disp_screen * 4 + 3]; XFree (ret_workarea); @@ -287,8 +287,8 @@ notify_stack_shift_notifications (NotifyStack *stack, gint x, y; gint shiftx = 0; gint shifty = 0; - int i; - int n_wins; + guint i; + guint n_wins; get_work_area (stack, &workarea); gdk_monitor_get_geometry (stack->monitor, &monitor); |