2659 Commits

Author SHA1 Message Date
Ryan Lortie
6393ca443a distcheck: add gvariant-internal.h to SOURCES 2010-03-08 10:54:23 -05:00
Ryan Lortie
75f761bcaa GVariant variable arguments, tests, cleanups
Merge GVariant variable arguments support and put it under tests.

Also, remove the hack of the test case directly '#include'ing .c files
from glib/.  Instead, create a non-installed gvariant-internal.h that
the tests can include and make the symbols in it visible on the symbol
table of the shared library.  These symbols (as they are present in no
installed header files) are not part of the API of GLib.

Increase test coverage in a few other areas.
2010-03-08 10:31:19 -05:00
Matthias Clasen
42f042d5fb Minor doc clarification
Spell out that g_utf8_strlen() behaves like strlen() wrt. to
termination. Bug 612040.
2010-03-08 00:05:07 -05:00
Ryan Lortie
a9d57e990b .gitignore mem-overflow test 2010-03-07 03:02:08 -05:00
Ryan Lortie
a1b9743e18 Bug 608196 - Overflow-safe g_new family
Remove the macros for the g_malloc_n family -- calls directly to those
functions now always go directly to those functions.

Reimplement the macros for g_new and friends.

Remove the branch that checked for calling g_new() with a constant
n_structs == 1.  With the struct size always known this case will now be
caught under the case that does the inline multiplication and the
multiplication by 1 will be optimised away.
2010-03-06 23:21:27 -05:00
Ryan Lortie
0edd7cb8a1 undef the proper macros to avoid warning message 2010-03-05 15:53:42 -05:00
Behdad Esfahbod
a3420d8713 Add makegalias.pl dep on galias.h and co 2010-03-05 15:48:48 -05:00
Ryan Lortie
7026365db2 g_variant_get_strv: support objects and signatures 2010-03-05 06:14:36 -05:00
Ryan Lortie
118d59ba15 GVariant: fix some refcounting issues 2010-03-05 06:14:26 -05:00
Behdad Esfahbod
f3425cc38d Fix galias build breakage with g_malloc_n macros 2010-03-04 10:39:15 -05:00
Behdad Esfahbod
343cbf25c7 Bug 608196 - Overflow-safe g_new family
New public API:

g_malloc_n
g_malloc0_n
g_realloc_n
g_try_malloc_n
g_try_malloc0_n
g_try_realloc_n
2010-03-03 17:54:49 -05:00
Ryan Lortie
560f518743 GVariantBuilder: loosen assertion check
Don't check that a GVariantBuilder is fully-valid for use when
performing refcounting operations, as these operations may be occuring
after the builder has already been cleared.
2010-03-03 11:38:14 -05:00
Ryan Lortie
fe6e278a87 GVariantBuilder: allow for stack allocation 2010-03-03 03:38:02 -05:00
Ryan Lortie
a3c7406cce GVariantTypeInfo: fix thread safety bug
Issue caught by Michael Meeks.  This patch based on his.

GVariantTypeInfo was dropping the reference count on the TypeInfo
structure before removing it from the hash table.  This means that
another thread could come along and grab the value from the hash table
in the meantime.

Solve this by holding the lock on the table before dropping the
reference.

