mate-desktop / mate-notification-daemon

Daemon to display passive pop-up notifications
https://mate-desktop.org
GNU General Public License v2.0
30 stars 26 forks source link

Remove conversion warnings #175

Closed rbuj closed 4 years ago

rbuj commented 4 years ago
$ CFLAGS="-Wconversion" ./autogen.sh  --enable-compile-warnings=maximum --prefix=/usr && make &> make.log && sudo make install
$ grep -A 2 conversion make.log
daemon.c:939:24: warning: conversion to ‘gsize’ {aka ‘long unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
  939 |         expected_len = (height - 1) * rowstride + width
      |                        ^
daemon.c:951:37: warning: conversion from ‘gsize’ {aka ‘long unsigned int’} to ‘guint’ {aka ‘unsigned int’} may change value [-Wconversion]
  951 |                                     g_variant_get_size (data_variant));
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
daemon.c:1036:23: warning: conversion from ‘int’ to ‘float’ may change value [-Wconversion]
 1036 |   scale_x = (int) (pw * scale_factor);
      |                       ^
daemon.c:1037:23: warning: conversion from ‘int’ to ‘float’ may change value [-Wconversion]
 1037 |   scale_y = (int) (ph * scale_factor);
      |                       ^
--
daemon.c:1274:4: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
 1274 |  x += width / 2;
      |    ^~
daemon.c:1274:7: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]
 1274 |  x += width / 2;
      |       ^~~~~
daemon.c:1275:4: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
 1275 |  y += height / 2;
      |    ^~
daemon.c:1275:7: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]
 1275 |  y += height / 2;
      |       ^~~~~~
--
/usr/include/glib-2.0/gobject/gsignal.h:491:5: warning: conversion from ‘gulong’ {aka ‘long unsigned int’} to ‘guint’ {aka ‘unsigned int’} may change value [-Wconversion]
  491 |     g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0)
      |     ^~~~~~~~~~~~~~~~~~~~~
--
stack.c:87:3: warning: conversion to ‘long int’ from ‘gulong’ {aka ‘long unsigned int’} may change the sign of the result [-Wsign-conversion]
   87 |   max_len,
      |   ^~~~~~~
stack.c:106:19: warning: conversion from ‘long int’ to ‘int’ may change value [-Wconversion]
  106 |         rect->x = workareas[disp_screen * 4];
      |                   ^~~~~~~~~
stack.c:107:19: warning: conversion from ‘long int’ to ‘int’ may change value [-Wconversion]
  107 |         rect->y = workareas[disp_screen * 4 + 1];
      |                   ^~~~~~~~~
stack.c:108:23: warning: conversion from ‘long int’ to ‘int’ may change value [-Wconversion]
  108 |         rect->width = workareas[disp_screen * 4 + 2];
      |                       ^~~~~~~~~
stack.c:109:24: warning: conversion from ‘long int’ to ‘int’ may change value [-Wconversion]
  109 |         rect->height = workareas[disp_screen * 4 + 3];
      |                        ^~~~~~~~~
--
stack.c:299:18: warning: conversion to ‘int’ from ‘guint’ {aka ‘unsigned int’} may change the sign of the result [-Wsign-conversion]
  299 |         n_wins = g_list_length (stack->windows);
      |                  ^~~~~~~~~~~~~
--
coco-theme.c:106:31: warning: conversion from ‘double’ to ‘float’ changes value from ‘9.0000000000000002e-1’ to ‘8.99999976e-1f’ [-Wfloat-conversion]
  106 | #define BACKGROUND_OPACITY    0.90
      |                               ^~~~
--
coco-theme.c:510:27: warning: conversion from ‘size_t’ {aka ‘long unsigned int’} to ‘int’ may change value [-Wconversion]
  510 |  doc = xmlReadMemory(str, strlen (str), "noname.xml", NULL, 0);
      |                           ^~~~~~~~~~~~
--
nodoka-theme.c:325:15: warning: conversion from ‘double’ to ‘int’ may change value [-Wfloat-conversion]
  325 |  rect.width = w;
      |               ^
nodoka-theme.c:330:16: warning: conversion from ‘double’ to ‘int’ may change value [-Wfloat-conversion]
  330 |  rect.height = h - DEFAULT_ARROW_HEIGHT;
      |                ^
--
nodoka-theme.c:123:31: warning: conversion from ‘double’ to ‘float’ changes value from ‘9.2000000000000004e-1’ to ‘9.20000017e-1f’ [-Wfloat-conversion]
  123 | #define BACKGROUND_OPACITY    0.92
      |                               ^~~~
--
nodoka-theme.c:123:31: warning: conversion from ‘double’ to ‘float’ changes value from ‘9.2000000000000004e-1’ to ‘9.20000017e-1f’ [-Wfloat-conversion]
  123 | #define BACKGROUND_OPACITY    0.92
      |                               ^~~~
--
nodoka-theme.c:417:12: warning: conversion from ‘double’ to ‘float’ may change value [-Wfloat-conversion]
  417 |    alpha = alpha * 0.5;
      |            ^~~~~
--
nodoka-theme.c:123:31: warning: conversion from ‘double’ to ‘float’ changes value from ‘9.2000000000000004e-1’ to ‘9.20000017e-1f’ [-Wfloat-conversion]
  123 | #define BACKGROUND_OPACITY    0.92
      |                               ^~~~
--
nodoka-theme.c:895:27: warning: conversion from ‘size_t’ {aka ‘long unsigned int’} to ‘int’ may change value [-Wconversion]
  895 |  doc = xmlReadMemory(str, strlen (str), "noname.xml", NULL, 0);
      |                           ^~~~~~~~~~~~
--
theme.c:519:27: warning: conversion from ‘size_t’ {aka ‘long unsigned int’} to ‘int’ may change value [-Wconversion]
  519 |  doc = xmlReadMemory(str, strlen (str), "noname.xml", NULL, 0);
      |                           ^~~~~~~~~~~~
--
theme.c:616:23: warning: conversion from ‘int’ to ‘float’ may change value [-Wconversion]
  616 |   scale_x = (int) (pw * scale_factor);
      |                       ^
theme.c:617:23: warning: conversion from ‘int’ to ‘float’ may change value [-Wconversion]
  617 |   scale_y = (int) (ph * scale_factor);
      |                       ^
--
theme.c:867:27: warning: conversion from ‘size_t’ {aka ‘long unsigned int’} to ‘int’ may change value [-Wconversion]
  867 |  doc = xmlReadMemory(str, strlen (str), "noname.xml", NULL, 0);
      |                           ^~~~~~~~~~~~
raveit65 commented 4 years ago

Confirmed that it fixes the warnings. Now i will test it a bit.

raveit65 commented 4 years ago

I see no problems with running the daemon with different themes several days, so merging it.