From d27684c488ceee4f2f54f549738adab0e2e8165d Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 17 Sep 2014 12:14:24 +0100 Subject: Replace tp_verify_* with equivalent G_STATIC_ASSERTs This was breaking the build: gtk-doc no longer understands verify.h. --- telepathy-glib/Makefile.am | 2 +- telepathy-glib/util.h | 5 +- telepathy-glib/verify.h | 146 --------------------------------------------- 3 files changed, 4 insertions(+), 149 deletions(-) delete mode 100644 telepathy-glib/verify.h diff --git a/telepathy-glib/Makefile.am b/telepathy-glib/Makefile.am index ce60d7d0b..fe642b29b 100644 --- a/telepathy-glib/Makefile.am +++ b/telepathy-glib/Makefile.am @@ -144,7 +144,7 @@ our_headers = \ tpginclude_HEADERS = \ $(our_headers) \ - verify.h + $(NULL) BUILT_SOURCES = $(codegen_sources) diff --git a/telepathy-glib/util.h b/telepathy-glib/util.h index af63a3a99..4c26d733c 100644 --- a/telepathy-glib/util.h +++ b/telepathy-glib/util.h @@ -30,9 +30,10 @@ #include #include -#include -#define tp_verify_statement(R) ((void) tp_verify_true (R)) +#define tp_verify_statement(R) ((void) G_STATIC_ASSERT_EXPR (R)) +#define tp_verify_true(R) (((void) G_STATIC_ASSERT_EXPR (R)), 1) +#define tp_verify(R) G_STATIC_ASSERT (R) G_BEGIN_DECLS diff --git a/telepathy-glib/verify.h b/telepathy-glib/verify.h deleted file mode 100644 index d46a46013..000000000 --- a/telepathy-glib/verify.h +++ /dev/null @@ -1,146 +0,0 @@ -/* Compile-time assert-like macros. - - Imported from gnulib 20090701 and adapted to Telepathy namespace. - - Copyright (C) 2005, 2006 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . */ - -/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */ - -#ifndef __TP_IN_UTIL_H__ -#error Not to be used directly, #include instead -#endif - -#ifndef TP_VERIFY_H -# define TP_VERIFY_H 1 - -/* Each of these macros verifies that its argument R is nonzero. To - be portable, R should be an integer constant expression. Unlike - assert (R), there is no run-time overhead. - - There are two macros, since no single macro can be used in all - contexts in C. verify_true (R) is for scalar contexts, including - integer constant expression contexts. verify (R) is for declaration - contexts, e.g., the top level. - - Symbols ending in "__" are private to this header. - - The code below uses several ideas. - - * The first step is ((R) ? 1 : -1). Given an expression R, of - integral or boolean or floating-point type, this yields an - expression of integral type, whose value is later verified to be - constant and nonnegative. - - * Next this expression W is wrapped in a type - struct verify_type__ { unsigned int verify_error_if_negative_size__: W; }. - If W is negative, this yields a compile-time error. No compiler can - deal with a bit-field of negative size. - - One might think that an array size check would have the same - effect, that is, that the type struct { unsigned int dummy[W]; } - would work as well. However, inside a function, some compilers - (such as C++ compilers and GNU C) allow local parameters and - variables inside array size expressions. With these compilers, - an array size check would not properly diagnose this misuse of - the verify macro: - - void function (int n) { verify (n < 0); } - - * For the verify macro, the struct verify_type__ will need to - somehow be embedded into a declaration. To be portable, this - declaration must declare an object, a constant, a function, or a - typedef name. If the declared entity uses the type directly, - such as in - - struct dummy {...}; - typedef struct {...} dummy; - extern struct {...} *dummy; - extern void dummy (struct {...} *); - extern struct {...} *dummy (void); - - two uses of the verify macro would yield colliding declarations - if the entity names are not disambiguated. A workaround is to - attach the current line number to the entity name: - - #define GL_CONCAT0(x, y) x##y - #define GL_CONCAT(x, y) GL_CONCAT0 (x, y) - extern struct {...} * GL_CONCAT(dummy,__LINE__); - - But this has the problem that two invocations of verify from - within the same macro would collide, since the __LINE__ value - would be the same for both invocations. - - A solution is to use the sizeof operator. It yields a number, - getting rid of the identity of the type. Declarations like - - extern int dummy [sizeof (struct {...})]; - extern void dummy (int [sizeof (struct {...})]); - extern int (*dummy (void)) [sizeof (struct {...})]; - - can be repeated. - - * Should the implementation use a named struct or an unnamed struct? - Which of the following alternatives can be used? - - extern int dummy [sizeof (struct {...})]; - extern int dummy [sizeof (struct verify_type__ {...})]; - extern void dummy (int [sizeof (struct {...})]); - extern void dummy (int [sizeof (struct verify_type__ {...})]); - extern int (*dummy (void)) [sizeof (struct {...})]; - extern int (*dummy (void)) [sizeof (struct verify_type__ {...})]; - - In the second and sixth case, the struct type is exported to the - outer scope; two such declarations therefore collide. GCC warns - about the first, third, and fourth cases. So the only remaining - possibility is the fifth case: - - extern int (*dummy (void)) [sizeof (struct {...})]; - - * This implementation exploits the fact that GCC does not warn about - the last declaration mentioned above. If a future version of GCC - introduces a warning for this, the problem could be worked around - by using code specialized to GCC, e.g.,: - - #if 4 <= __GNUC__ - # define verify(R) \ - extern int (* verify_function__ (void)) \ - [__builtin_constant_p (R) && (R) ? 1 : -1] - #endif - - * In C++, any struct definition inside sizeof is invalid. - Use a template type to work around the problem. */ - - -/* Verify requirement R at compile-time, as an integer constant expression. - Return 1. */ - -# ifdef __cplusplus -template - struct tp_verify_type__ { unsigned int verify_error_if_negative_size__: w; }; -# define tp_verify_true(R) \ - (!!sizeof (tp_verify_type__<(R) ? 1 : -1>)) -# else -# define tp_verify_true(R) \ - (!!sizeof \ - (struct { unsigned int verify_error_if_negative_size__: (R) ? 1 : -1; })) -# endif - -/* Verify requirement R at compile-time, as a declaration without a - trailing ';'. */ - -# define tp_verify(R) extern int (* tp_verify_function__ (void)) [tp_verify_true (R)] - -#endif -- cgit v1.2.1 From 1f15dc935b65a7296dcf815b4da31a3d3b68f116 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Sat, 18 Jun 2016 11:33:59 +0300 Subject: tests: eliminate duplicate test case paths Seems like this doesn't work with recent versions of glib --- tests/dbus/account.c | 8 ++++---- tests/dbus/cm.c | 2 +- tests/dbus/contact-list-client.c | 2 +- tests/dbus/contact-lists.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/dbus/account.c b/tests/dbus/account.c index 1df043ab5..c10497869 100644 --- a/tests/dbus/account.c +++ b/tests/dbus/account.c @@ -980,7 +980,7 @@ main (int argc, g_test_add ("/account/reconnect", Test, NULL, setup_service, test_reconnect, teardown_service); - g_test_add ("/account/reconnect", Test, "vardict", setup_service, + g_test_add ("/account/reconnect/vardict", Test, "vardict", setup_service, test_reconnect, teardown_service); g_test_add ("/account/prepare/success", Test, NULL, setup_service, @@ -991,15 +991,15 @@ main (int argc, g_test_add ("/account/storage", Test, "first", setup_service, test_storage, teardown_service); - g_test_add ("/account/storage", Test, "later", setup_service, test_storage, - teardown_service); + g_test_add ("/account/storage/later", Test, "later", setup_service, + test_storage, teardown_service); g_test_add ("/account/avatar", Test, NULL, setup_service, test_avatar, teardown_service); g_test_add ("/account/addressing", Test, "first", setup_service, test_addressing, teardown_service); - g_test_add ("/account/addressing", Test, "later", setup_service, + g_test_add ("/account/addressing/later", Test, "later", setup_service, test_addressing, teardown_service); return tp_tests_run_with_bus (); diff --git a/tests/dbus/cm.c b/tests/dbus/cm.c index ad4285475..e0f18eaa5 100644 --- a/tests/dbus/cm.c +++ b/tests/dbus/cm.c @@ -1187,7 +1187,7 @@ main (int argc, g_test_add ("/cm/list", Test, GINT_TO_POINTER (0), setup, test_list, teardown); - g_test_add ("/cm/list", Test, GINT_TO_POINTER (USE_OLD_LIST), + g_test_add ("/cm/list/old", Test, GINT_TO_POINTER (USE_OLD_LIST), setup, test_list, teardown); return tp_tests_run_with_bus (); diff --git a/tests/dbus/contact-list-client.c b/tests/dbus/contact-list-client.c index a3f878a16..bb4895de4 100644 --- a/tests/dbus/contact-list-client.c +++ b/tests/dbus/contact-list-client.c @@ -577,7 +577,7 @@ main (int argc, g_test_add ("/contact-list-client/contact-list/properties", Test, GUINT_TO_POINTER (FALSE), setup, test_contact_list_properties, teardown); - g_test_add ("/contact-list-client/contact-list/properties", Test, + g_test_add ("/contact-list-client/contact-list/properties/props-only", Test, GUINT_TO_POINTER (TRUE), setup, test_contact_list_properties, teardown); return tp_tests_run_with_bus (); diff --git a/tests/dbus/contact-lists.c b/tests/dbus/contact-lists.c index 43ab26280..5e88a1829 100644 --- a/tests/dbus/contact-lists.c +++ b/tests/dbus/contact-lists.c @@ -2788,7 +2788,7 @@ main (int argc, g_test_add ("/contact-lists/cancelled-publish-request", Test, NULL, setup, test_cancelled_publish_request, teardown); - g_test_add ("/contact-lists/cancelled-publish-request", + g_test_add ("/contact-lists/cancelled-publish-request/remove-after", Test, "remove-after", setup, test_cancelled_publish_request, teardown); g_test_add ("/contact-lists/add-to-stored", -- cgit v1.2.1 From dc39be2757bd7fa789c3db834d8d701b1f54f785 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 4 Mar 2016 01:20:40 +0000 Subject: build: cd to the $srcdir in autogen.sh for running gtkdocize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gtkdocize needs to run in the $srcdir (or have a --srcdir argument passed to it) so that it can find configure.[ac|in]. Ensure that’s the case in autogen.sh. This fixes autogen.sh in a srcdir ≠ builddir environment. --- autogen.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh index 3184e69a7..21860dd94 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,6 +1,13 @@ #!/bin/sh set -e +test -n "$srcdir" || srcdir=$(dirname "$0") +test -n "$srcdir" || srcdir=. + +olddir=$(pwd) + +cd $srcdir + gtkdocize if test -n "$AUTOMAKE"; then @@ -34,6 +41,8 @@ else run_configure=false fi +cd "$olddir" + if test $run_configure = true; then - ./configure "$@" + $srcdir/configure "$@" fi -- cgit v1.2.1 From e86a31fba2acb8b4f0cfd9e022dbe73f587241b8 Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Fri, 2 Oct 2015 15:21:13 +0100 Subject: tests: Remove a G_GNUC_UNUSED which isn't true any more --- tests/dbus/contact-list-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dbus/contact-list-client.c b/tests/dbus/contact-list-client.c index bb4895de4..99c7a875c 100644 --- a/tests/dbus/contact-list-client.c +++ b/tests/dbus/contact-list-client.c @@ -505,7 +505,7 @@ test_is_blocked (Test *test, static void test_contact_list_properties (Test *test, - gconstpointer data G_GNUC_UNUSED) + gconstpointer data) { gboolean props_only = GPOINTER_TO_UINT (data); GQuark conn_features[] = { 0, 0 }; -- cgit v1.2.1 From 2764a6785a0d56c9a0341ec146dc715fed6704b4 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 16 Jun 2015 10:21:47 +0100 Subject: tests: Fix a service file path to fix the build with installed tests Two directories were the wrong way round. https://bugs.freedesktop.org/show_bug.cgi?id=90991 --- tests/dbus/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dbus/Makefile.am b/tests/dbus/Makefile.am index 71f974c82..8cd47ca03 100644 --- a/tests/dbus/Makefile.am +++ b/tests/dbus/Makefile.am @@ -342,7 +342,7 @@ run-test.sh: run-test.sh.in $< > $@ @chmod +x $@ -service_files = services/dbus-1/spurious.service +service_files = dbus-1/services/spurious.service if ENABLE_INSTALLED_TESTS dbusservicedir = @tpglibtestsdir@/dbus-1/services -- cgit v1.2.1 From 26ed60ccf4efe7f3fed149ecd057a52329a03084 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Sat, 18 Jun 2016 14:21:52 +0300 Subject: Update NEWS --- NEWS | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/NEWS b/NEWS index b4ae41bb1..338245601 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,21 @@ +telepathy-glib 0.25.0 (UNRELEASED) +================================== + +Fixes: + +• stop hardcoding python's path in .py scripts (fd.o #76495, Guillaume) +• fixed some code issues discovered by compiling with clang + (fd.o #79006, Guillaume) +• replaced tp_verify_* with G_STATIC_ASSERTs, fixing the build with + more recent gtk-doc (Simon) +• autogen.sh: run gtkdocize from $srcdir in out-of-source builds + (fd.o #94391, Philip Withnall) +• tests: fix build failure with glib >= 2.46 due to duplicate test paths + (fd.o #92245, George Kiagiadakis) +• tests: Fix a service file path to fix the build with installed tests + (fd.o #90991, Philip Withnall) + + telepathy-glib 0.24.1 (2014-08-25) ================================== -- cgit v1.2.1 From e03967c263fc628e1a3301c390353f7c17243c20 Mon Sep 17 00:00:00 2001 From: Sebastian Geiger Date: Fri, 1 Jul 2016 23:29:54 +0200 Subject: Enable silent builds Bug: https://bugs.freedesktop.org/show_bug.cgi?id=96774 Reviewed-by: Debarshi Ray --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e3b2bb698..a63a0afe9 100644 --- a/configure.ac +++ b/configure.ac @@ -46,7 +46,7 @@ AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([1.11 -Wno-portability subdir-objects]) AC_CONFIG_HEADERS(config.h) -AM_SILENT_RULES +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) dnl check for tools AC_PROG_CC -- cgit v1.2.1 From 739afb4e9ef4a0b3ee124d0a188757069791b1a6 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Thu, 1 Sep 2016 18:03:25 +0300 Subject: build: fix previous commit for out-of-source running of autogen.sh Previous commit: dc39be2757bd7fa789c3db834d8d701b1f54f785 This commit makes the final diff match the one by Alban Browaeys, as attached in bug 59705, which addresses some good points that Simon had made in his review. It is more portable and more clean this way. https://bugs.freedesktop.org/show_bug.cgi?id=59705 https://bugs.freedesktop.org/show_bug.cgi?id=94391 --- autogen.sh | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/autogen.sh b/autogen.sh index 21860dd94..a47248cc4 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,15 +1,9 @@ #!/bin/sh set -e -test -n "$srcdir" || srcdir=$(dirname "$0") +test -n "$srcdir" || srcdir=`dirname "$0"` test -n "$srcdir" || srcdir=. -olddir=$(pwd) - -cd $srcdir - -gtkdocize - if test -n "$AUTOMAKE"; then : # don't override an explicit user request elif automake-1.11 --version >/dev/null 2>/dev/null && \ @@ -23,7 +17,11 @@ elif automake-1.11 --version >/dev/null 2>/dev/null && \ export ACLOCAL fi -autoreconf -i -f +( + cd "$srcdir" + gtkdocize + autoreconf -i -f +) # Honor NOCONFIGURE for compatibility with gnome-autogen.sh if test x"$NOCONFIGURE" = x; then @@ -41,8 +39,6 @@ else run_configure=false fi -cd "$olddir" - if test $run_configure = true; then - $srcdir/configure "$@" + "$srcdir/configure" "$@" fi -- cgit v1.2.1 From 45ca39448d90d960fa003d3e5e118453fb7dceab Mon Sep 17 00:00:00 2001 From: Alexander Akulich Date: Wed, 25 Sep 2019 01:54:12 +0300 Subject: xincludator.py: Fix behaviour on LANG=C Use UTF-8 encoding instead of 'None', because spec XMLs contain non-ASCII symbols, such as copyright sign. --- tools/xincludator.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/xincludator.py b/tools/xincludator.py index d63389e4b..2b8c42751 100644 --- a/tools/xincludator.py +++ b/tools/xincludator.py @@ -38,9 +38,10 @@ if __name__ == '__main__': xincludate(dom, argv[0]) if sys.version_info[0] >= 3: - xml = dom.toxml(encoding=None) + xml = dom.toxml('utf-8') + stdout.buffer.write(xml) + stdout.buffer.write(b'\n') else: xml = dom.toxml() - - stdout.write(xml) - stdout.write('\n') + stdout.write(xml) + stdout.write('\n') -- cgit v1.2.1 From 64fac8c6983be656d8fdbe8f3fe51b00753a2b73 Mon Sep 17 00:00:00 2001 From: Alexander Akulich Date: Sun, 15 Sep 2019 15:46:16 +0300 Subject: Port make-release-mail.py to Python 3 --- tools/make-release-mail.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/make-release-mail.py b/tools/make-release-mail.py index b03ebd256..33438382b 100644 --- a/tools/make-release-mail.py +++ b/tools/make-release-mail.py @@ -28,8 +28,8 @@ def extract_description(package, version, news_path): break # Skip the ====== line, and the first blank line - lines.next() - lines.next() + next(lines) + next(lines) got_release_name = False @@ -59,7 +59,7 @@ GIT_URL = 'http://cgit.freedesktop.org/telepathy' def main(package, version, news_path): release_name, details = extract_description(package, version, news_path) - print """ + print(""" %(release_name)s tarball: %(base_url)s/%(package)s/%(package)s-%(version)s.tar.gz @@ -73,14 +73,14 @@ git: %(git_url)s/%(package)s 'version': version, 'release_name': release_name, 'details': details, - } + }) if __name__ == '__main__': try: package, version, news_path = sys.argv[1:] main(package, version, news_path) - except ValueError, e: + except ValueError as e: sys.stderr.write( 'Usage: %s package-name package.version.number path/to/NEWS\n' % sys.argv[0]) -- cgit v1.2.1 From ab13da946b2839a79e199f59e57ff984ebf9ef98 Mon Sep 17 00:00:00 2001 From: Alexey Andreyev Date: Thu, 12 Dec 2019 19:22:00 +0300 Subject: Port tools/manager-file.py to Python 3 --- tools/manager-file.py | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/tools/manager-file.py b/tools/manager-file.py index aaa794657..e6eaefe39 100644 --- a/tools/manager-file.py +++ b/tools/manager-file.py @@ -25,6 +25,7 @@ import re import sys +import os _NOT_C_STR = re.compile(r'[^A-Za-z0-9_-]') @@ -87,18 +88,18 @@ gflags = { def write_manager(f, manager, protos): # pointless backwards compat section - print >> f, '[ConnectionManager]' - print >> f, 'BusName=org.freedesktop.Telepathy.ConnectionManager.' + manager - print >> f, 'ObjectPath=/org/freedesktop/Telepathy/ConnectionManager/' + manager + print('[ConnectionManager]', file=f) + print('BusName=org.freedesktop.Telepathy.ConnectionManager.' + manager, file=f) + print('ObjectPath=/org/freedesktop/Telepathy/ConnectionManager/' + manager, file=f) # protocols - for proto, params in protos.iteritems(): - print >> f - print >> f, '[Protocol %s]' % proto + for proto, params in protos.items(): + print(file=f) + print('[Protocol %s]' % proto, file=f) defaults = {} - for param, info in params.iteritems(): + for param, info in params.items(): dtype = info['dtype'] flags = info.get('flags', '').split() struct_field = info.get('struct_field', param.replace('-', '_')) @@ -115,15 +116,15 @@ def write_manager(f, manager, protos): else: flags = '' - print >> f, 'param-%s=%s%s' % (param, desktop_string(dtype), flags) + print('param-%s=%s%s' % (param, desktop_string(dtype), flags), file=f) - for param, default in defaults.iteritems(): - print >> f, 'default-%s=%s' % (param, default) + for param, default in defaults.items(): + print('default-%s=%s' % (param, default), file=f) def write_c_params(f, manager, proto, struct, params): - print >> f, "static const TpCMParamSpec %s_%s_params[] = {" % (manager, proto) + print("static const TpCMParamSpec %s_%s_params[] = {" % (manager, proto), file=f) - for param, info in params.iteritems(): + for param, info in params.items(): dtype = info['dtype'] flags = info.get('flags', '').split() struct_field = info.get('struct_field', param.replace('-', '_')) @@ -146,7 +147,7 @@ def write_c_params(f, manager, proto, struct, params): else: struct_offset = 'G_STRUCT_OFFSET (%s, %s)' % (struct, struct_field) - print >> f, (''' { %s, %s, %s, + print((''' { %s, %s, %s, %s, %s, /* default */ %s, /* struct offset */ @@ -154,14 +155,14 @@ def write_c_params(f, manager, proto, struct, params): %s, /* filter data */ %s /* setter data */ },''' % (c_string(param), c_string(dtype), gtypes[dtype], flags, - default, struct_offset, filter, filter_data, setter_data)) + default, struct_offset, filter, filter_data, setter_data)), file=f) - print >> f, " { NULL }" - print >> f, "};" + print(" { NULL }", file=f) + print("};", file=f) if __name__ == '__main__': environment = {} - execfile(sys.argv[1], environment) + exec(compile(open(sys.argv[1], "rb").read(), sys.argv[1], 'exec'), environment) filename = '%s/%s.manager' % (sys.argv[2], environment['MANAGER']) try: -- cgit v1.2.1 From e92d895158feacf7b0e4b3b102525447d61b3013 Mon Sep 17 00:00:00 2001 From: Alexander Akulich Date: Thu, 12 Dec 2019 23:35:19 +0300 Subject: tools/glib-gtypes-generator.py: Sort generated types --- tools/glib-gtypes-generator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/glib-gtypes-generator.py b/tools/glib-gtypes-generator.py index 05f026c51..d531d910d 100644 --- a/tools/glib-gtypes-generator.py +++ b/tools/glib-gtypes-generator.py @@ -231,7 +231,7 @@ class GTypesGenerator(object): for struct in structs: self.do_struct_header(struct) - for sig in self.need_structs: + for sig in sorted(self.need_structs): self.h('GType %stype_dbus_struct_%s (void);\n\n' % (self.prefix_, self.need_structs[sig])) self.c('GType\n%stype_dbus_struct_%s (void)\n{\n' % @@ -247,7 +247,7 @@ class GTypesGenerator(object): self.c(' return t;\n') self.c('}\n\n') - for sig in self.need_struct_arrays: + for sig in sorted(self.need_struct_arrays): self.h('GType %stype_dbus_array_%s (void);\n\n' % (self.prefix_, self.need_struct_arrays[sig])) self.c('GType\n%stype_dbus_array_%s (void)\n{\n' % @@ -260,7 +260,7 @@ class GTypesGenerator(object): self.c(' return t;\n') self.c('}\n\n') - for sig in self.need_other_arrays: + for sig in sorted(self.need_other_arrays): self.h('GType %stype_dbus_array_of_%s (void);\n\n' % (self.prefix_, self.need_other_arrays[sig])) self.c('GType\n%stype_dbus_array_of_%s (void)\n{\n' % -- cgit v1.2.1 From 76cc2d96a5601572639032d33c2e1a16ff8a8905 Mon Sep 17 00:00:00 2001 From: Alexander Akulich Date: Thu, 12 Dec 2019 23:35:26 +0300 Subject: Tests: Adjust expected gtypes sources to conform with the types order --- tests/tools/expected-gtypes-body.h | 24 ++++++++++++------------ tests/tools/expected-gtypes.h | 8 ++++---- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/tools/expected-gtypes-body.h b/tests/tools/expected-gtypes-body.h index ab1d7e99a..be1db8a06 100644 --- a/tests/tools/expected-gtypes-body.h +++ b/tests/tools/expected-gtypes-body.h @@ -5,32 +5,32 @@ */ GType -the_prefix_type_dbus_hash_ss (void) +the_prefix_type_dbus_hash_sv (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) - t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING); + t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE); return t; } GType -the_prefix_type_dbus_hash_sa_7bsv_7d (void) +the_prefix_type_dbus_hash_ss (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) - t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE))); + t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING); return t; } GType -the_prefix_type_dbus_hash_sv (void) +the_prefix_type_dbus_hash_sa_7bsv_7d (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) - t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE); + t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE))); return t; } @@ -69,32 +69,32 @@ the_prefix_type_dbus_array_isu (void) } GType -the_prefix_type_dbus_array_of_a_7bsa_7bsv_7d_7d (void) +the_prefix_type_dbus_array_of_a_7bsaa_7bsv_7d_7d (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) - t = dbus_g_type_get_collection ("GPtrArray", the_prefix_type_dbus_hash_sa_7bsv_7d ()); + t = dbus_g_type_get_collection ("GPtrArray", the_prefix_type_dbus_hash_saa_7bsv_7d ()); return t; } GType -the_prefix_type_dbus_array_of_a_7bsv_7d (void) +the_prefix_type_dbus_array_of_a_7bsa_7bsv_7d_7d (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) - t = dbus_g_type_get_collection ("GPtrArray", the_prefix_type_dbus_hash_sv ()); + t = dbus_g_type_get_collection ("GPtrArray", the_prefix_type_dbus_hash_sa_7bsv_7d ()); return t; } GType -the_prefix_type_dbus_array_of_a_7bsaa_7bsv_7d_7d (void) +the_prefix_type_dbus_array_of_a_7bsv_7d (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) - t = dbus_g_type_get_collection ("GPtrArray", the_prefix_type_dbus_hash_saa_7bsv_7d ()); + t = dbus_g_type_get_collection ("GPtrArray", the_prefix_type_dbus_hash_sv ()); return t; } diff --git a/tests/tools/expected-gtypes.h b/tests/tools/expected-gtypes.h index 2fc94e261..e18f527b4 100644 --- a/tests/tools/expected-gtypes.h +++ b/tests/tools/expected-gtypes.h @@ -18,12 +18,12 @@ #define THE_PREFIX_ARRAY_TYPE_STRING_VARIANT_MAP_LIST_MAP_LIST (the_prefix_type_dbus_array_of_a_7bsaa_7bsv_7d_7d ()) +GType the_prefix_type_dbus_hash_sv (void); + GType the_prefix_type_dbus_hash_ss (void); GType the_prefix_type_dbus_hash_sa_7bsv_7d (void); -GType the_prefix_type_dbus_hash_sv (void); - GType the_prefix_type_dbus_hash_saa_7bsv_7d (void); #define THE_PREFIX_STRUCT_TYPE_STRUCT (the_prefix_type_dbus_struct_isu ()) @@ -34,9 +34,9 @@ GType the_prefix_type_dbus_struct_isu (void); GType the_prefix_type_dbus_array_isu (void); +GType the_prefix_type_dbus_array_of_a_7bsaa_7bsv_7d_7d (void); + GType the_prefix_type_dbus_array_of_a_7bsa_7bsv_7d_7d (void); GType the_prefix_type_dbus_array_of_a_7bsv_7d (void); -GType the_prefix_type_dbus_array_of_a_7bsaa_7bsv_7d_7d (void); - -- cgit v1.2.1 From 2e8b2cc0db09b781d99e3755bb6d01548037fe7b Mon Sep 17 00:00:00 2001 From: Fabrice Bellet Date: Thu, 15 Dec 2016 11:36:05 +0100 Subject: call-channel: fix a memory leak --- telepathy-glib/call-channel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/telepathy-glib/call-channel.c b/telepathy-glib/call-channel.c index 8ed76323b..2a1fa203d 100644 --- a/telepathy-glib/call-channel.c +++ b/telepathy-glib/call-channel.c @@ -525,6 +525,8 @@ update_call_members (TpCallChannel *self, _tp_channel_contacts_queue_prepare_async ((TpChannel *) self, contacts, update_call_members_prepared_cb, data); + + g_ptr_array_unref (contacts); } static void -- cgit v1.2.1 From 13a8d52077f0415d79c0f7aba2af50db01458021 Mon Sep 17 00:00:00 2001 From: Fabrice Bellet Date: Wed, 9 Nov 2016 10:49:27 +0100 Subject: debug-sender: fix messages queue locking --- telepathy-glib/debug-sender.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/telepathy-glib/debug-sender.c b/telepathy-glib/debug-sender.c index 599d9672a..1a5047109 100644 --- a/telepathy-glib/debug-sender.c +++ b/telepathy-glib/debug-sender.c @@ -82,6 +82,7 @@ struct _TpDebugSenderPrivate gboolean enabled; gboolean timestamps; GQueue *messages; + GMutex messages_lock; }; typedef struct { @@ -192,7 +193,9 @@ tp_debug_sender_finalize (GObject *object) { TpDebugSender *self = TP_DEBUG_SENDER (object); + g_mutex_lock (&self->priv->messages_lock); g_queue_foreach (self->priv->messages, (GFunc) debug_message_free, NULL); + g_mutex_unlock (&self->priv->messages_lock); g_queue_free (self->priv->messages); self->priv->messages = NULL; @@ -288,6 +291,7 @@ get_messages (TpSvcDebug *self, GList *i; guint j; + g_mutex_lock (&dbg->priv->messages_lock); messages = g_ptr_array_sized_new (g_queue_get_length (dbg->priv->messages)); for (i = dbg->priv->messages->head; i; i = i->next) @@ -306,6 +310,7 @@ get_messages (TpSvcDebug *self, G_MAXUINT); g_ptr_array_add (messages, g_value_get_boxed (&gvalue)); } + g_mutex_unlock (&dbg->priv->messages_lock); tp_svc_debug_return_from_get_messages (context, messages); @@ -360,6 +365,7 @@ _tp_debug_sender_take (TpDebugSender *self, DebugMessage *new_msg) { #ifdef ENABLE_DEBUG_CACHE + g_mutex_lock (&self->priv->messages_lock); if (g_queue_get_length (self->priv->messages) >= DEBUG_MESSAGE_LIMIT) { DebugMessage *old_head = @@ -369,6 +375,7 @@ _tp_debug_sender_take (TpDebugSender *self, } g_queue_push_tail (self->priv->messages, new_msg); + g_mutex_unlock (&self->priv->messages_lock); #endif if (self->priv->enabled) -- cgit v1.2.1 From 0868f6d539d25c3b67e7cb10ed4ad21ce77f411e Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Mon, 5 Jun 2017 22:10:12 +0800 Subject: TpBasePasswordChannel: fix gtk-doc comment for finished signal https://bugs.freedesktop.org/show_bug.cgi?id=101301 --- telepathy-glib/base-password-channel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/telepathy-glib/base-password-channel.c b/telepathy-glib/base-password-channel.c index 7ca4ca270..93d37db85 100644 --- a/telepathy-glib/base-password-channel.c +++ b/telepathy-glib/base-password-channel.c @@ -387,11 +387,12 @@ tp_base_password_channel_class_init (TpBasePasswordChannelClass *tp_base_passwor /** * TpBasePasswordChannel::finished: + * @self: the #TpBasePasswordChannel * @password: the password provided by the user, or %NULL if the * authentication has been aborted * @domain: domain of a #GError indicating why the authentication has been * aborted, or 0 - * @code: error code of a GError indicating why the authentication has been + * @code: error code of a #GError indicating why the authentication has been * aborted, or 0 * @message: a message associated with the error, or %NULL * -- cgit v1.2.1 From 8b3ef714d8f94b96eaa9af238abe2b2f62b60bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Kul=C3=ADk?= Date: Tue, 19 May 2020 09:26:29 +0200 Subject: Sort generated types and adjust expected accordingly --- tests/tools/expected-gtypes-body.h | 16 ++++++++-------- tests/tools/expected-gtypes.h | 8 ++++---- tools/glib-gtypes-generator.py | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/tools/expected-gtypes-body.h b/tests/tools/expected-gtypes-body.h index be1db8a06..e575c818e 100644 --- a/tests/tools/expected-gtypes-body.h +++ b/tests/tools/expected-gtypes-body.h @@ -5,42 +5,42 @@ */ GType -the_prefix_type_dbus_hash_sv (void) +the_prefix_type_dbus_hash_saa_7bsv_7d (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) - t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE); + t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, (dbus_g_type_get_collection ("GPtrArray", (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE))))); return t; } GType -the_prefix_type_dbus_hash_ss (void) +the_prefix_type_dbus_hash_sa_7bsv_7d (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) - t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING); + t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE))); return t; } GType -the_prefix_type_dbus_hash_sa_7bsv_7d (void) +the_prefix_type_dbus_hash_ss (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) - t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE))); + t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING); return t; } GType -the_prefix_type_dbus_hash_saa_7bsv_7d (void) +the_prefix_type_dbus_hash_sv (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) - t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, (dbus_g_type_get_collection ("GPtrArray", (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE))))); + t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE); return t; } diff --git a/tests/tools/expected-gtypes.h b/tests/tools/expected-gtypes.h index e18f527b4..5164cab18 100644 --- a/tests/tools/expected-gtypes.h +++ b/tests/tools/expected-gtypes.h @@ -18,13 +18,13 @@ #define THE_PREFIX_ARRAY_TYPE_STRING_VARIANT_MAP_LIST_MAP_LIST (the_prefix_type_dbus_array_of_a_7bsaa_7bsv_7d_7d ()) -GType the_prefix_type_dbus_hash_sv (void); - -GType the_prefix_type_dbus_hash_ss (void); +GType the_prefix_type_dbus_hash_saa_7bsv_7d (void); GType the_prefix_type_dbus_hash_sa_7bsv_7d (void); -GType the_prefix_type_dbus_hash_saa_7bsv_7d (void); +GType the_prefix_type_dbus_hash_ss (void); + +GType the_prefix_type_dbus_hash_sv (void); #define THE_PREFIX_STRUCT_TYPE_STRUCT (the_prefix_type_dbus_struct_isu ()) diff --git a/tools/glib-gtypes-generator.py b/tools/glib-gtypes-generator.py index d531d910d..1a5e84d74 100644 --- a/tools/glib-gtypes-generator.py +++ b/tools/glib-gtypes-generator.py @@ -213,7 +213,7 @@ class GTypesGenerator(object): for mapping in mappings: self.do_mapping_header(mapping) - for sig in self.need_mappings: + for sig in sorted(self.need_mappings): self.h('GType %stype_dbus_hash_%s (void);\n\n' % (self.prefix_, self.need_mappings[sig])) self.c('GType\n%stype_dbus_hash_%s (void)\n{\n' % -- cgit v1.2.1 From fd7626ee3cc965f15fe78d9f45e713ebefd83a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Kul=C3=ADk?= Date: Tue, 19 May 2020 11:50:44 +0200 Subject: Tests: Make tests Python 3 compatible --- tests/all-errors-documented.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/all-errors-documented.py b/tests/all-errors-documented.py index 911dc7695..1a83d81d9 100755 --- a/tests/all-errors-documented.py +++ b/tests/all-errors-documented.py @@ -24,7 +24,7 @@ def check_all_errors_documented(abs_top_srcdir): error.getAttribute('name').replace('.', '_').replace(' ', '_').upper()) if '%s\n' % name not in sections: - print "'%s' is missing in %s" % (name, sections_path) + print("'%s' is missing in %s" % (name, sections_path)) sys.exit(1) if __name__ == '__main__': -- cgit v1.2.1 From 9c6c6fb5203d8cb73064a02cc6b147aa91908952 Mon Sep 17 00:00:00 2001 From: Ivaylo Dimitrov Date: Thu, 27 Aug 2020 13:31:03 +0300 Subject: protocol: fix a memory leak Signed-off-by: Ivaylo Dimitrov --- telepathy-glib/protocol.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/telepathy-glib/protocol.c b/telepathy-glib/protocol.c index b63730cd1..88fdff382 100644 --- a/telepathy-glib/protocol.c +++ b/telepathy-glib/protocol.c @@ -1791,7 +1791,7 @@ _tp_protocol_parse_manager_file (GKeyFile *file, i++; } - param_specs = g_ptr_array_sized_new (i); + param_specs = g_ptr_array_new_full (i, tp_value_array_free); for (key = keys; key != NULL && *key != NULL; key++) { @@ -1886,6 +1886,8 @@ _tp_protocol_parse_manager_file (GKeyFile *file, TP_PROP_PROTOCOL_PARAMETERS, TP_ARRAY_TYPE_PARAM_SPEC_LIST, param_specs, NULL); + g_ptr_array_unref(param_specs); + tp_asv_take_boxed (immutables, TP_PROP_PROTOCOL_INTERFACES, G_TYPE_STRV, g_key_file_get_string_list (file, group, "Interfaces", NULL, NULL)); tp_asv_take_boxed (immutables, TP_PROP_PROTOCOL_CONNECTION_INTERFACES, -- cgit v1.2.1