From 5424403d78bac96ff1a8aa57eefdf9b25f5b7569 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Apr 2021 00:10:33 +0200 Subject: TRAVIS: Initial attempt to get TRAVIS CI working for this project. --- .build.yml | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 17 +++++++--- 2 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 .build.yml diff --git a/.build.yml b/.build.yml new file mode 100644 index 0000000..4c02846 --- /dev/null +++ b/.build.yml @@ -0,0 +1,103 @@ +########################################################## +# THE FOLLOWING LINES IS USED BY docker-build +########################################################## +requires: + archlinux: + - autoconf-archive + - clang + - gcc + - git + - make + - startup-notification + - which + - pacman + - gtk3 + - glib2 + - ayatana-ido + - mate-common + + debian: + # Useful URL: https://salsa.debian.org/debian-ayatana-team/libayatana-indicator + - autopoint + - clang + - clang-tools + - cppcheck + - git + - at-spi2-core + - libtool + - intltool + - mate-common + - gtk-doc-tools + - dbus-test-runner + - xvfb + - libglib2.0-dev + - libgtk2.0-dev + - libgtk-3-dev + - libayatana-ido3-dev + - systemd + + ubuntu: + - autopoint + - clang + - clang-tools + - git + - at-spi2-core + - libtool + - intltool + - mate-common + - gtk-doc-tools + - dbus-test-runner + - xvfb + - libglib2.0-dev + - libgtk2.0-dev + - libgtk-3-dev + - libayatana-ido3-dev + - systemd + +variables: + - 'CHECKERS=" + -enable-checker deadcode.DeadStores + -enable-checker alpha.deadcode.UnreachableCode + -enable-checker alpha.core.CastSize + -enable-checker alpha.core.CastToStruct + -enable-checker alpha.core.IdenticalExpr + -enable-checker alpha.core.SizeofPtr + -enable-checker alpha.security.ArrayBoundV2 + -enable-checker alpha.security.MallocOverflow + -enable-checker alpha.security.ReturnPtrRange + -enable-checker alpha.unix.SimpleStream + -enable-checker alpha.unix.cstring.BufferOverlap + -enable-checker alpha.unix.cstring.NotNullTerminated + -enable-checker alpha.unix.cstring.OutOfBounds + -enable-checker alpha.core.FixedAddr + -enable-checker security.insecureAPI.strcpy"' + +build_scripts: + - if [ ${DISTRO_NAME} == "debian" ];then + - export CFLAGS+=" -Wsign-compare -Wunused-parameter" + - cppcheck --enable=warning,style,performance,portability,information,missingInclude . + - fi + + - NOCONFIGURE=1 ./autogen.sh + - scan-build $CHECKERS ./configure --prefix=/usr --enable-gtk-doc --enable-compile-warnings=maximum + - if [ $CPU_COUNT -gt 1 ]; then + - if [ ${DISTRO_NAME} == "debian" ];then + - scan-build $CHECKERS --keep-cc --use-cc=clang --use-c++=clang++ -o html-report make -j $CPU_COUNT + - make clean + - fi + - scan-build $CHECKERS --keep-cc -o html-report make -j $CPU_COUNT + - else + - if [ ${DISTRO_NAME} == "debian" ];then + - scan-build $CHECKERS --keep-cc --use-cc=clang --use-c++=clang++ -o html-report make + - make clean + - fi + - scan-build $CHECKERS --keep-cc -o html-report make + - fi + +after_scripts: + - if [ ${BUILD_TYPE} == "scripts" ];then + - if [ ${DISTRO_NAME} == "debian" ];then + - make check + - fi + - make distcheck + - fi diff --git a/.travis.yml b/.travis.yml index 611869f..302fd18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,11 @@ dist: bionic language: shell os: linux + +arch: + - amd64 + - ppc64le + services: - docker @@ -12,11 +17,9 @@ addons: - python3-setuptools before_install: - # let's use the MATE project's docker build scripts... + # let's use the MATE project's docker build script... - curl -Ls -o docker-build https://github.com/mate-desktop/mate-dev-scripts/raw/master/travis/docker-build - - curl -Ls -o gen-index https://github.com/mate-desktop/mate-dev-scripts/raw/master/travis/gen-index.sh - - sed -i gen-index -e "s/mate-desktop/ayatana-indicators/g" - - chmod +x docker-build gen-index + - chmod +x docker-build install: - pip3 install PyGithub @@ -28,5 +31,9 @@ script: env: - DISTRO="archlinux:latest" - DISTRO="debian:testing" -# - DISTRO="fedora:latest" - DISTRO="ubuntu:rolling" + +jobs: + exclude: + - env: DISTRO="archlinux:latest" + arch: ppc64le -- cgit v1.2.3 From e86d11e1868708606ae52ba8026bfe2703e33059 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Apr 2021 07:59:43 +0200 Subject: Travis-CI: temporarily disable archlinux:latest CI builds. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 302fd18..bd38a97 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,8 @@ script: - ./docker-build --name ${DISTRO} --verbose --config .build.yml --build scripts --build autotools env: - - DISTRO="archlinux:latest" +# temp disable of archlinux builds, see https://gitlab.archlinux.org/archlinux/archlinux-docker/-/issues/56 +# - DISTRO="archlinux:latest" - DISTRO="debian:testing" - DISTRO="ubuntu:rolling" -- cgit v1.2.3 From 4880df3e3213d8ebe3bcd9a6e4485c5099666efc Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Apr 2021 08:00:29 +0200 Subject: Travis-CI: Also build against Ubuntu 20.04 (for Ubuntu Touch's sake). --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index bd38a97..b9847ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,7 @@ env: # - DISTRO="archlinux:latest" - DISTRO="debian:testing" - DISTRO="ubuntu:rolling" + - DISTRO="ubuntu:focal" jobs: exclude: -- cgit v1.2.3 From 7e70eb74a33bf6355179511fee21131b9ad75d9e Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Apr 2021 08:13:09 +0200 Subject: libayatana-indicator/indicator-desktop-shortcuts.c: Avoid comparison of integers of different signs. Thanks to scan-build on Travis-CI. --- libayatana-indicator/indicator-desktop-shortcuts.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libayatana-indicator/indicator-desktop-shortcuts.c b/libayatana-indicator/indicator-desktop-shortcuts.c index bbac612..be1d632 100644 --- a/libayatana-indicator/indicator-desktop-shortcuts.c +++ b/libayatana-indicator/indicator-desktop-shortcuts.c @@ -148,7 +148,7 @@ indicator_desktop_shortcuts_finalize (GObject *object) } if (priv->nicks != NULL) { - gint i; + guint i; for (i = 0; i < priv->nicks->len; i++) { gchar * nick = g_array_index(priv->nicks, gchar *, i); g_free(nick); @@ -307,7 +307,7 @@ parse_keyfile (IndicatorDesktopShortcuts * ids) } /* Okay, we've got everything we need. Let's get it on! */ - gint i; + gsize i; gsize num_nicks = 0; gchar ** nicks = g_key_file_get_string_list(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, list_name, &num_nicks, NULL); @@ -352,7 +352,7 @@ should_show (GKeyFile * keyfile, const gchar * group, const gchar * identity, gb if (should_have_target && g_key_file_has_key(keyfile, group, OLD_ENVIRON_KEY, NULL)) { /* If we've got this key, we're going to return here and not process the deprecated keys. */ - gint j; + gsize j; gsize num_env = 0; gchar ** envs = g_key_file_get_string_list(keyfile, group, OLD_ENVIRON_KEY, &num_env, NULL); @@ -375,7 +375,7 @@ should_show (GKeyFile * keyfile, const gchar * group, const gchar * identity, gb /* If there is a list of OnlyShowIn entries we need to check to see if we're in that list. If not, we drop this nick */ if (g_key_file_has_key(keyfile, group, G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN, NULL)) { - gint j; + gsize j; gsize num_only = 0; gchar ** onlies = g_key_file_get_string_list(keyfile, group, G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN, &num_only, NULL); @@ -397,7 +397,7 @@ should_show (GKeyFile * keyfile, const gchar * group, const gchar * identity, gb /* If there is a NotShowIn entry we need to make sure that we're not in that list. If we are, we need to drop out. */ if (g_key_file_has_key(keyfile, group, G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN, NULL)) { - gint j; + gsize j; gsize num_not = 0; gchar ** nots = g_key_file_get_string_list(keyfile, group, G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN, &num_not, NULL); -- cgit v1.2.3 From b829a57b5af8ebf4f72b6bcd54a1dd616504f34b Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Apr 2021 13:44:37 +0200 Subject: libayatana-indicator/indicator-image-helper.c: Silence unused parameter warnings/errors for callback functions. --- libayatana-indicator/indicator-image-helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libayatana-indicator/indicator-image-helper.c b/libayatana-indicator/indicator-image-helper.c index 27c332f..2c0e244 100644 --- a/libayatana-indicator/indicator-image-helper.c +++ b/libayatana-indicator/indicator-image-helper.c @@ -136,7 +136,7 @@ refresh_image (GtkImage * image) /* Handles the theme changed signal to refresh the icon to make sure that it changes appropriately */ static void -theme_changed_cb (GtkIconTheme * theme, gpointer user_data) +theme_changed_cb (__attribute__((unused)) GtkIconTheme * theme, gpointer user_data) { GtkImage * image = GTK_IMAGE(user_data); refresh_image(image); @@ -146,7 +146,7 @@ theme_changed_cb (GtkIconTheme * theme, gpointer user_data) /* Removes the signal on the theme that was calling update on this image. */ static void -image_destroyed_cb (GtkImage * image, gpointer user_data) +image_destroyed_cb (GtkImage * image, __attribute__((unused)) gpointer user_data) { g_signal_handlers_disconnect_by_func(gtk_icon_theme_get_default(), theme_changed_cb, image); return; @@ -155,7 +155,7 @@ image_destroyed_cb (GtkImage * image, gpointer user_data) /* Catch the style changing on the image to make sure we've got the latest. */ static void -image_style_change_cb (GtkImage * image, GtkStyle * previous_style, gpointer user_data) +image_style_change_cb (GtkImage * image, __attribute__((unused)) GtkStyle * previous_style, __attribute__((unused)) gpointer user_data) { refresh_image(image); return; -- cgit v1.2.3 From 995b2cd69158a54d3868bcc1e9bab0883dfbf7a7 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Apr 2021 21:41:50 +0200 Subject: libayatana-indicator/indicator-service.c: Silence unused parameter warnings/errors for callback functions. --- libayatana-indicator/indicator-service.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libayatana-indicator/indicator-service.c b/libayatana-indicator/indicator-service.c index 9caa347..6a281e3 100644 --- a/libayatana-indicator/indicator-service.c +++ b/libayatana-indicator/indicator-service.c @@ -345,7 +345,7 @@ get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspe /* Callback for getting our connection to DBus */ static void -bus_get_cb (GObject * object, GAsyncResult * res, gpointer user_data) +bus_get_cb (__attribute__((unused)) GObject * object, GAsyncResult * res, gpointer user_data) { GError * error = NULL; GDBusConnection * connection = g_bus_get_finish(res, &error); @@ -387,7 +387,7 @@ bus_get_cb (GObject * object, GAsyncResult * res, gpointer user_data) /* A method has been called from our dbus inteface. Figure out what it is and dispatch it. */ static void -bus_method_call (GDBusConnection * connection, const gchar * sender, const gchar * path, const gchar * interface, const gchar * method, GVariant * params, GDBusMethodInvocation * invocation, gpointer user_data) +bus_method_call (__attribute__((unused)) GDBusConnection * connection, const gchar * sender, __attribute__((unused)) const gchar * path, __attribute__((unused)) const gchar * interface, const gchar * method, __attribute__((unused)) GVariant * params, GDBusMethodInvocation * invocation, gpointer user_data) { IndicatorService * service = INDICATOR_SERVICE(user_data); GVariant * retval = NULL; @@ -434,7 +434,7 @@ timeout_no_watchers (gpointer data) found and we've got it. Now start the timer to see if anyone cares about us. */ static void -try_and_get_name_acquired_cb (GDBusConnection * connection, const gchar * name, gpointer user_data) +try_and_get_name_acquired_cb (GDBusConnection * connection, __attribute__((unused)) const gchar * name, gpointer user_data) { g_return_if_fail(connection != NULL); g_return_if_fail(INDICATOR_IS_SERVICE(user_data)); @@ -516,7 +516,7 @@ try_and_get_name (IndicatorService * service) /* When the watcher vanishes we don't really care about it anymore. */ static void -watcher_vanished_cb (GDBusConnection * connection, const gchar * name, gpointer user_data) +watcher_vanished_cb (__attribute__((unused)) GDBusConnection * connection, const gchar * name, gpointer user_data) { g_return_if_fail(INDICATOR_IS_SERVICE(user_data)); IndicatorServicePrivate * priv = indicator_service_get_instance_private(user_data); -- cgit v1.2.3 From cc7f8ce9b9720e0b615f6eee22e807c3ad1d6c6c Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Apr 2021 21:42:52 +0200 Subject: libayatana-indicator/indicator-service.c: Avoid error: use of GNU old-style field designator extension. --- libayatana-indicator/indicator-service.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libayatana-indicator/indicator-service.c b/libayatana-indicator/indicator-service.c index 6a281e3..06d5a0e 100644 --- a/libayatana-indicator/indicator-service.c +++ b/libayatana-indicator/indicator-service.c @@ -102,9 +102,9 @@ static void bus_method_call (GDBusConnection * connection, const gchar * sender, static GDBusNodeInfo * node_info = NULL; static GDBusInterfaceInfo * interface_info = NULL; static GDBusInterfaceVTable interface_table = { - method_call: bus_method_call, - get_property: NULL, /* No properties */ - set_property: NULL /* No properties */ + .method_call = bus_method_call, + .get_property = NULL, /* No properties */ + .set_property = NULL /* No properties */ }; /* THE define */ -- cgit v1.2.3 From 432174bd3f5ff971d285391330d0e7c839d073ae Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Apr 2021 22:02:11 +0200 Subject: libayatana-indicator/indicator-service-manager.c: Silence unused parameter warnings/errors for various functions. --- libayatana-indicator/indicator-service-manager.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libayatana-indicator/indicator-service-manager.c b/libayatana-indicator/indicator-service-manager.c index e1772fa..049d176 100644 --- a/libayatana-indicator/indicator-service-manager.c +++ b/libayatana-indicator/indicator-service-manager.c @@ -450,7 +450,7 @@ start_service (IndicatorServiceManager * service) could include starting the service. Sometime it'll fail and we'll try to start that dang service again! */ static void -service_proxy_cb (GObject * object, GAsyncResult * res, gpointer user_data) +service_proxy_cb (__attribute__((unused)) GObject * object, GAsyncResult * res, gpointer user_data) { GError * error = NULL; @@ -524,9 +524,12 @@ service_proxy_cb (GObject * object, GAsyncResult * res, gpointer user_data) usually means the service died. We're dropping the proxy and recreating it so that it'll restart the service. */ static void -service_proxy_name_changed (GDBusConnection * connection, const gchar * sender_name, - const gchar * object_path, const gchar * interface_name, - const gchar * signal_name, GVariant * parameters, +service_proxy_name_changed (__attribute__((unused)) GDBusConnection * connection, + __attribute__((unused)) const gchar * sender_name, + __attribute__((unused)) const gchar * object_path, + __attribute__((unused)) const gchar * interface_name, + __attribute__((unused)) const gchar * signal_name, + GVariant * parameters, gpointer user_data) { @@ -695,7 +698,7 @@ indicator_service_manager_connected (IndicatorServiceManager * sm) NOTE: Not yet implemented. */ void -indicator_service_manager_set_refresh (IndicatorServiceManager * sm, guint time_in_ms) +indicator_service_manager_set_refresh (__attribute__((unused)) IndicatorServiceManager * sm, __attribute__((unused)) guint time_in_ms) { return; -- cgit v1.2.3 From ad0e92274dc2623e68ecc0416f6d55478661f5f5 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Apr 2021 22:02:39 +0200 Subject: libayatana-indicator/indicator-ng.c: Silence unused parameter warnings/errors for various functions. --- libayatana-indicator/indicator-ng.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/libayatana-indicator/indicator-ng.c b/libayatana-indicator/indicator-ng.c index f4db2e6..d39a073 100644 --- a/libayatana-indicator/indicator-ng.c +++ b/libayatana-indicator/indicator-ng.c @@ -199,7 +199,7 @@ indicator_ng_get_position (IndicatorObject *io) static void indicator_ng_entry_scrolled (IndicatorObject *io, - IndicatorObjectEntry *entry, + __attribute__((unused)) IndicatorObjectEntry *entry, gint delta, IndicatorScrollDirection direction) { @@ -220,9 +220,9 @@ indicator_ng_entry_scrolled (IndicatorObject *io, void indicator_ng_secondary_activate (IndicatorObject *io, - IndicatorObjectEntry *entry, - guint timestamp, - gpointer user_data) + __attribute__((unused)) IndicatorObjectEntry *entry, + __attribute__((unused)) guint timestamp, + __attribute__((unused)) gpointer user_data) { IndicatorNg *self = INDICATOR_NG (io); @@ -284,7 +284,7 @@ static gboolean indicator_ng_menu_insert_idos(IndicatorNg *self, GMenuModel *pSe return bChanged; } -static void indicator_ng_menu_size_allocate(GtkWidget *pWidget, GtkAllocation *pAllocation, gpointer pUserData) +static void indicator_ng_menu_size_allocate(__attribute__((unused)) GtkWidget *pWidget, __attribute__((unused)) GtkAllocation *pAllocation, gpointer pUserData) { IndicatorNg *self = pUserData; GList *pMenuItem = gtk_container_get_children(GTK_CONTAINER(self->entry.menu)); @@ -340,7 +340,7 @@ static void indicator_ng_menu_size_allocate(GtkWidget *pWidget, GtkAllocation *p gtk_menu_reposition(self->entry.menu); } -static void indicator_ng_menu_section_changed(GMenuModel *pMenuSection, gint nPosition, gint nRemoved, gint nAdded, gpointer pUserData) +static void indicator_ng_menu_section_changed(__attribute__((unused)) GMenuModel *pMenuSection, __attribute__((unused)) gint nPosition, __attribute__((unused)) gint nRemoved, __attribute__((unused)) gint nAdded, gpointer pUserData) { IndicatorNg *self = pUserData; GMenuModel *pModel = g_menu_model_get_item_link(self->menu, 0, G_MENU_LINK_SUBMENU); @@ -421,7 +421,7 @@ static void indicator_ng_menu_section_changed(GMenuModel *pMenuSection, gint nPo } } -static void indicator_ng_menu_shown(GtkWidget *pWidget, gpointer pUserData) +static void indicator_ng_menu_shown(__attribute__((unused)) GtkWidget *pWidget, gpointer pUserData) { IndicatorNg *self = pUserData; guint nSectionCount = 0; @@ -468,7 +468,7 @@ static void indicator_ng_menu_shown(GtkWidget *pWidget, gpointer pUserData) } static void -indicator_ng_menu_hidden (GtkWidget *widget, +indicator_ng_menu_hidden (__attribute__((unused)) GtkWidget *widget, gpointer user_data) { IndicatorNg *self = user_data; @@ -627,7 +627,7 @@ indicator_ng_menu_item_is_of_type (GMenuModel *menu, } static void -indicator_ng_menu_changed (GMenuModel *menu, +indicator_ng_menu_changed (__attribute__((unused)) GMenuModel *menu, gint position, gint removed, gint added, @@ -708,7 +708,7 @@ indicator_ng_menu_changed (GMenuModel *menu, static void indicator_ng_service_appeared (GDBusConnection *connection, - const gchar *name, + __attribute__((unused)) const gchar *name, const gchar *name_owner, gpointer user_data) { @@ -775,8 +775,8 @@ indicator_ng_service_started (GObject *source_object, } static void -indicator_ng_service_vanished (GDBusConnection *connection, - const gchar *name, +indicator_ng_service_vanished (__attribute__((unused)) GDBusConnection *connection, + __attribute__((unused)) const gchar *name, gpointer user_data) { IndicatorNg *self = user_data; @@ -877,7 +877,7 @@ indicator_ng_load_from_keyfile (IndicatorNg *self, static gboolean indicator_ng_initable_init (GInitable *initable, - GCancellable *cancellable, + __attribute__((unused)) GCancellable *cancellable, GError **error) { IndicatorNg *self = INDICATOR_NG (initable); -- cgit v1.2.3 From ade4d68c4573b0e2686a012055dff3cc1186c408 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Apr 2021 22:03:31 +0200 Subject: libayatana-indicator/indicator-ng.c: Stricter type usage when comparing Integer like variable. --- libayatana-indicator/indicator-ng.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libayatana-indicator/indicator-ng.c b/libayatana-indicator/indicator-ng.c index d39a073..f057600 100644 --- a/libayatana-indicator/indicator-ng.c +++ b/libayatana-indicator/indicator-ng.c @@ -303,7 +303,7 @@ static void indicator_ng_menu_size_allocate(__attribute__((unused)) GtkWidget *p gint nHeightNat; gtk_widget_get_preferred_width(pMenuItem->data, NULL, &nWidthNat); gtk_widget_get_preferred_height(pMenuItem->data, NULL, &nHeightNat); - nWidth = MAX(nWidth, nWidthNat); + nWidth = MAX((gint)nWidth, nWidthNat); nHeight += nHeightNat; GtkBorder cPadding; GtkStyleContext *pContext = gtk_widget_get_style_context(GTK_WIDGET(pMenuItem->data)); @@ -327,12 +327,12 @@ static void indicator_ng_menu_size_allocate(__attribute__((unused)) GtkWidget *p GdkMonitor *pMonitor = gdk_display_get_primary_monitor(pDisplay); gdk_monitor_get_workarea(pMonitor, &cRectangle); - if (nHeight <= cRectangle.height) + if ((gint)nHeight <= cRectangle.height) { gdk_window_move_resize(pWindowBin, 0, 0, nWidth, nHeight); } - nHeight = MIN(nHeight, cRectangle.height); + nHeight = MIN((gint)nHeight, cRectangle.height); GdkWindow *pWindow = gtk_widget_get_parent_window(GTK_WIDGET(self->entry.menu)); gdk_window_resize(pWindow, nWidth, nHeight); @@ -434,7 +434,7 @@ static void indicator_ng_menu_shown(__attribute__((unused)) GtkWidget *pWidget, { guint nSections = g_menu_model_get_n_items(self->lMenuSections[0]); - for (gint nSection = 0; nSection < nSections; nSection++) + for (guint nSection = 0; nSection < nSections; nSection++) { self->lMenuSections[++nSectionCount] = g_menu_model_get_item_link(self->lMenuSections[0], nSection, G_MENU_LINK_SECTION); -- cgit v1.2.3 From 83380695633e0b9dc79ce8eefd3c0e97ff5503c8 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Apr 2021 22:15:43 +0200 Subject: libayatana-indicator/indicator-service{,-manager}.c: Drop return statements and g_error_free() calls that never get reached. --- libayatana-indicator/indicator-service-manager.c | 1 - libayatana-indicator/indicator-service.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/libayatana-indicator/indicator-service-manager.c b/libayatana-indicator/indicator-service-manager.c index 049d176..33bcba9 100644 --- a/libayatana-indicator/indicator-service-manager.c +++ b/libayatana-indicator/indicator-service-manager.c @@ -286,7 +286,6 @@ set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec case PROP_NAME: if (priv->name != NULL) { g_error("Name can not be set twice!"); - return; } priv->name = g_value_dup_string(value); start_service(self); diff --git a/libayatana-indicator/indicator-service.c b/libayatana-indicator/indicator-service.c index 06d5a0e..de3a0cf 100644 --- a/libayatana-indicator/indicator-service.c +++ b/libayatana-indicator/indicator-service.c @@ -289,7 +289,6 @@ set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec if (G_VALUE_HOLDS_STRING(value)) { if (priv->name != NULL) { g_error("Name can not be set twice!"); - return; } priv->name = g_value_dup_string(value); try_and_get_name(self); @@ -354,7 +353,6 @@ bus_get_cb (__attribute__((unused)) GObject * object, GAsyncResult * res, gpoint g_warning("Unable to get a connection to the session DBus: %s", error->message); g_error_free(error); exit (0); - return; } IndicatorServicePrivate * priv = indicator_service_get_instance_private(user_data); @@ -377,8 +375,6 @@ bus_get_cb (__attribute__((unused)) GObject * object, GAsyncResult * res, gpoint &error); if (error != NULL) { g_error("Unable to register the object to DBus: %s", error->message); - g_error_free(error); - return; } return; -- cgit v1.2.3 From 1911cb3151157b11223798be28c4a6fddbd1cf4e Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 20 Apr 2021 22:28:04 +0200 Subject: tools/indicator-loader.c: Silence unused parameter warnings/errors for various functions. --- tools/indicator-loader.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/indicator-loader.c b/tools/indicator-loader.c index 7c30a59..5b236db 100644 --- a/tools/indicator-loader.c +++ b/tools/indicator-loader.c @@ -160,9 +160,9 @@ entry_added (IndicatorObject * io, } static void -entry_removed (IndicatorObject * io, +entry_removed (__attribute__((unused)) IndicatorObject * io, IndicatorObjectEntry * entry, - gpointer user_data) + __attribute__((unused)) gpointer user_data) { GtkWidget * w; @@ -173,10 +173,10 @@ entry_removed (IndicatorObject * io, } static void -menu_show (IndicatorObject * io, +menu_show (__attribute__((unused)) IndicatorObject * io, IndicatorObjectEntry * entry, - guint timestamp, - gpointer user_data) + __attribute__((unused)) guint timestamp, + __attribute__((unused)) gpointer user_data) { const char * text; -- cgit v1.2.3 From a849b4af5712dd5495b2c2e2697eef05c82f9f98 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 21 Apr 2021 06:03:08 +0200 Subject: .build.yml: Unit tests require xvfb (and xauth). --- .build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.build.yml b/.build.yml index 4c02846..e438b6e 100644 --- a/.build.yml +++ b/.build.yml @@ -15,6 +15,7 @@ requires: - glib2 - ayatana-ido - mate-common + - xvfb debian: # Useful URL: https://salsa.debian.org/debian-ayatana-team/libayatana-indicator @@ -35,6 +36,8 @@ requires: - libgtk-3-dev - libayatana-ido3-dev - systemd + - xauth + - xvfb ubuntu: - autopoint @@ -53,6 +56,8 @@ requires: - libgtk-3-dev - libayatana-ido3-dev - systemd + - xauth + - xvfb variables: - 'CHECKERS=" -- cgit v1.2.3 From 962eea003d82c275ba20c71b62495ca87dde2ec3 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 21 Apr 2021 09:34:28 +0200 Subject: .build.yml: No tests are run on Archlinux, neither are they run on Ubuntu. --- .build.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.build.yml b/.build.yml index e438b6e..cd90a55 100644 --- a/.build.yml +++ b/.build.yml @@ -15,7 +15,6 @@ requires: - glib2 - ayatana-ido - mate-common - - xvfb debian: # Useful URL: https://salsa.debian.org/debian-ayatana-team/libayatana-indicator @@ -29,13 +28,12 @@ requires: - intltool - mate-common - gtk-doc-tools - - dbus-test-runner - - xvfb - libglib2.0-dev - libgtk2.0-dev - libgtk-3-dev - libayatana-ido3-dev - systemd + - dbus-test-runner - xauth - xvfb @@ -49,15 +47,11 @@ requires: - intltool - mate-common - gtk-doc-tools - - dbus-test-runner - - xvfb - libglib2.0-dev - libgtk2.0-dev - libgtk-3-dev - libayatana-ido3-dev - systemd - - xauth - - xvfb variables: - 'CHECKERS=" -- cgit v1.2.3 From 9b913f0f3fa88999756671b9f8ae073d0889757c Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 21 Apr 2021 12:27:10 +0200 Subject: .build.yml: Output test-suite.log at the end of unit testings. --- .build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.build.yml b/.build.yml index cd90a55..6dcab07 100644 --- a/.build.yml +++ b/.build.yml @@ -97,6 +97,7 @@ after_scripts: - if [ ${BUILD_TYPE} == "scripts" ];then - if [ ${DISTRO_NAME} == "debian" ];then - make check + - cat tests/test-suite.log - fi - make distcheck - fi -- cgit v1.2.3 From a7375c8c5fa5d917e2d3c153bf9650f08e984990 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 21 Apr 2021 12:51:37 +0200 Subject: .build.yml: Enable unit tests during configure. --- .build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build.yml b/.build.yml index 6dcab07..1402b8a 100644 --- a/.build.yml +++ b/.build.yml @@ -78,7 +78,7 @@ build_scripts: - fi - NOCONFIGURE=1 ./autogen.sh - - scan-build $CHECKERS ./configure --prefix=/usr --enable-gtk-doc --enable-compile-warnings=maximum + - scan-build $CHECKERS ./configure --prefix=/usr --enable-gtk-doc --enable-compile-warnings=maximum --enable-tests - if [ $CPU_COUNT -gt 1 ]; then - if [ ${DISTRO_NAME} == "debian" ];then - scan-build $CHECKERS --keep-cc --use-cc=clang --use-c++=clang++ -o html-report make -j $CPU_COUNT -- cgit v1.2.3 From 1760be472be95a4669cf454baab0c222f4c6e12f Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 21 Apr 2021 13:27:19 +0200 Subject: .build.yml: Drop distcheck target. Not required. --- .build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.build.yml b/.build.yml index 1402b8a..126d769 100644 --- a/.build.yml +++ b/.build.yml @@ -99,5 +99,4 @@ after_scripts: - make check - cat tests/test-suite.log - fi - - make distcheck - fi -- cgit v1.2.3 From 246f41fc57169d444d0f069901726564e1abe808 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 4 May 2021 15:45:59 +0200 Subject: */Makefile.am: Drop -Werror compiler flag for now. Not helpful when setting up CI builds for dirty code. --- libayatana-indicator/Makefile.am | 2 +- tools/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libayatana-indicator/Makefile.am b/libayatana-indicator/Makefile.am index ab6247d..4933c71 100644 --- a/libayatana-indicator/Makefile.am +++ b/libayatana-indicator/Makefile.am @@ -70,7 +70,7 @@ libayatana_indicator_la_CFLAGS = \ $(COVERAGE_CFLAGS) \ $(GTK_DISABLE_DEPRECATED) \ -DG_LOG_DOMAIN=\"libayatana-indicator\" \ - -Wall -Werror -Wno-error=deprecated-declarations + -Wall -Wno-error=deprecated-declarations libayatana_indicator_la_LIBADD = \ $(LIBINDICATOR_LIBS) \ diff --git a/tools/Makefile.am b/tools/Makefile.am index 6f85429..e871921 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -15,7 +15,7 @@ ayatana_indicator_loader_SOURCES = \ indicator-loader.c ayatana_indicator_loader_CFLAGS = \ - -Wall -Werror \ + -Wall \ $(LIBINDICATOR_CFLAGS) \ $(LIBINDICATOR_IDO_CFLAGS) -I$(top_srcdir) \ -DBUILD_DIR="\"$(builddir)\"" -- cgit v1.2.3 From 195c450122d92162e5bab8a8dce12baf41efd9f7 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 4 May 2021 15:52:35 +0200 Subject: .travis.yml: Temporarily disable CI builds on ubuntu:rolling. Ubuntu's I series is not ready yet as docker container. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b9847ef..273cc63 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ env: # temp disable of archlinux builds, see https://gitlab.archlinux.org/archlinux/archlinux-docker/-/issues/56 # - DISTRO="archlinux:latest" - DISTRO="debian:testing" - - DISTRO="ubuntu:rolling" +# - DISTRO="ubuntu:rolling" - DISTRO="ubuntu:focal" jobs: -- cgit v1.2.3 From 89db74c188cca74949400ce80ab2690981d09f7a Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 4 May 2021 15:53:36 +0200 Subject: .travis.yml: Also do CI builds against Debian stable. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 273cc63..58e93f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,7 @@ env: # temp disable of archlinux builds, see https://gitlab.archlinux.org/archlinux/archlinux-docker/-/issues/56 # - DISTRO="archlinux:latest" - DISTRO="debian:testing" + - DISTRO="debian:stable" # - DISTRO="ubuntu:rolling" - DISTRO="ubuntu:focal" -- cgit v1.2.3 From c58c269eb5995ad022d403315d53ad7bfac1049a Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 4 May 2021 16:12:18 +0200 Subject: .travis.yml: Don't run autotools builds twice (once via script, once directly). --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 58e93f4..1e84fb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ install: - ./docker-build --name ${DISTRO} --config .build.yml --install script: - - ./docker-build --name ${DISTRO} --verbose --config .build.yml --build scripts --build autotools + - ./docker-build --name ${DISTRO} --verbose --config .build.yml --build scripts env: # temp disable of archlinux builds, see https://gitlab.archlinux.org/archlinux/archlinux-docker/-/issues/56 -- cgit v1.2.3 From f2b0b013de253f5eddeacbae718f0b8e19fcc8f7 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 4 May 2021 16:47:50 +0200 Subject: .build.yml: Build ayatana-ido from upstream Git rather than using the possibly outdate packaged version of ayatana-ido. --- .build.yml | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/.build.yml b/.build.yml index 126d769..b1ed56d 100644 --- a/.build.yml +++ b/.build.yml @@ -11,10 +11,13 @@ requires: - startup-notification - which - pacman + - mate-common - gtk3 - glib2 - - ayatana-ido - - mate-common +# - ayatana-ido + - gobject-introspection + - gtk-doc + - vala debian: # Useful URL: https://salsa.debian.org/debian-ayatana-team/libayatana-indicator @@ -23,15 +26,22 @@ requires: - clang-tools - cppcheck - git - - at-spi2-core - libtool - - intltool + - cmake + - cmake-extras - mate-common + - at-spi2-core + - intltool - gtk-doc-tools - libglib2.0-dev - libgtk2.0-dev - libgtk-3-dev - - libayatana-ido3-dev +# - libayatana-ido3-dev + - gobject-introspection + - libgirepository1.0-dev + - libx11-dev + - libxi-dev + - valac - systemd - dbus-test-runner - xauth @@ -42,15 +52,22 @@ requires: - clang - clang-tools - git - - at-spi2-core - libtool - - intltool + - cmake + - cmake-extras - mate-common + - at-spi2-core + - intltool - gtk-doc-tools - libglib2.0-dev - libgtk2.0-dev - libgtk-3-dev - - libayatana-ido3-dev +# - libayatana-ido3-dev + - gobject-introspection + - libgirepository1.0-dev + - libx11-dev + - libxi-dev + - valac - systemd variables: @@ -71,6 +88,16 @@ variables: -enable-checker alpha.core.FixedAddr -enable-checker security.insecureAPI.strcpy"' +before_scripts: + - cd ${START_DIR} + - if [ ! -d ayatana-ido-build ]; then + - git clone --depth 1 https://github.com/AyatanaIndicators/ayatana-ido.git ayatana-ido-build + - fi + - cd ayatana-ido-build + - cmake . -DCMAKE_INSTALL_PREFIX=/usr + - make + - make install + build_scripts: - if [ ${DISTRO_NAME} == "debian" ];then - export CFLAGS+=" -Wsign-compare -Wunused-parameter" -- cgit v1.2.3