mate-desktop / mate-settings-daemon

MATE settings daemon
https://mate-desktop.org
GNU General Public License v2.0
43 stars 48 forks source link

mate-settings-daemon: Remove -Wconversion -Wsign-conversion -Wcast-function-type warnings #349

Closed rbuj closed 3 years ago

rbuj commented 3 years ago

-Wconversion 3 -Wsign-conversion 4

mate-settings-plugin-info.c:248:40: warning: conversion to ‘guint’ {aka ‘unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
  248 |                 info->priv->priority = priority;
      |                                        ^~~~~~~~
--
/usr/include/glib-2.0/glib/gmacros.h:808:14: warning: conversion from ‘int’ to ‘signed char:1’ changes value from ‘1’ to ‘-1’ [-Wconversion]
  808 | #define TRUE (!FALSE)
      |              ^
--
/usr/include/glib-2.0/glib/gmacros.h:808:14: warning: conversion from ‘int’ to ‘signed char:1’ changes value from ‘1’ to ‘-1’ [-Wconversion]
  808 | #define TRUE (!FALSE)
      |              ^
--
mate-settings-plugin-info.c:497:26: warning: conversion to ‘int’ from ‘guint’ {aka ‘unsigned int’} may change the sign of the result [-Wsign-conversion]
  497 |         return info->priv->priority;
      |                ~~~~~~~~~~^~~~~~~~~~
--
mate-settings-plugin-info.c:506:32: warning: conversion to ‘guint’ {aka ‘unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
  506 |         info->priv->priority = priority;
      |                                ^~~~~~~~
--
mate-settings-plugin-info.c:518:24: warning: conversion from ‘gboolean’ {aka ‘int’} to ‘signed char:1’ may change value [-Wconversion]
  518 |  info->priv->enabled = g_settings_get_boolean (info->priv->settings, "active");
      |                        ^~~~~~~~~~~~~~~~~~~~~~
mate-settings-plugin-info.c:522:26: warning: conversion to ‘guint’ {aka ‘unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
  522 |   info->priv->priority = priority;
      |                          ^~~~~~~~

-Wcast-function-type 1

main.c:550:44: warning: cast between incompatible function types from ‘gboolean (*)(void)’ {aka ‘int (*)(void)’} to ‘gboolean (*)(void *)’ {aka ‘int (*)(void *)’} [-Wcast-function-type]
  550 |                 g_timeout_add_seconds (30, (GSourceFunc) timed_exit_cb, NULL);
      |                                            ^

bump glib required version

G_SOURCE_FUNC since glib 2.58

raveit65 commented 3 years ago

Build warnings are gone. Now i am starting testing.