Commit Graph

14 Commits

Author SHA1 Message Date
Emmanuel Fleury
f58702ebbf Fixing signedness in glib/gquark.c
glib/gquark.c: In function ‘g_quark_to_string’:
glib/gquark.c:268:13: error: comparison of integer expressions of different signedness: ‘GQuark’ {aka ‘unsigned int’} and ‘gint’ {aka ‘int’} [-Werror=sign-compare]
   if (quark < seq_id)
             ^
2019-03-15 21:30:22 +01:00
Philip Withnall
a66ae5cda3 gquark: Document that some functions can’t initialise C++ globals
Any function which requires g_quark_init() to have been called first
cannot be called before the library constructors have finished running.
In particular, this means that g_quark_from_static_string() or
g_intern_static_string() can’t be used to initialize C++ globals.

Do this, rather than adding a conditional call to g_quark_init() to all
these functions, because such a call was previously removed from the
functions to improve performance (quarks are used a lot in the
implementation of GObject for properties and signals). That’s the reason
why g_quark_init() was originally moved out to a library constructor.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1177
2019-03-07 11:12:01 +00:00
Natanael Copa
d933cf99bf gquark: simplify g_intern_string/g_intern_static_string
Move the common code to a quark_intern_string_locked function. This has
no effect on the generated code but makes codebase a bit cleaner.

https://bugzilla.gnome.org/show_bug.cgi?id=768507
2018-02-16 12:49:43 +00:00
Natanael Copa
2f07630b43 gquark: simplify g_quark_from_static_string/g_quark_from_string
Move common code to quark_from_string_locked  wrapper function. This has
no effect on generated code but it makes codebase a bit cleaner.

https://bugzilla.gnome.org/show_bug.cgi?id=768507
2018-02-16 12:49:43 +00:00
Sébastien Wilmet
f9faac7661 glib/: LGPLv2+ -> LGPLv2.1+
All glib/*.{c,h} files have been processed, as well as gtester-report.

12 of those files are not licensed under LGPL:

	gbsearcharray.h
	gconstructor.h
	glibintl.h
	gmirroringtable.h
	gscripttable.h
	gtranslit-data.h
	gunibreak.h
	gunichartables.h
	gunicomp.h
	gunidecomp.h
	valgrind.h
	win_iconv.c

Some of them are generated files, some are licensed under a BSD-style
license and win_iconv.c is in the public domain.

Sub-directories inside glib/:

	deprecated/: processed in a previous commit
	glib-mirroring-tab/: already LGPLv2.1+
	gnulib/: not modified, the code is copied from gnulib
	libcharset/: a copy
	pcre/: a copy
	tests/: processed in a previous commit

https://bugzilla.gnome.org/show_bug.cgi?id=776504
2017-05-24 11:58:19 +02:00
Christian Hergert
18a33f72db introspection: use (nullable) or (optional) instead of (allow-none)
If we have an input parameter (or return value) we need to use (nullable).
However, if it is an (inout) or (out) parameter, (optional) is sufficient.

It looks like (nullable) could be used for everything according to the
Annotation documentation, but (optional) is more specific.
2016-11-22 14:14:37 -08:00
Matthias Clasen
2fe992b099 Move quark initialization to a constructor
This removes a branch from the very frequently called
quark functions.
2015-09-12 11:13:45 -04:00
Matthias Clasen
e7fd3de86d Eradicate links and xrefs
These are all replaced by markdown ref links.
2014-02-08 12:26:56 -05:00
Matthias Clasen
42cf80780b Docs: Big entity cleanup
Strip lots of entity use from |[ ]| examples (which are now
implicit CDATA). Also remove many redundant uses of <!-- -->.
2014-02-01 12:00:30 -05:00
Matthias Clasen
4d12e0d66f Docs: Don't use the emphasis tag
Most of the time, the text read just as well without the extra
boldness.
2014-01-31 20:34:33 -05:00
Daniel Mustieles
078dbda148 Updated FSF's address 2014-01-31 14:31:55 +01:00
Cosimo Cecchi
daae12710a gquark: clarify G_DEFINE_QUARK docs about the use of quotes
Use the term "name" instead of "string" in the documentation, and add a
note explaining double quotes shouldn't be used for the quark name.
2012-08-28 13:16:23 -04:00
Matthias Clasen
702b448865 Add a G_DEFINE_QUARK macro
https://bugzilla.gnome.org/show_bug.cgi?id=627240
2012-08-28 00:08:07 -04:00
Matthias Clasen
a1ff18582d Put quarks in their own source file
Just because I'm too lazy to grep every single time for the other
source file in which the quark code is hiding.
2012-08-28 00:08:06 -04:00