Commit Graph

29 Commits

Author SHA1 Message Date
Philip Withnall
26409f19cd Add SPDX license headers for LGPL-2.1-or-later to various files
These have all been added manually, as I’ve finished all the files which
I can automatically detect.

All the license headers in this commit are for LGPL-2.1-or-later, and
all have been double-checked against the license paragraph in the file
header.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #1415
2022-06-01 12:44:23 +01:00
Philip Withnall
fab561f8d0 gobject: Drop use of volatile from get_type() macros
http://isvolatileusefulwiththreads.in/c/

It’s possible that the variables here are only marked as volatile
because they’re arguments to `g_once_*()`. Those arguments will be
modified in a subsequent commit.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #600
2020-11-20 14:40:19 +00:00
Philip Withnall
9b4c50f63d all: Remove trailing newlines from g_message()/g_warning()/g_error()s
All those logging functions already add a newline to any message they
print, so there’s no need to add a trailing newline in the message
passed to them.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: nobody
2018-04-27 16:46:19 +01:00
Philip Withnall
4fd537b8c8 gobject: Minor typo fix in a g_critical() warning
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-11-29 17:51:19 +00:00
Sébastien Wilmet
6b948d9613 gobject/: LGPLv2+ -> LGPLv2.1+
All gobject/*.{c,h} files have been processed.

gmarshal.c and gmarshal.h don't have a license header.

https://bugzilla.gnome.org/show_bug.cgi?id=776504
2017-05-24 11:58:19 +02:00
Stefan Ekenberg
338741fff5 Prevent race condition in g_io_condition_get_type
Prevents race condition in function g_io_condition_get_type by ensuring
that the initialization section for 'etype' is executed only once
during a program's life time, and that concurrent threads are blocked
until initialization completes. This changes solves the problem that
concurrent threads could execute the check 'etype == 0' before any of
them had initialized it, which in turn meant that multiple threads
would then attempt to register the "GIOCondition" type.

https://bugzilla.gnome.org/show_bug.cgi?id=750386
2015-06-04 22:30:50 -04:00
Daniel Mustieles
078dbda148 Updated FSF's address 2014-01-31 14:31:55 +01:00
Chun-wei Fan
114b1ccf78 gsourceclosure.c: Fix build on Windows
GPid is a HANDLE (aka void *) on Windows, not an int, so treat pid
accordingly on Windows, as using pid as a gulong directly would likely be
undesirable on Windows

https://bugzilla.gnome.org/show_bug.cgi?id=704447
2013-07-21 20:50:34 +01:00
Dan Winship
72a7e824d6 gsourceclosure: fix idle/timeout/signal closures, add child watch support
And add a test for all source types.

https://bugzilla.gnome.org/show_bug.cgi?id=704267
2013-07-17 21:41:45 -04:00
Dan Winship
8a89926532 gsourceclosure: Add support for GUnixSignalWatchSource and GUnixFDSource
https://bugzilla.gnome.org/show_bug.cgi?id=701511
2013-07-13 16:38:55 -04:00
Dan Winship
1da47d5ede gsourceclosure: use g_cclosure_marshal_generic
For the glib-defined source types, and any source type that defines a
closure callback but not a closure marshal, use
g_cclosure_marshal_generic. And then remove all the other remaining
source closure marshals.

https://bugzilla.gnome.org/show_bug.cgi?id=701511
2013-07-13 16:38:55 -04:00
Giovanni Campagna
1ce415b45b Install an invalidation notifier for GClosure in g_source_set_closure()
The point of g_source_set_closure() is getting memory management right,
including handling closures disappearing from the outside (for example
because a runtime they refer to is being shutdown). This means that
sources with an associated closure should remove themselves from the
main loop and free memory when the closure is invalidated.

https://bugzilla.gnome.org/show_bug.cgi?id=692034
2013-01-20 16:23:32 +01:00
Javier Jardón
108480b7ba gobject: Use G_VALUE_INIT 2011-10-18 17:12:33 +01:00
Dan Winship
e910205557 Add g_source_set_dummy_callback()
Use g_source_set_closure() and g_close_set_meta_marshal() to allow
setting a do-nothing callback on any source.

https://bugzilla.gnome.org/show_bug.cgi?id=634239
2010-11-26 15:07:28 -05:00
Christian Persch
71e73ffdfb Use G_DEFINE_[BOXED|POINTER]_TYPE instead of handwritten code
Now that we have convenience macros to implement boxed and pointer
types, use them.
2010-08-18 00:12:28 +02:00
Ryan Lortie
0fc50fa5f7 gobject/: fully remove gobjectalias hacks 2010-07-07 19:40:48 -04:00
Michael Natterer
6347be5fb6 remove trailing whitespace from newly added gtk-doc comments and
2008-06-22  Michael Natterer  <mitch@imendio.com>

	* *.c: remove trailing whitespace from newly added gtk-doc
	comments and reformatted some where they contained overly long or
	ill-formatted lines.


svn path=/trunk/; revision=7090
2008-06-22 14:53:09 +00:00
Michael Natterer
5602b7e275 moved includes back to the top of the files (before gtk-doc SECTION
2008-06-22  Michael Natterer  <mitch@imendio.com>

	* *.c: moved includes back to the top of the files (before gtk-doc
	SECTION comments). Add "config.h" in all files and move system
	included before glib includes. Remove trailing whitespace from
	SECTION comments and did some reformatting where lines were overly
	long, no documentation content was changed.


svn path=/trunk/; revision=7089
2008-06-22 14:29:25 +00:00
Stefan Kost
83dd545044 Migrating docs.
* docs/reference/gobject/tmpl/gclosure.sgml:
	* gobject/gboxed.h:
	* gobject/gclosure.c:
	* gobject/gclosure.h:
	* gobject/gobject.c:
	* gobject/gsourceclosure.c:
	* gobject/gsourceclosure.h:
	  Migrating docs.


svn path=/trunk/; revision=7069
2008-06-21 12:18:12 +00:00
Matthias Clasen
3448a27829 Make work again.
2005-03-14  Matthias Clasen  <mclasen@redhat.com>

	* abicheck.sh: Make work again.

	* gsourceclosure.c: Fix a typo.

	Make PLT-reduction work with gcc4, and don't include
	everything in gobjectalias.h:

	* gobject.symbols: Group symbols by header and source
	file.
	* makegobjectalias.pl: Protect definitions by the same
	preprocessor symbols used to guard the headers. Move
	the alias declarations to a separate file which is
	produced when calling makegalias.pl -def
	* Makefile.am (gobjectaliasdef.c): Add a rule to
	build this file.
	* *.c: Include gobjectalias.h after the other i
        GLib headers, include gobjectaliasdef.c at the bottom.
2005-03-14 06:47:51 +00:00
Manish Singh
c915c2d683 removed wrap_g_io_channel_ref() hack, since g_io_channel_ref() has a
Mon Nov  8 10:47:41 2004  Manish Singh  <yosh@gimp.org>

        * gobject/gsourceclosure.c: removed wrap_g_io_channel_ref() hack,
        since g_io_channel_ref() has a compatible API now.
2004-11-08 18:49:54 +00:00
Matthias Clasen
465c7d1ead Implement the same PLT reduction technique used in GTK+:
2004-09-16  Matthias Clasen  <mclasen@redhat.com>

	Implement the same PLT reduction technique used in GTK+:

	* Makefile.am: Generate gobjectalias.h from gobject.symbols.
	(BUILT_SOURCES): Add gobjectalias.h.

	* makegobjectalias.pl: Script to generate gobjectalias.h.

	* *.c: Include gobjectalias.h
2004-09-16 18:52:40 +00:00
Manish Singh
b4e2d28850 wrap g_io_channel_ref in a function that returns the passed in GIOChannel,
Sun Jan 11 15:34:35 2004  Manish Singh  <yosh@gimp.org>

        * gsourceclosure.c: wrap g_io_channel_ref in a function that returns
        the passed in GIOChannel, so we aren't abusing GBoxedCopyFunc
        semantics. Fixes bug #131076.
2004-01-11 23:59:49 +00:00
Matthias Clasen
fa21b512d5 Remove all docs from gobject at Tims request. Documentation is only for
2003-02-07  Matthias Clasen  <maclas@gmx.de>

	* gtypemodule.c:
	* gtype.c:
	* gsourceclosure.c:
	* gparamspecs.c:
	* gparam.c:
	* gobject.c:
	* gsignal.c: Remove all docs from gobject at Tims
	request. Documentation is only for weenies anyway...
2003-02-07 22:04:24 +00:00
Owen Taylor
e767aa0a4f Improve the detection of invalid includes by moving the test outside the
Mon Nov 19 14:35:56 2001  Owen Taylor  <otaylor@redhat.com>

        * *.h: Improve the detection of invalid includes by moving
        the test outside the duplicate include guards.

        * gsourceclosure.c (g_source_set_closure): Doc fix.
2001-11-22 18:55:06 +00:00
Matthias Clasen
eb17b20bd2 Fix documentation. Document g_log_domain_glib, gunichar, gunichar2,
* gobject/gsourceclosure.c (g_source_set_closure): Fix documentation.
        * glib/tmpl/messages.sgml, glib/tmpl/unicode.sgml:
        Document g_log_domain_glib, gunichar, gunichar2, GUnicodeType,
        GUnicodeBreakType.
2001-10-30 23:56:30 +00:00
Alex Larsson
ae2c2ca6c3 Removed is_refcounted and GBoxedInitFunc from
2001-09-10  Alex Larsson  <alexl@redhat.com>

	* gobject/gboxed.[ch]:
	* gobject/gsourceclosure.c:
	Removed is_refcounted and GBoxedInitFunc from
	g_boxed_type_register_static().
2001-09-10 16:48:42 +00:00
Tim Janik
267ff610fe updates for 1.3.7 release.
Tue Sep  4 01:50:24 2001  Tim Janik  <timj@gtk.org>

        * NEWS: updates for 1.3.7 release.

Tue Sep  4 01:49:18 2001  Tim Janik  <timj@gtk.org>

        * gsourceclosure.c: make closure_callback_funcs static,
        added some g_return_if_fail() statements.
2001-09-03 23:46:04 +00:00
Owen Taylor
0038581ed4 Implement.
Mon Aug 27 14:55:27 2001  Owen Taylor  <otaylor@redhat.com>

	* gsourceclosure.[ch] (g_source_set_closure): Implement.

	* gsourceclosure.[ch]: Add GType's for GIOChannel, GIOCondition.

Mon Aug 27 14:56:12 2001  Owen Taylor  <otaylor@redhat.com>

	* glib/gmain.h: Add closure_marshal/closure_callback
	fields to GSourceFuncs for use by g_source_set_closure().

	* glib/gmain.c glib/giounix.c glib/giowin32.c
	  glib/gmain.h: Export the SourceFuncs vtables so GObject
	can use them to figure out closure callbacks/marshallers
	for the default source types.
2001-09-03 22:13:16 +00:00