messenger
messenger copied to clipboard
Fix warnings
I already fixed a lot of warnings but I'm not enough experienced to fix the last ones. Maybe you can check that. Help is wanted :smile:
Here is the building trace (if we remove the fixed warnings in #46):
The Meson build system
Version: 0.49.2
Source dir: /home/nathan/Téléchargements/messenger-dev
Build dir: /home/nathan/Téléchargements/messenger-dev/build
Build type: native build
Project name: com.github.aprilis.messenger
Project version: 0.2.3
Native C compiler: cc (gcc 7.4.0 "cc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0")
Native Vala compiler: valac (valac 0.40.15)
Build machine cpu family: x86_64
Build machine cpu: x86_64
|
|Executing subproject libapi
|
|Project name: com.github.aprilis.messenger.api
|Project version: undefined
|Native C compiler: cc (gcc 7.4.0 "cc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0")
|Found pkg-config: /usr/bin/pkg-config (0.29.1)
|Dependency gtk+-3.0 found: YES 3.22.30
|Dependency libsoup-2.4 found: YES 2.62.1
|Dependency json-glib-1.0 found: YES 1.4.2
|Build targets in project: 1
|
|Subproject libapi finished.
Dependency gtk+-3.0 found: YES (cached)
Dependency libsoup-2.4 found: YES (cached)
Dependency json-glib-1.0 found: YES (cached)
Dependency gio-2.0 found: YES 2.56.4
Dependency gee-0.8 found: YES 0.20.1
Dependency webkit2gtk-4.0 found: YES 2.24.2
Dependency granite found: YES 5.2.3
Dependency unity found: YES 7.1.4
Dependency plank found: YES 0.11.4.33-fb62
Dependency libbamf3 found: YES 0.5.4
Dependency libnotify found: YES 0.7.7
Library Fb found: YES
Library posix found: YES
Program meson/post_install.py found: YES (/home/nathan/Téléchargements/messenger-dev/meson/post_install.py)
Build targets in project: 10
Found ninja-1.8.2 at /usr/bin/ninja
nathan@Nathan:~/Téléchargements/messenger-dev$ cd build/
nathan@Nathan:~/Téléchargements/messenger-dev/build$ ninja
[4/45] Compiling C object 'subprojects/libapi/4f43712@@com.github.aprilis.messenger.api@sha/api_mqtt.c.o'.
../subprojects/libapi/api/mqtt.c: In function ‘fb_mqtt_cb_open_error’:
../subprojects/libapi/api/mqtt.c:601:15: warning: unused variable ‘str’ [-Wunused-variable]
const gchar *str;
^~~
../subprojects/libapi/api/mqtt.c: In function ‘fb_mqtt_disconnect’:
../subprojects/libapi/api/mqtt.c:690:17: warning: unused variable ‘msg’ [-Wunused-variable]
FbMqttMessage *msg;
^~~
[5/45] Compiling C object 'subprojects/libapi/4f43712@@com.github.aprilis.messenger.api@sha/api_util.c.o'.
../subprojects/libapi/api/util.c: In function ‘fb_util_vdebug’:
../subprojects/libapi/api/util.c:55:11: warning: variable ‘verbose’ set but not used [-Wunused-but-set-variable]
gboolean verbose;
^~~~~~~
../subprojects/libapi/api/util.c:54:11: warning: variable ‘unsafe’ set but not used [-Wunused-but-set-variable]
gboolean unsafe;
^~~~~~
[6/45] Compiling C object 'subprojects/libapi/4f43712@@com.github.aprilis.messenger.api@sha/api_http.c.o'.
../subprojects/libapi/api/http.c: In function ‘fb_http_urlcmp’:
../subprojects/libapi/api/http.c:388:15: warning: duplicate ‘const’ declaration specifier [-Wduplicate-decl-specifier]
static const const gchar * (*funcs[]) (SoupURI *url) = {
^~~~~
[8/45] Compiling C object 'subprojects/libapi/4f43712@@com.github.aprilis.messenger.api@sha/api_api.c.o'.
../subprojects/libapi/api/api.c: In function ‘fb_api_cb_contacts’:
../subprojects/libapi/api/api.c:2447:11: warning: unused variable ‘count’ [-Wunused-variable]
guint count = 0;
^~~~~
../subprojects/libapi/api/api.c:2440:19: warning: unused variable ‘prms’ [-Wunused-variable]
FbHttpParams *prms;
^~~~
../subprojects/libapi/api/api.c: In function ‘fb_api_thread_get_type’:
../subprojects/libapi/api/api.c:3642:49: warning: passing argument 2 of ‘g_boxed_type_register_static’ from incompatible pointer type [-Wincompatible-pointer-types]
fb_api_thread_dup_deep,
^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/gobject/gobject.h:29:0,
from /usr/include/glib-2.0/gobject/gbinding.h:29,
from /usr/include/glib-2.0/glib-object.h:23,
from /usr/include/json-glib-1.0/json-glib/json-types.h:31,
from /usr/include/json-glib-1.0/json-glib/json-glib.h:29,
from ../subprojects/libapi/api/api.c:22:
/usr/include/glib-2.0/gobject/gboxed.h:95:10: note: expected ‘GBoxedCopyFunc {aka void * (*)(void *)}’ but argument is of type ‘FbApiThread * (*)(const FbApiThread *) {aka struct _FbApiThread * (*)(const struct _FbApiThread *)}’
GType g_boxed_type_register_static (const gchar *name,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/libapi/api/api.c:3643:49: warning: passing argument 3 of ‘g_boxed_type_register_static’ from incompatible pointer type [-Wincompatible-pointer-types]
fb_api_thread_free);
^~~~~~~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/gobject/gobject.h:29:0,
from /usr/include/glib-2.0/gobject/gbinding.h:29,
from /usr/include/glib-2.0/glib-object.h:23,
from /usr/include/json-glib-1.0/json-glib/json-types.h:31,
from /usr/include/json-glib-1.0/json-glib/json-glib.h:29,
from ../subprojects/libapi/api/api.c:22:
/usr/include/glib-2.0/gobject/gboxed.h:95:10: note: expected ‘GBoxedFreeFunc {aka void (*)(void *)}’ but argument is of type ‘void (*)(FbApiThread *) {aka void (*)(struct _FbApiThread *)}’
GType g_boxed_type_register_static (const gchar *name,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/libapi/api/api.c: In function ‘fb_api_user_get_type’:
../subprojects/libapi/api/api.c:3739:49: warning: passing argument 2 of ‘g_boxed_type_register_static’ from incompatible pointer type [-Wincompatible-pointer-types]
fb_api_user_dup_deep,
^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/gobject/gobject.h:29:0,
from /usr/include/glib-2.0/gobject/gbinding.h:29,
from /usr/include/glib-2.0/glib-object.h:23,
from /usr/include/json-glib-1.0/json-glib/json-types.h:31,
from /usr/include/json-glib-1.0/json-glib/json-glib.h:29,
from ../subprojects/libapi/api/api.c:22:
/usr/include/glib-2.0/gobject/gboxed.h:95:10: note: expected ‘GBoxedCopyFunc {aka void * (*)(void *)}’ but argument is of type ‘FbApiUser * (*)(const FbApiUser *) {aka struct _FbApiUser * (*)(const struct _FbApiUser *)}’
GType g_boxed_type_register_static (const gchar *name,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/libapi/api/api.c:3740:49: warning: passing argument 3 of ‘g_boxed_type_register_static’ from incompatible pointer type [-Wincompatible-pointer-types]
fb_api_user_free);
^~~~~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/gobject/gobject.h:29:0,
from /usr/include/glib-2.0/gobject/gbinding.h:29,
from /usr/include/glib-2.0/glib-object.h:23,
from /usr/include/json-glib-1.0/json-glib/json-types.h:31,
from /usr/include/json-glib-1.0/json-glib/json-glib.h:29,
from ../subprojects/libapi/api/api.c:22:
/usr/include/glib-2.0/gobject/gboxed.h:95:10: note: expected ‘GBoxedFreeFunc {aka void (*)(void *)}’ but argument is of type ‘void (*)(FbApiUser *) {aka void (*)(struct _FbApiUser *)}’
GType g_boxed_type_register_static (const gchar *name,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
[12/45] Compiling Vala source ../src/App.vala ../src/Data.vala ...../src/Settings.vala ../src/SettingsWindow.vala ../src/DBus.vala.
unity.vapi:97.4-97.13: warning: [Deprecated] is deprecated. Use [Version (deprecated = true, deprecated_since = "", replacement = "")]
../src/Utils.vala:120.25-120.35: warning: deprecated syntax, don't use `new' to initialize structs
var date1 = new Date ();
^^^^^^^^^^^
../src/Utils.vala:122.25-122.35: warning: deprecated syntax, don't use `new' to initialize structs
var date2 = new Date ();
^^^^^^^^^^^
../src/ThreadsViewer.vala:161.30-161.49: warning: Gtk.TreeView.get_vadjustment has been deprecated since 3.0
../src/Settings.vala:29.31-29.45: warning: deprecated syntax, don't use `new' to initialize structs
var col = new Gdk.RGBA ();
^^^^^^^^^^^^^^^
../src/DBus.vala:11.12-11.99: warning: unhandled error `GLib.IOError'
return Bus.get_proxy_sync (BusType.SYSTEM, "org.freedesktop.login1", "/org/freedesktop/login1");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../src/PopOver.vala:21.19-21.33: warning: Gtk.Widget.get_requisition has been deprecated since 3.0
../src/PopOver.vala:20.5-20.31: warning: Ui.PopOver.get_size hides inherited method `Gtk.Window.get_size'. Use the `new' keyword if hiding was intentional
public Requisition get_size (Gtk.PositionType position) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^
../src/FocusGrabber.vala:56.27-56.52: warning: Gdk.Display.get_device_manager has been deprecated since 3.20.
../src/FocusGrabber.vala:60.48-60.67: warning: Gdk.DeviceManager.list_devices has been deprecated since 3.20
../src/FocusGrabber.vala:66.34-66.44: warning: Gdk.Device.grab has been deprecated since 3.20.
../src/FocusGrabber.vala:38.27-38.52: warning: Gdk.Display.get_device_manager has been deprecated since 3.20.
../src/FocusGrabber.vala:40.48-40.67: warning: Gdk.DeviceManager.list_devices has been deprecated since 3.20
../src/FocusGrabber.vala:46.21-46.33: warning: Gdk.Device.ungrab has been deprecated since 3.20.
../src/PopOver.vala:151.5-151.24: warning: Ui.PopOver.activate hides inherited method `Gtk.Widget.activate'. Use the `new' keyword if hiding was intentional
public void activate () {
^^^^^^^^^^^^^^^^^^^^
../src/PopOver.vala:217.9-217.35: warning: Gdk.Screen.get_monitor_geometry has been deprecated since 3.22
../src/PopOver.vala:217.38-217.64: warning: Gdk.Screen.get_monitor_at_point has been deprecated since 3.22
../src/PopOver.vala:211.5-211.28: warning: Ui.PopOver.set_position hides inherited method `Gtk.Window.set_position'. Use the `new' keyword if hiding was intentional
public void set_position (int x, int y, Gtk.PositionType arrow_pos) {
^^^^^^^^^^^^^^^^^^^^^^^^
../src/Conversation.vala:109.36-109.46: warning: WebKit.NavigationPolicyDecision.request has been deprecated since 2.6
../src/Conversation.vala:110.31-110.41: warning: WebKit.NavigationPolicyDecision.request has been deprecated since 2.6
../src/Conversation.vala:115.61-115.71: warning: WebKit.NavigationPolicyDecision.request has been deprecated since 2.6
../src/Conversation.vala:444.13-444.85: warning: WebKit.CookieManager.delete_cookies_for_domain has been deprecated since 2.16
../src/ApplicationPopOver.vala:20.5-20.31: warning: Ui.ApplicationPopOver.get_size hides inherited method `Gtk.Window.get_size'. Use the `new' keyword if hiding was intentional
public Requisition get_size (Gtk.PositionType position) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^
../src/ApplicationPopOver.vala:235.9-235.35: warning: Gdk.Screen.get_monitor_geometry has been deprecated since 3.22
../src/ApplicationPopOver.vala:235.38-235.64: warning: Gdk.Screen.get_monitor_at_point has been deprecated since 3.22
../src/ApplicationPopOver.vala:225.5-225.28: warning: Ui.ApplicationPopOver.set_position hides inherited method `Gtk.Window.set_position'. Use the `new' keyword if hiding was intentional
public void set_position (int x, int y, Gtk.PositionType arrow_pos) {
^^^^^^^^^^^^^^^^^^^^^^^^
../src/GroupCreator.vala:56.21-56.31: warning: `null' incompatible with return type `Gdk.Pixbuf`
return null;
^^^^^^^^^^^
../src/MainWindowManager.vala:46.26-46.53: warning: Gtk.StyleContext.get_background_color has been deprecated since 3.16
../src/MainWindowManager.vala:86.31-86.45: warning: deprecated syntax, don't use `new' to initialize structs
var col = new Gdk.RGBA ();
^^^^^^^^^^^^^^^
../src/SettingsWindow.vala:119.13-119.30: warning: Gtk.Button.set_focus_on_click has been deprecated since 3.20
../src/App.vala:570.15-570.29: warning: unreachable catch clause detected
} catch (Error e) {
^^^^^^^^^^^^^^^
../src/App.vala:742.15-742.29: warning: unreachable catch clause detected
} catch (Error e) {
^^^^^^^^^^^^^^^
../src/Contact.vala:35.19-35.33: warning: unreachable catch clause detected
} catch (Error e) {
^^^^^^^^^^^^^^^
../src/Main.vala:99.11-99.25: warning: unreachable catch clause detected
} catch (Error e) {
^^^^^^^^^^^^^^^
../src/MainWindowManager.vala:137.23-137.37: warning: unreachable catch clause detected
} catch (Error e) {
^^^^^^^^^^^^^^^
Compilation succeeded - 35 warning(s)
[45/45] Linking target com.github.aprilis.messenger.
I fixed most of them, there are still 19 warnings (mostly deprecation warnings) but currently I have no time for them
Great :smile: Some of your changes made me understand some points ^^ So keep this issue open, you can do that when you have time.