* glib/ghash.c: changed "#GHashTableIterator" to "#GHashTableIter"
in the documentation-comments above g_hash_table_foreach_remove()
and g_hash_table_foreach_steal() to correctly name and link to
GHashTableIter. This affects the GNOME documentation website
as well, so further steps are likely necessary beyond this subproject.
* ChangeLog modified to reflect this.
-Joseph (solarion)
svn path=/trunk/; revision=7631
2008-10-19 Michael Natterer <mitch@imendio.com>
Bug 556186 – gpoll.h breaks gmain.h inclusion
* glib/gpoll.h: different fix: disallow direct inclusion
unconditionally again but make an exception if included from
gmain.h to maintain compatibility.
svn path=/trunk/; revision=7615
2008-10-13 Sven Herzberg <sven@imendio.com>
Bug 556101 – static mutex yields warnings with g++
Reviewed by Tim Janik
* configure.in: added an intermediate cast to gpointer
svn path=/trunk/; revision=7598
2008-10-10 Behdad Esfahbod <behdad@gnome.org>
Bug 551355 – [PATCH] Make glib build with libtool 2.2
* autogen.sh: Accept libtool 2.2. We are moving towards having
it working.
svn path=/trunk/; revision=7593
2008-10-10 Matthias Clasen <mclasen@redhat.com>
Bug 552861 – glib-2.0.m4 calls system(3) without storing its result
* m4macros/glib-2.0.m4: Cosmetic change to make -Werror happy.
Patch by Andreas Köhler
svn path=/trunk/; revision=7584
2008-10-08 Tor Lillqvist <tml@novell.com>
Bug 554790 - g_convert() misbehaves with winiconv versions
* glib/win_iconv.c (kernel_mbtowc): If converting from ASCII,
explicitly check for and reject 8bit chars. MultiByteToWideChar()
doesn't, at least not on XP.
svn path=/trunk/; revision=7578
* glib/gfileutils.c: change g_format_size_for_display API doc to
explicitly say that the returned string has to be freed. Change
spelling of "newly allocated" to "newly-allocated" in g_file_read_link
API doc to be more consistent with what is done in that file.
svn path=/trunk/; revision=7572
2008-10-01 David Zeuthen <davidz@redhat.com>
* gdesktopappinfo.c (expand_macro): If possible, always pass FUSE
file:// URIs (such as '/home/davidz/.gvfs/sftp on foo/file.avi')
instead of the gio URI (such as sftp://foo/file.avi) when using
g_app_info_launch() and friends. With a sufficiently recent gvfs,
apps using gio+gvfs will map the FUSE file:// URI back to the gio
URI (and thus bypass the fuse daemon) thanks the patch from bug
#530654. Since Nautilus is an user of g_app_info_launch() it
means that non-gio POSIX apps, such as mplayer, will Just Work(tm)
when launced via the file manager. Win. Fixes bug #528670.
* gappinfo.c: Add some notes about the FUSE POSIX URI <-> GIO URI
mapping to the description of GAppInfo.
2008-10-01 David Zeuthen <davidz@redhat.com>
* README.in: Add "Notes about glib 2.20" section detailing the
ramifications of the patch from bug #528670.
svn path=/trunk/; revision=7566
2008-09-30 Behdad Esfahbod <behdad@gnome.org>
Bug 554092 – glib doesn't return G_FILE_ERROR_NOENT et al on OS X
* glib/giounix.c (g_io_unix_read), (g_io_unix_write),
(g_io_unix_seek), (g_io_unix_close), (g_io_unix_set_flags),
(g_io_unix_get_flags), (g_io_channel_new_file):
Like mclasen says: "well, thats the way errno works...,
save it or loose it". Save errno.
svn path=/trunk/; revision=7565
2008-09-30 Tor Lillqvist <tml@novell.com>
* glib/gprintf.c
* glib/gnulib/vasnprintf.c: Don't define _GNU_SOURCE on Windows,
as _GNU_SOURCE has unintended side effects when compiling against
newest mingw headers.
svn path=/trunk/; revision=7563
* glib/gtestutils.h (g_assert_no_error, g_assert_error): Macros to
assert that a GError is not set, or else is set to a particular
error.
* glib/gtestutils.c (g_assertion_message_error): utility for
those macros
* glib/tests/keyfile.c:
* tests/asyncqueue-test.c:
* tests/bookmarkfile-test.c:
* tests/convert-test.c:
* tests/file-test.c: Use g_assert_error/g_assert_no_error
svn path=/trunk/; revision=7555
* glib/gthreadpool.c (wakeup_thread_marker): make this a "const
gpointer" rather than a gconstpointer to avoid warnings later
* glib/pcre/pcre_ucp_searchfuncs.c:
* glib/pcre/pcre_valid_utf8.c: #include "config.h"
* glib/tests/printf.c (test_d): fool gcc into not warning about
some printf format strings that we know are dubious
svn path=/trunk/; revision=7552
2008-09-25 Tor Lillqvist <tml@novell.com>
Bug 553820 - gpoll.c: undeclared identifier
* glib/gmain.c
* glib/gpoll.c: Make the g_poll() function non-static also on
Windows. Prefix an underscore to the g_main_poll_debug variable
and make it non-static in gmain.c so that it can be used in
gpoll.c. Add back missing variable declaration.
svn path=/trunk/; revision=7542
2008-09-25 Tor Lillqvist <tml@novell.com>
* glib/gspawn-win32.c (do_spawn_with_pipes) (do_spawn_directly):
Just ignore the child_setup function, never call it. The is no
situation in which it could be useful on Windows. Do print a
warning, like before.
* glib/gspawn.c (g_spawn_async_with_pipes): Corresponding change
in documentation.
svn path=/trunk/; revision=7540
2008-09-24 Sven Herzberg <sven@imendio.com>
Be a little more explcit in the docs. Includes Owen's requested
changes.
* glib/gmain.c: improved documentation for g_source_attach() and
g_source_destroy()
svn path=/trunk/; revision=7539
2008-09-23 Michael Natterer <mitch@imendio.com>
* glib/glib.h: #include <glib/gpoll.h>
* glib/gpoll.h: #error out if gpoll.h is included directly.
* glib/gpoll.c: remove trailing whitespace.
svn path=/trunk/; revision=7537
* glib/gpoll.c (g_poll): Move this out of gmain.c and make it part
of the public API. (Part of Bug 505361 - gunixinputstream.c assumes
poll() available.)
svn path=/trunk/; revision=7536
2008-09-23 Tor Lillqvist <tml@novell.com>
* glib/gmain.c (poll_rest) [Win32]: Fix embarrassing bug: I was
passing an incorrect third parameter to memmove(), had forgotten
to multiply by the size of the table entry. Just use a for loop
instead, clearer. Odd I didn't notice when testing this code.
svn path=/trunk/; revision=7533
2008-09-19 Hans Petter Jansson <hpj@novell.com>
Rewrite most of GHashTable to use open addressing with quadratic
probing instead of chaining. This has the potential to reduce memory
fragmentation significantly, while being slightly faster due to
better locality and no need to call alloc/free functions for nodes.
Benchmarks suggest it also uses less memory overall.
* glib/ghash.c (prime_mod): Table of suitable primes for
initial-probe distribution.
(g_hash_table_set_shift): New function.
(g_hash_table_find_closest_shift): New function.
(g_hash_table_set_shift_from_size): New function.
(g_hash_table_lookup_node_for_insertion): New function.
(g_hash_table_lookup_node): Rewritten to return node index instead of
pointer, use quadratic probe on flat table, and not return insertion
data. The latter saves some computation for read-only lookups.
(g_hash_table_remove_node): Rewrite to take a pointer directly to the
node structure to remove, and clear that. Remove unlinking code.
(g_hash_table_remove_all_nodes): Rewrite to not clear nodes
individually, but en masse using memset () after potentially calling
notify functions.
(iter_remove_or_steal): Use new data structure and algorithm. Vastly
simplified - now just a call to g_hash_table_remove_node ().
(g_hash_table_resize): New resize code, re-indexing with new prime
and cleaning up tombstones.
(g_hash_table_maybe_resize): Table may hold 8 buckets minimum, no less
than 1/4 load excluding tombstones, and no more than 15/16 load
including tombstones. These numbers are the results of a lot of
benchmarking with multiple complex applications, and should not be
changed lightly.
(g_hash_table_iter_next)
(g_hash_table_lookup)
(g_hash_table_lookup_extended)
(g_hash_table_insert_internal)
(g_hash_table_remove_internal)
(g_hash_table_foreach_remove_or_steal)
(g_hash_table_foreach)
(g_hash_table_find)
(g_hash_table_get_keys)
(g_hash_table_get_values): Use new data structure and algorithm,
fairly trivial changes.
svn path=/trunk/; revision=7518
2008-09-19 Tor Lillqvist <tml@novell.com>
* glib/gutils.c (_glib_get_dll_directory)
* glib/gspawn-win32.c (do_spawn_with_pipes): Be a bit less
restrictive, look for the helper programs in the same folder where
the GLib DLL is, not necessarily in a "bin" subfolder of the top
GLib installation folder.
svn path=/trunk/; revision=7511
2008-09-16 Tor Lillqvist <tml@novell.com>
* glib/gtimer.c (g_time_val_to_iso8601): time_t is 64 bits in all
the newer Microsoft C libraries, not just 64-bit ones. So to avoid
crash if compiled with newer MSVSes, use a separate time_t
variable in all cases on Windows.
svn path=/trunk/; revision=7496
2008-09-16 Tor Lillqvist <tml@novell.com>
* glib/gbacktrace.h: Define G_BREAKPOINT() also for 64-bit MSVC,
using the __debugbreak() intrinsic.
svn path=/trunk/; revision=7495
2008-09-15 Tor Lillqvist <tml@novell.com>
* config.h.win32.in: Update to match what the configure script
produces. Just for uniformity, only commented out parts affected.
svn path=/trunk/; revision=7489
2008-09-13 Tor Lillqvist <tml@novell.com>
* glib/gutils.h
* glib/gwin32.h: Deprecate G_WIN32_DLLMAIN_FOR_DLL_NAME(),
g_win32_get_package_installation_directory() and
g_win32_get_package_installation_subdirectory() as their
documentation has warned for a while. Sorry that I forgot to do
this before 2.18.0.
* glib/gwin32.c (g_win32_get_package_installation_directory):
Print a warning if a non-NULL package parameter is passed to this
function, as that is deprecated usage, as the documentation says.
svn path=/trunk/; revision=7480
2008-09-11 Matthias Clasen <mclasen@redhat.com>
Bug 548321 – <string.h> is not included in gi18n-lib.h
* glib/gi18n.h:
* glib/gi18n-lib.h: Include string.h, since strlen is used in
the macros. Pointed out by Ignacio Casal Quinteiro
svn path=/trunk/; revision=7455
2008-09-09 Matthias Clasen <mclasen@redhat.com>
Bug 551228 – G_STRFUNC on recent Sun compiler should be expanded to
__func__ rather than '???'
* glib/gmacros.h: Don't use glibconfig.h defines in gmacros.h,
as the comment up top says. Instead look at __STDC_VERSION__.
Problem reported by Lin Ma.
svn path=/trunk/; revision=7451
2008-09-09 Matthias Clasen <mclasen@redhat.com>
Bug 523463 – Core dump in gmain.c:2482:IA__g_main_context_check()
* glib/gmain.c (g_main_context_check): Be robust against setting
event fields on the fly, as e.g. happens in linc. Tracked down
by Paul Smith, fix proposed by Owen Taylor.
svn path=/trunk/; revision=7447
2008-08-31 Emmanuele Bassi <ebassi@gnome.org>
Bug 550096 – GBookmarkFile parser is not forward compatible
* glib/gbookmarkfile.c:
(parse_bookmark_element), (parse_application_element),
(parse_mime_type_element), (parse_icon_element): Relax the
attributes checking of the GBookmarkFile parser for the
attributes that the desktop bookmark file specification
defines and controls. This allows adding new attributes to
the existing elements in newer versions without breaking the
parser in older ones.
svn path=/trunk/; revision=7418
2008-08-28 Ryan Lortie <desrt@desrt.ca>
Fixup for test case in previous commit.
* glib/tests/strfuncs.c: don't fail if we can't open the test data.
This happens if $(builddir) != $(srcdir) (like when doing 'make
distcheck'). Quick workaround for now until #549783 can be fixed.
svn path=/trunk/; revision=7415
2008-08-28 Ryan Lortie <desrt@desrt.ca>
[REVERT] Bug 548612 – g_strstr_len() should use memmem when available
* glib/gstrfuncs.c (g_strstr_len): fix off-by-one memory access error
* glib/tests/strfuncs.c (test_bounds): add some new test cases that
would catch problems like this
* glib/tests/4096-random-bytes: test data for the previous
* glib/tests/Makefile.am: add previous to EXTRA_DIST
svn path=/trunk/; revision=7414
2008-08-28 Ryan Lortie <desrt@desrt.ca>
[REVERT] Bug 548612 – g_strstr_len() should use memmem when available
* configure.in:
* glib/gstrfuncs.c (g_strstr_len): revert use of memmem (see bug)
svn path=/trunk/; revision=7413
2008-08-28 Michael Natterer <mitch@imendio.com>
* glib/gstrfuncs.c (g_parse_long_long): make "endptr" const since
it's always a pointer into the const string passed. Remove some
casting to (gchar*) in this function.
(g_ascii_strtoull)
(g_ascii_strtoll): cast "endptr" to (const gchar**) here when
passing it to above function.
svn path=/trunk/; revision=7410
2008-08-28 Bastien Nocera <hadess@hadess.net>
Bug 548612 – g_strstr_len() should use memmem when available
* glib/tests/strfuncs.c (test_strstr):
* tests/string-test.c (main): Patch by Paolo Borelli
<pborelli@katamail.com> to move the tests to the right place,
and add more tests
* glib/gstrfuncs.c (g_strstr_len): Fix problem with memmem ignoring
nul-terminators in strings, and using the haystack_len instead
svn path=/trunk/; revision=7409
2008-08-28 Bastien Nocera <hadess@hadess.net>
Bug 548612 – g_strstr_len() should use memmem when available
* configure.in: detect whether memmem is available in the C library
* glib/gstrfuncs.c (g_strstr_len): use memmem for g_strstr_len() if
available in it's available, as it could be optimised by the C library
* tests/string-test.c (main): Add a few tests for g_strstr_len()
svn path=/trunk/; revision=7407
2008-08-27 Tor Lillqvist <tml@novell.com>
* glib/giowin32.c: Stylistic changes. Plug an unlikely memory leak
that occurred in create_thread() if closing the thread handle
failed. Add more error messages to g_io_win32_free() that are
printed only when debugging. Plug handle leak, a socket channel's
event was never closed.
svn path=/trunk/; revision=7405
2008-08-27 Tor Lillqvist <tml@novell.com>
* config.h.win32.in: Should not define HAVE_DIRENT_H when
compiling with MSVC, as the only file which checks HAVE_DIRENT_H
is gdir.c, and that includes the dirent.h and wdirent.c from
build/win32/dirent explicitly anyway when being compiled with
MSVC.
svn path=/trunk/; revision=7403
2008-08-22 Björn Lindqvist <bjourne@gmail.com>
Bug 523939 – Example program for GValue
* gobject/gvalue.c: Add code example that demonstrates GValue's
features.
svn path=/trunk/; revision=7387
2008-08-21 Tor Lillqvist <tml@novell.com>
* glib/giowin32.c: Don't bother compiling the binary
compatibility g_io_channel_win32_new_stream_socket()
function that has not been mentioned in any header since 2.0 on
Win64.
* glib/glib.symbols: Mark it, too, private, and don't export it on
Win64.
svn path=/trunk/; revision=7384
2008-08-21 Tor Lillqvist <tml@novell.com>
* glib/gmain.c: Rework the g_poll() implementation on Windows to
match poll() semantics more closely. This makes the test program
in bug #468910 behave better and doesn't seem to break anything
else.
If polling several GPollFDs, i.e. messages and/or waitable
handles, first check if one or several of them are in the
signalled state right away, and return indication for all that are
in that case.
If not, then poll with timeout and indicate only the single one
that the Win32 wait function tells us as before.
Remove unnecessary ifdefs, as we always have G_MAIN_POLL_DEBUG
defined on Windows.
Initialise g_main_poll_debug in g_main_context_new() so we have it
before testing it in one case.
Don't add several copies of a handle in the array of handles to
wait for. The documentation says this is not allowed, although it
did seem to work fine in practise. But do as the documentations
says anyway.
svn path=/trunk/; revision=7375
2008-08-20 Tor Lillqvist <tml@novell.com>
Bug 500246 - Bug fixes for giowin32
* glib/giowin32.c (read_thread) (write_thread): Change the nbytes
variables to signed.
(g_io_channel_win32_make_pollfd): Fix an obvious error in the file
descriptor case leftover after the patch from bug #333098 on
2006-03-02. Thanks to Marcus Brinkmann.
svn path=/trunk/; revision=7373
2008-08-20 Tor Lillqvist <tml@novell.com>
Bug 324234 - Using g_io_add_watch_full() to wait for connect() to
return on a non-blocking socket returns prematurely
Bug 548278 - Async GETs connections are always terminated
unexpectedly on Windows
* glib/giowin32.c: Add one more state variable to the
GIOWin32Channel struct, ever_writable. Initialise it to FALSE, set
to TRUE when the WSAEventSelect() indicates FD_WRITE, and never
reset to FALSE.
Don't do the WSASetEvent() in g_io_win32_prepare() unless
ever_writable is TRUE. Don't automatically indicate G_IO_OUT in
g_io_win32_check() unless ever_writable is TRUE.
This fixes the behaviour of the test case program in bug #548278,
and the "Testcase for the spurious OUT event bug" in bug
#324234. It also doesn't seem to break anything. Not that there is
any exhaustive test suite...
Add a comment with a list of bugs that are related to the code in
this file.
svn path=/trunk/; revision=7372
2008-08-15 12:41:26 Tim Janik <timj@imendio.com>
* glib/gtestutils.c: changed assertion messages, so older emacsen
can also detect failing source file and line, fixes:
Bug 502498 – Test framework assertion failures should follow gcc error format
svn path=/trunk/; revision=7358
2008-08-13 Matthias Clasen <mclasen@redhat.com>
Bug 547637 – unconditional #include of sys/statfs.h in configure
impedes detection of statfs things if non-existant
* configure.in: Protect the statfs.h include by guards.
svn path=/trunk/; revision=7352
2008-08-12 Federico Mena Quintero <federico@novell.com>
* glib/gi18n-lib.h: In the #error about having to define
GETTEXT_PACKAGE, add a hint about a possibly-missing config.h.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=7343
2008-08-08 Ryan Lortie <desrt@desrt.ca>
* tests/markups/fail-32.gmarkup: change  to � since the
former is no longer a failure.
svn path=/trunk/; revision=7328
2008-08-08 Ryan Lortie <desrt@desrt.ca>
* glib/gmarkup.c: previously the parser only accepted character
references for \t \n and \r (as per XML 1.0); now it accepts all
of  .. .
svn path=/trunk/; revision=7326
2008-08-04 Tor Lillqvist <tml@novell.com>
* glibconfig.h.win32.in: Make the union _GSystemThread::data array
8 bytes on Win64. Not that it matters as the union contains a
pointer also anyway, but for equivalence with the configure-
generated glibconfig.h
svn path=/trunk/; revision=7309