* glib/gmessages.h (g_return_if_fail):
(g_return_val_if_fail): Use G_LIKELY. (#69022)
* glib/gmacros.h (G_LIKELY):
(G_UNLIKELY): New macros for hinting the compiler about the
expected result of expressions. For gcc 3.x, define these
using __builtin_expect. (#69022)
* glib/tmpl/macros_misc.sgml: Document G_LIKELY, G_UNLIKELY.
* glib/glib-sections.txt: Add G_LIKELY, G_UNLIKELY.
Tue Nov 19 14:38:18 2002 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_ascii_strtoull): Fix
strtull/strtoull type in docs (#99012, Morten
Welinder.) Add copyright information for code
taken from GNU libc.
2002-11-18 Tor Lillqvist <tml@iki.fi>
* glib/gspawn-win32.c (do_spawn_with_pipes): Do handle
G_SPAWN_DO_NOT_REAP_CHILD after all, similarily as on Unix. If the
flag is not set, don't call DuplicateHandle() on the handle
returned by the helper process, and set the "child pid" returned
to the caller to zero. Close the handle to the helper process in
all cases.
* glib/gspawn.c (g_spawn_async_with_pipes): Document Windows
behaviour of G_SPAWN_DO_NOT_REAP_CHILD.
2002-11-18 Tor Lillqvist <tml@iki.fi>
[Win32] Fix the asynchronous g_spawn* to return the process handle
of the started program properly. (Note: not the process id. The
spawn*() functions in the C runtime return the created process's
handle. There doesn't seem to be any way to get the process id of
a child process if you have the handle. But then, the process
handle usually is more useful anyway.)
* glib/gspawn-win32-helper.c (WinMain): If the spawning of the
child process succeeded, and if asynchronous spawn (P_NOWAIT),
write the result handle up to the parent process, waiting to read
it in do_spawn_with_pipes().
* glib/gspawn-win32.c (do_spawn): Use return value from spawning
the helper. If it is -1 the helper wasn't found or couldn't be run
for some reason. Otherwise it is the helper's process handle.
(g_spawn_async_with_pipes): Pass the child_pid parameter on to
do_spawn_with_pipes().
(do_spawn_with_pipes): Take also a child_pid parameter. If
do_spawn() returned -1, fail immediately. Otherwise make the
handle passed to us by the helper process into a handle valid in
this process by calling DuplicateHandle().
2002-11-17 Tor Lillqvist <tml@iki.fi>
* glib/gspawn-win32.c (g_spawn_async_with_pipes): Ignore the
G_SPAWN_DO_NOT_REAP_CHILD flag, can't be meaninfully implemented
on Windows, at least not now. Always pass dont_wait as TRUE to
do_spawn_with_pipes(). The semantics of the dont_wait parameter is
very different from the semantics of the intermediate_child
parameter to fork_exec_with_pipes() in the Unix version. This
fixes a serious bug, g_spawn_async() in fact behaved
synchronously.
(do_spawn_with_pipes, do_spawn): Rename from
fork_exec_with_pipes() and do_exec(), those names were from the
Unix bersion, and misleading.
(close_and_invalidate): Don't try to close invalid fds.
* glib/gspawn.c (g_spawn_async_with_pipes): Add warning about
Windows behaviour. There is no fork(), so the child_setup()
function is in fact called in the parent.
* glib/gspawn-win32-helper.c (WinMain): Insert spaces in argv
debugging output.
* tests/spawn-test-win32-gui.c: New file. Test program to be
linked as a GUI application. Behaves differently depending on how
invoked (by spawn-test).
* tests/spawn-test.c (run_tests): On Win32, run the
spawn-test-win32-gui program, too, in several ways, synchronously
and asynchronously.
* tests/Makefile.am: Corresponding change.
Thu Nov 7 19:32:26 2002 Owen Taylor <otaylor@redhat.com>
* glib/gutils.[ch] (g_set/get_application_name):
Patch from Havoc Pennington to add functions for
setting and getting a human readable application
name.
* configure.in: Up to version 2.1.3, since we'll
need to depend on last addition for GTK+.
Mon Nov 4 14:41:48 2002 Owen Taylor <otaylor@redhat.com>
* glib/gbsearcharray.c: Include config.h
so DISABLE_MEMPOOLS actually has an effect.
(#96437, Morten Welinder)
* tests/uri-test.c: Include <config.h>
Mon Nov 4 14:42:36 2002 Owen Taylor <otaylor@redhat.com>
* gtype.c gsignal.c gvaluearray.c: Include config.h
so DISABLE_MEMPOOLS actually has an effect.
(#96437, Morten Welinder)
* gsignal.c: Conditionalize definition of g_handler_ts
on DISABLE_MEM_POOLS (#96437)
Mon Nov 4 14:45:24 2002 Owen Taylor <otaylor@redhat.com>
* gthread-posix.c gthread-solaris.c: Include <config.h>
2002-11-02 Daniel Elstner <daniel.elstner@gmx.net>
* glib/giochannel.c (g_io_channel_write_chars): Fix left_len calculation in the from UTF-8 to UTF-8 case: left_len should be the number of bytes left in the input buffer rather than channel->write_buf. (#96373)
2002-10-27 Tor Lillqvist <tml@iki.fi>
* configure.in (G_MODULE_LDFLAGS): Don't set on Win32, only causes
trouble.
* glib/gmain.c (g_poll): Fix for bug reported by Herman Bloggs
(http://mail.gnome.org/archives/gtk-devel-list/2002-October/msg00101.html)
and others. We waited for events only for GPollFDs whose events
field had G_IO_IN set. We need to wait also for events for
GPollFDs that have just G_IO_OUT set. Non-blocking sockets in the
process of being connect()ed are one such case. Also silence a
couple of gcc warnings.
Fri Oct 18 13:41:30 2002 Manish Singh <yosh@gimp.org>
* glib/giochannel.c (g_io_channel_read_line_backend): avoid
creating negative values out of unsigned values using MAX,
check to see if the result would be positive before doing
the calculation.
Tue Oct 15 15:28:47 2002 Manish Singh <yosh@gimp.org>
* tests/iochannel-test.c: use gsize instead of int where appropriate
(64-bit cleanliness fix). Removed leftover line_term cruft.
Sat Oct 12 21:30:41 2002 Tim Janik <timj@gtk.org>
* merged up from glib-2-0:
* glib/gstrfuncs.c (g_ascii_strtod): fix comment.
(g_ascii_strtoull): new function, acting like strtoull(3) in the C
locale.
* glib/gscanner.[hc]: fix 32bit issues with integer parsing and
support storing 64bit values in GTokenValue by
using g_ascii_strtoull().
Thu Oct 10 23:27:02 2002 Tim Janik <timj@gtk.org>
* glib/gscanner.c (g_scanner_msg_handler): if input_name is NULL,
print out "<memory>" instead of completely skipping input specification
and thusly loosing error line information.
2002-09-29 Tor Lillqvist <tml@iki.fi>
* configure.in: Instead of forcing -fnative-struct into CFLAGS
when using gcc for Win32, check for gcc version 3.x which uses
-mms-bitfields instead. Also check if either of these switches is
actually available at all, and warn if not. Thanks to Soren
Andersen for the inspiration.
2002-09-23 Arvind Samptur <arvind.samptur@wipro.com>
* glib/gspawn.c (fork_exec_with_pipes) : when the child fails
we need to reap it to avoid a zombie. This would
happen in case of g_spawn_sync. Fixes#92658
2002-08-06 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib/gmain.c: Factor out g_main_context_init_pipe from
g_main_context_new to initialize the wakeup pipe of a
context. Call that function from g_main_context_new if threads are
initialized and for all contexts when threads are initialized
in g_main_thread_init. (#86872)
* gthread/gthread-impl.c: Call g_main_thread_init. (#86872)
2002-08-06 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib/gthread.c: Set the normal PID surrogate priority according
to getpid() to avoid errors for niced processes. (#86116)
* gthread/gthread-impl.c, gthread/gthread-posix.c,
gthread/gthread-solaris.c: Do the same for the posix/dce
implementation. Solaris still needs to set priority of the main
thread, because all unbound threads will schedule according to
that value and it defaults to 0 (the minimal value).
* glib/gfileutils.c: Clarify the behavior of g_build_path()
for empty elements and for leading and trailing copies
of the separator in the docs.
* glib/gfileutils.c: Fix problems with leading elements
consisting only of "/" characters. (#85928, Guillaume Chazarain)
* tests/strfunc-test.c (main): Add more test cases
for g_build_filename().
* glib/gunicode.h:
* glib/gutf8.c (g_utf8_strreverse): New function to revert
a utf8 string.
* glib/gpattern.c (g_utf8_reverse): Gone, replaced by
g_utf8_strreverse. (#87725)
Thu Jul 25 20:57:20 2002 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_channel_read_line): Fix
docs for @str_return to conform to the main docs
and the implementation as to whether the terminator
is included. (#87964, Jacob Berkman)
Thu Jul 25 19:52:41 2002 Owen Taylor <otaylor@redhat.com>
* glib/guniprop.c (real_tolower): Handle the
end of the string properly when max_len is set.
(#88545, Morten Welinder.) Rename the next_t
variable to next_type to make cc-mode happy.
* glib/gconvert.c (g_iconv_open): Fix missing
label from previous commit.
Thu Jul 25 19:12:43 2002 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_channel_set_encoding): Clarify
that only one of the conditions listed in the docs
need to be true, not all of them. (#87176,
Sebastian Rittau)
* glib/giochannel.c (g_io_channel_read_line): Fix
description of the return value. (#87754, Manuel Clos)
Thu Jul 25 19:02:53 2002 Owen Taylor <otaylor@redhat.com>
* glib/gmain.c (g_timeout_add): Remove reference
in the docs to @notify parameter. (#87768,
Manuel Clos)
Thu Jul 25 17:57:07 2002 Owen Taylor <otaylor@redhat.com>
* glib/gconvert.c (g_iconv_open): Document the
(GIConv)-1 return value on failure. (#87559,
Jarek Dukat)
* glib/gconvert.c (g_iconv_open): Fix potential
problems with the assumption that (GIConv)(iconv_t)-1
is the same as (GIConv)-1.
2002-07-04 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN
throughout the files, which didn't already have them. (#87312)
2002-07-03 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* configure.in: Made the thread flags determination tests first
check for the canonical form -pthread[s], then for other
possibilities. Also recognize some more platforms. Modeled after
patch from Miroslaw Dobrzanski-Neumann <mne@mosaic-ag.com>
(#77981).
2002-07-03 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* configure.in: Fixed bugs in posix thread priority
resolution. Also added AIX priorities. Fix from
Laurent Vivier <Laurent.Vivier@bull.net>. (#82599)
2002-07-03 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gthread/gthread-solaris.c: Use thr_min_stack() instead of
sysconf (_SC_THREAD_STACK_MIN). if stack_size is 0 on entry to
g_thread_create_solaris_impl, also pass 0 to thr_create. Otherwise
the stack might be to small for any nontrivial thread. Discovered
on intel-solaris by Rajkumar Sivasamy <rajkumar.siva@wipro.com>.
2002-07-02 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* configure.in: Improve checks for dce/posix threads to also do
the right thing, if the thread functions are not declared in the
pthread.h. Idea from Miroslaw Dobrzanski-Neumann
<mne@mosaic-ag.com> in #77981.
2002-07-01 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib/garray.h: Add parenthesis to protect macro
argument. Spotted by Sam Couter" <sam@topic.com.au>. (#86826)
2002-06-28 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib/gmessages.h (g_assert, g_assert_not_reached,
g_return_if_fail, g_return_val_if_fail): In case of
G_DISABLE_ASSERT replace "G_STMT_START{ }G_STMT_END" with
"G_STMT_START{ (void)0; }G_STMT_END", because the former chokes
gcc prior to 3.0. (#86664)
Thu Jun 13 16:12:04 2002 Owen Taylor <otaylor@redhat.com>
* glib/gmain.c (struct _GTimeoutSource): Make
interval unsigned to match g_timeout_source_new().
(#82624, Tim Janik.)
* glib/gmain.c (g_timeout_prepare): Add some
extra gymnastics to avoid signed/unisgned integer
overflows.
Tue Jun 11 17:03:39 2002 Owen Taylor <otaylor@redhat.com>
* tests/patterntest.c (test_compilation)
* glib/gmem.c (profiler_try_realloc): A couple
of 64-bit printf format fix from George Lebl.
* glib/gconvert.c (open_converter): Fix gsize/gint
mixup for g_iconv() arguments.
* glib/gwin32.c (g_win32_get_package_installation_directory):
Replace homegrown "hash" entity by standard ISO entity "num".
* gobject/gobject-docs.sgml:
* glib/glib-docs.sgml:
* glib/tmpl/macros.sgml:
* glib/tmpl/string_utils.sgml: Replace homegrown "nbsp", "hash"
and "percent" entities by standard ISO entities "nbsp", "num" and
"percnt".
Wed May 22 15:40:47 2002 Owen Taylor <otaylor@redhat.com>
* README.in: Remove notes about now-fixed-bugs.
* m4macros/glib-gettext.m4 acinclude.m4: Get rid
of AC_MSG_NOTICE() usage, since some broken systems
(Hi Debian!) might not be using autoconf-2.5x for
downstream packages even though we require it for
glib itself.
* INSTALL.in: Add a note about installing extra
converters for Solaris.
* glib/gutils.h (g_bit_nth_msf): Fix termination
condition. (#82582, Paolo Molaro)
Wed May 22 15:24:04 2002 Owen Taylor <otaylor@redhat.com>
* README.translators: Add from GTK+.
* *.po: Convert all po files to UTF-8.
Mon May 20 18:02:46 2002 Owen Taylor <otaylor@redhat.com>
* configure.in: Move iconv tests before gettext
checks. (#81999)
* m4macros/glib-gettext.m4 acinclude.m4: If we can't
link to gettext, try adding in -liconv. (#80076,
Boyd Lynn Gerber)
* m4macros/glib-gettext.m4 acinclude.m4: Suppress
warnings about xgettext not being GNU gettext when
libintl wasn't found at all.
(#79016, Andrew P. Lentvorski, Jr.)
Mon May 20 15:35:59 2002 Owen Taylor <otaylor@redhat.com>
* glib/gfileutils.c (get_contents_regfile): Fix double
close of file descriptor on error. (#82139, Wayne Schuller)
* glib/gspawn.c (close_and_invalidate): Don't close
fd's that have already been closed. (Fix from Michael
Meeks, #81959)
* glib/giochannel.c (g_io_channel_close): If not flushing,
dump the contents of the write buffers, so we won't try
to write them to an invalid fd later. (Patch from Ron Steinke,
fixing #78290, Andreas Persenius.)
Sat May 18 00:21:51 2002 Tim Janik <timj@gtk.org>
[merged from stable]
* glib/gscanner.c (g_scanner_unexp_token): fix missing cases for
expected_token.
2002-05-14 Alex Larsson <alexl@redhat.com>
* glib/gstrfuncs.c:
* glib/gstrfuncs.h:
New functions g_str_has_suffix and g_str_has_prefix.
* tests/string-test.c: (main):
Test the new functions.
Mon May 13 11:55:33 2002 Owen Taylor <otaylor@redhat.com>
* configure.in acglib.m4: If sizeof(int) == sizeof(long)
run compilation tests to determine which way gsize should
be defined. (#74413, reported by Miroslaw Dobrzanski-Neumann)
Mon May 13 11:42:23 2002 Owen Taylor <otaylor@redhat.com>
* glib/libcharset/*: Update from libcharset CVS.
Includes additional encodings for Solaris (#80396,
Qingjiang Yuan)
* configure.in: Add getc_unlocked to CHECK_FUNCS().
* glib/gmessages.c (strdup_convert): If
g_convert_with_fallback() fails, print the error
message to stderr the first time, then return
the original string. (#78197)
2002-05-08 Michael Natterer <mitch@gimp.org>
* configure.in: fixed yesterdays fix for cross compiling: simply
check the variable "cross_compiling" which gets set by autoconf.
2002-05-07 Michael Natterer <mitch@gimp.org>
* configure.in: added a new conditional CROSS_COMPILING which
indicates ($build != $host). If it is set, look for
glib-genmarshal in PATH. Error out if it was not found.
2002-05-07 Michael Natterer <mitch@gimp.org>
* Makefile.am: use the glib-genmarshal found at configure time
if CROSS_COMPILING is set, use the one which was just built
otherwise.
Tue May 7 11:24:22 2002 Owen Taylor <otaylor@redhat.com>
Fixes for #79347, Ron Arts.
* glib/gqsort.c (g_qsort_with_data): Handle 0 elements,
don't g_return_if_fail().
* tests/qsort-test.c (main): Add a 0 element test.
* glib/garray.c (g_[ptr_]array_sort_with[_data]):
Remove invalid assertions that array->pdata != NULL ..
it's NULL for 0 elements which is a valid case.
Mon May 6 16:00:41 2002 Owen Taylor <otaylor@redhat.com>
* glib/gbacktrace.h: Exclude OSF from alpha definition
of G_BREAKPOINT(), since the assembler apparently
doesn't support bpt. (#77852, Gareth Pierce) [from stable]
Mon May 6 11:48:08 2002 Owen Taylor <otaylor@redhat.com>
[ merged from stable ]
* Makefile.am (EXTRA_DIST): Add ChangeLog.pre-2-0 (#78641)
* m4macros/glib-2.0.m4: save CFLAGS/LIBS properly when
compiling "what went wrong" test case. (#79330)
* m4macros/glib-2.0.m4: Remove reference to editing
pkg-config script. (From Jim Gettys)
* configure.in: (Look for dyld interfaces before dlopen()
since OS X can have both. Patch from Jacob Berkman,
#80438)
2002-04-19 Tor Lillqvist <tml@iki.fi>
* glib/gspawn.c (g_spawn_command_line_sync): Add Windows-specific
note to the gtk-doc comment.
* glib/gspawn-win32.c: Remove the copy-pasted gtk-doc comment
blocks. It's enough to have them in gspawn.c.
2002-04-13 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib/gthreadpool.c (g_thread_pool_thread_proxy): Unlock the pool
for all threads leaving it. (#78348)
2002-04-08 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* tests/gio-test.c, tests/markup-test.c: Use gsize instead of
gint. From Miroslaw Dobrzanski-Neumann
<mne@mosaic-ag.com>. (#77982)
Thu Mar 28 18:22:53 2002 Owen Taylor <otaylor@redhat.com>
* README: Remove warning about g_print, etc, encoding.
* NEWS: Updates.
* glib/gmessages.c (g_log_default_handler): Use %lu
(plus a cast) when printing out pid_t arguments.
(#76770, Morten Welinder)
* glib/gstrfuncs.c (g_strdup_vprintf): Check the
result of vasprintf(), return NULL on failure.
(#76802, Akira Tagoh)
* tests/testglib.c (TEST): Supress a warning with
some GCC versions.