Also: move the hash table initialisation inside of the lock to remove
the standard double-initialisation race plus a more insidious issue
caused by the fact that we free the hash table once it becomes empty.
2010-02-25 18:13:59 -05:00
Ryan Lortie
1f66523ad3 Fix backward logic in g_return_if_fail(). 2010-02-23 02:00:11 -05:00
Ryan Lortie
360b9b540e GVariant: Improve test coverage. 2010-02-23 01:59:57 -05:00
Ryan Lortie
515434bdcb GVariantIter, GVariantBuilder 2010-02-22 00:39:01 -05:00
Ryan Lortie
b9d728474e Remove redudant check for direct #include gslice.h
This was added before we had a standardised header check and not removed
when the standard check was added.
2010-02-22 00:35:45 -05:00
Matthias Clasen
9a08cd5b04 More distcheck fixes 2010-02-21 20:28:34 -05:00
Matthias Clasen
ef497e8e64 Fix some distcheck issues 2010-02-21 20:11:33 -05:00
Matthias Clasen
e0e57fd97d Fix a doc typo.
Reported in bug 608063 by Дилян Палаузов.
2010-02-21 17:59:15 -05:00
Matthias Clasen
dcdc409cd8 Fix the large array test to work
Fix by Sven Herzberg, bug 568760
2010-02-21 16:29:15 -05:00
Matthias Clasen
dd7bd61c53 Documentation improvement
Document the size requirements on output buffer in g_base64_encode_close.
Patch by Christian Persch, bug 609564.
2010-02-21 16:04:21 -05:00
Matthias Clasen
ecb45f4382 Fix an oversight
_Always_ explicitly compare strcmp to 0... this was pointed out in
bug 610484 by Christian Persch.
2010-02-21 15:28:04 -05:00
Colin Walters
5047fd7f68 [gutf8.c] Add a bit of documentation to UNICODE_VALID 2010-02-19 16:39:26 -05:00
Ryan Lortie
ed3c914cdb Merge the main public API of GVariant 2010-02-19 10:52:03 -05:00
Ryan Lortie
b899bfc741 GVariant: create child instance from its own data
also: white-space fix in the serialiser
2010-02-15 19:38:00 -05:00
Ryan Lortie
e66d66c555 GVariant: lock before freeing, to avoid assert 2010-02-11 16:53:56 -05:00
Ryan Lortie
1e655eb02c merge GVariant 2010-02-10 11:35:01 -05:00
Ryan Lortie
bd6a88aef7 gstrfuncs.h: needs gmacros.h for G_BEGIN_DECLS 2010-02-08 00:44:32 -05:00
Ryan Lortie
e04c9c699c add missing #include "config.h" 2010-02-07 15:43:06 -05:00
Ryan Lortie
218c691ca3 remove #include <glib.h> from some .c files
include individual headers instead
2010-02-07 03:14:28 -05:00
Ryan Lortie
ea2917b01f gurifuncs.c: #include "string.h" -> <string.h> 2010-02-07 03:08:08 -05:00
Ryan Lortie
9f30337573 GVariantTypeInfo: free hash table when not in use 2010-02-07 02:52:07 -05:00
Ryan Lortie
80538aba7e merge the GVariant serialiser 2010-02-06 10:26:02 -05:00
Ryan Lortie
eea6042f5f GMappedFile: minimal changes to support GBuffer
Just reorganise the GMappedFile struct to be binary compatible with
GBuffer.  If GBuffer becomes public later then we can revisit this.
2010-02-06 10:19:29 -05:00
Ryan Lortie
3f4b7f6d37 add private GBuffer type 2010-02-06 10:18:08 -05:00
Ryan Lortie
5e753d6abc rename test: gvarianttype -> gvariant
More test cases will be added to this file.
2010-02-04 20:32:39 -05:00
Tor Lillqvist
021643cda4 Clarify use of struct stat on Windows 2010-02-04 19:59:05 +02:00
Tor Lillqvist
5589d2b455 Internally use the _stati64 API explicitly on Windows
Avoids warnings and confusion when compiling with MSVC.
2010-02-04 19:58:55 +02:00
Ryan Lortie
bfd60d8835 GVariantType test case: assert all memory freed
Make sure we've freed all TypeInfos at the end of the test.
2010-02-04 09:08:51 -05:00
Ryan Lortie
6d6d7a8bb2 GVariantTypeInfo tweaks
1) always emit ending type FIXED for fixed sized items

    The serialiser needs to know if it dealing with a fixed sized item
    in case the serialised data is corrupt and the item has the wrong
    size.

  2) add a macro that will be used by test cases to check that all
     memory has been freed.
2010-02-04 09:08:51 -05:00
Tor Lillqvist
154a5314be Update copyright years 2010-02-04 00:12:50 +02:00
Krzesimir Nowak
33b011ce7d Add checks for NULL pointer in arrays.
Fixes: Bug 599197 -  array ref and unref functions crash on NULL
array.

* garray.c: Added safety guards to all public functions, which did
not have them earlier. Now when NULL is passed to them, they will
issue a warning and return, instead of segfaulting.
2010-02-03 21:48:39 +01:00
Ryan Lortie
0ac2277b49 GVariantTypeInfo changes
- rename 'type' in MemberInfo to 'type_info'
 - add 'ending_type' field to MemberInfo
 - document how to find the ending
2010-02-02 23:39:21 -05:00
Ryan Lortie
e2bc5c2112 g_bit_lock: remove double variable declarations
Remove double declaration of local static variables used for futex
emulation.

Problem found by Haakon Sporsheim <haakon.sporsheim@gmail.com>.
2010-02-01 18:32:34 -05:00
Dan Winship
27a080537e ghostutils: Fix a crash and add some tests
https://bugzilla.gnome.org/show_bug.cgi?id=608743
2010-02-01 18:12:39 -05:00
Ryan Lortie
3443f47ddf G{Byte,Ptr,}Array: move docs from tmpl to .c 2010-02-01 12:39:29 -05:00
Ryan Lortie
501a2906d3 GList, GSList: move docs from tmpl to .c 2010-02-01 12:39:24 -05:00
Ryan Lortie
4bdf7d12a8 GIOChannel: move docs from tmpl to .c 2010-02-01 10:28:39 -05:00