<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/glib.git/tests/timeloop.c, branch require-python34</title>
<subtitle>gitlab.gnome.org: GNOME/glib.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/'/>
<entry>
<title>Consistently save errno immediately after the operation setting it</title>
<updated>2017-08-03T09:21:13+00:00</updated>
<author>
<name>Philip Withnall</name>
<email>withnall@endlessm.com</email>
</author>
<published>2017-07-31T10:30:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=5cddde1fb2b8466d8104595008eafabd0728de5d'/>
<id>5cddde1fb2b8466d8104595008eafabd0728de5d</id>
<content type='text'>
Prevent the situation where errno is set by function A, then function B
is called (which is typically _(), but could be anything else) and it
overwrites errno, then errno is checked by the caller.

errno is a horrific API, and we need to be careful to save its value as
soon as a function call (which might set it) returns. i.e. Follow the
pattern:
  int errsv, ret;
  ret = some_call_which_might_set_errno ();
  errsv = errno;

  if (ret &lt; 0)
    puts (strerror (errsv));

This patch implements that pattern throughout GLib. There might be a few
places in the test code which still use errno directly. They should be
ported as necessary. It doesn’t modify all the call sites like this:
  if (some_call_which_might_set_errno () &amp;&amp; errno == ESOMETHING)
since the refactoring involved is probably more harmful than beneficial
there. It does, however, refactor other call sites regardless of whether
they were originally buggy.

https://bugzilla.gnome.org/show_bug.cgi?id=785577
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prevent the situation where errno is set by function A, then function B
is called (which is typically _(), but could be anything else) and it
overwrites errno, then errno is checked by the caller.

errno is a horrific API, and we need to be careful to save its value as
soon as a function call (which might set it) returns. i.e. Follow the
pattern:
  int errsv, ret;
  ret = some_call_which_might_set_errno ();
  errsv = errno;

  if (ret &lt; 0)
    puts (strerror (errsv));

This patch implements that pattern throughout GLib. There might be a few
places in the test code which still use errno directly. They should be
ported as necessary. It doesn’t modify all the call sites like this:
  if (some_call_which_might_set_errno () &amp;&amp; errno == ESOMETHING)
since the refactoring involved is probably more harmful than beneficial
there. It does, however, refactor other call sites regardless of whether
they were originally buggy.

https://bugzilla.gnome.org/show_bug.cgi?id=785577
</pre>
</div>
</content>
</entry>
<entry>
<title>timeloop: Fix leaks in tests</title>
<updated>2013-11-11T07:14:45+00:00</updated>
<author>
<name>Stef Walter</name>
<email>stefw@gnome.org</email>
</author>
<published>2013-11-09T19:52:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=177fe9f98ee7a017cff11f739c16c203b671a7e2'/>
<id>177fe9f98ee7a017cff11f739c16c203b671a7e2</id>
<content type='text'>
https://bugzilla.gnome.org/show_bug.cgi?id=711751
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://bugzilla.gnome.org/show_bug.cgi?id=711751
</pre>
</div>
</content>
</entry>
<entry>
<title>glib/gdebug.h glib/gutils.c gobject/gtype.c gthread/gthread-posix.c</title>
<updated>2004-11-01T18:47:12+00:00</updated>
<author>
<name>Matthias Clasen</name>
<email>mclasen@redhat.com</email>
</author>
<published>2004-11-01T18:47:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=286d84fcb015da87985c6d2d996d76960322b36d'/>
<id>286d84fcb015da87985c6d2d996d76960322b36d</id>
<content type='text'>
2004-11-01  Matthias Clasen  &lt;mclasen@redhat.com&gt;

	* glib/gconvert.c:
	* glib/gdebug.h
	* glib/gutils.c
	* gobject/gtype.c
	* gthread/gthread-posix.c
	* tests/timeloop-closure.c
	* tests/timeloop.c: Fix sparse warnings.  (#157014, Kjartan Maraas)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
2004-11-01  Matthias Clasen  &lt;mclasen@redhat.com&gt;

	* glib/gconvert.c:
	* glib/gdebug.h
	* glib/gutils.c
	* gobject/gtype.c
	* gthread/gthread-posix.c
	* tests/timeloop-closure.c
	* tests/timeloop.c: Fix sparse warnings.  (#157014, Kjartan Maraas)
</pre>
</div>
</content>
</entry>
<entry>
<title>Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN throughout the</title>
<updated>2002-07-04T15:19:30+00:00</updated>
<author>
<name>Sebastian Wilhelmi</name>
<email>wilhelmi@ira.uka.de</email>
</author>
<published>2002-07-04T15:19:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=d81ac5339fcf9537a3731ebb5770238f4fa69d59'/>
<id>d81ac5339fcf9537a3731ebb5770238f4fa69d59</id>
<content type='text'>
2002-07-04  Sebastian Wilhelmi  &lt;wilhelmi@ira.uka.de&gt;

	* tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN
	throughout the files, which didn't already have them. (#87312)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
2002-07-04  Sebastian Wilhelmi  &lt;wilhelmi@ira.uka.de&gt;

	* tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN
	throughout the files, which didn't already have them. (#87312)
</pre>
</div>
</content>
</entry>
<entry>
<title>Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.</title>
<updated>2001-06-23T13:55:09+00:00</updated>
<author>
<name>Owen Taylor</name>
<email>otaylor@redhat.com</email>
</author>
<published>2001-06-23T13:55:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=f5c28ce4ab8e8015a1432060b6cfe547183b2f9e'/>
<id>f5c28ce4ab8e8015a1432060b6cfe547183b2f9e</id>
<content type='text'>
Wed Jun 20 12:00:54 2001  Owen Taylor  &lt;otaylor@redhat.com&gt;

        Changes for 64-bit cleanliness, loosely based on patch
	from Mark Murnane.

	* gconvert.c (g_convert/g_convert_with_fallback): Remove
	workarounds for since-fixed GNU libc bugs. Minor
	doc fix.

	* gconvert.[ch]: Change gint to gsize/gssize as
	appropriate.

	* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
	computation of bytes_read / bytes_written.

	* gfileutils.[ch] (g_file_get_contents): Make length
	out parameter 'gsize *len'.

	* ghook.c (g_hook_compare_ids): Don't compare a
	and b as 'a - b'.

	* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
	GSIZE_TO_POINTER.

	* gmain.c (g_timeout_prepare): Rewrite to avoid
	overflows. (Fixes bug when system clock skews
	backwards more than 24 days.)

	* gmarkup.[ch]: Make lengths passed to callbacks
	gsize, length for g_markup_parse-context_parse(),
	g_markup_escape_text() gssize.

	* gmessages.[ch] (g_printf_string_upper_bound): Change
	return value to gsize.

	* gmessages.c (printf_string_upper_bound): Remove
	a ridiculous use of 'inline' on a 300 line function.

	* gstring.[ch]: Represent size of string as a gsize,
	not gint. Make parameters to functions take gsize,
	or gssize where -1 is allowed.

	* gstring.c (g_string_erase): Make
	g_string_erase (string, pos, -1) a synonym for
	g_string_truncate for consistency with other G*
	APIs.

	* gstrfuncs.[ch]: Make all functions taking a string
	length, take a gsize, or gssize if -1 is allowed.
	(g_strstr_len, g_strrstr_len). Also fix some boundary
	conditions in g_str[r]str[_len].

	* gutf8.c tests/unicode-encoding.c: Make parameters that
	are byte lengths gsize, gssize as appropriate. Make
	character offsets, other counts, glong.

	* gasyncqueue.c gcompletion.c
          timeloop.c timeloop-basic.c gutils.c gspawn.c.
	Small 64 bit cleanliness fixups.

	* glist.c (g_list_sort2, g_list_sort_real): Fix functions
	that should have been static.

	* gdate.c (g_date_fill_parse_tokens): Fix extra
	declaration that was shadowing another.

	* tests/module-test.c: Include string.h

Mon Jun 18 15:43:29 2001  Owen Taylor  &lt;otaylor@redhat.com&gt;

	* gutf8.c (g_get_charset): Make argument
	G_CONST_RETURN char **.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Wed Jun 20 12:00:54 2001  Owen Taylor  &lt;otaylor@redhat.com&gt;

        Changes for 64-bit cleanliness, loosely based on patch
	from Mark Murnane.

	* gconvert.c (g_convert/g_convert_with_fallback): Remove
	workarounds for since-fixed GNU libc bugs. Minor
	doc fix.

	* gconvert.[ch]: Change gint to gsize/gssize as
	appropriate.

	* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
	computation of bytes_read / bytes_written.

	* gfileutils.[ch] (g_file_get_contents): Make length
	out parameter 'gsize *len'.

	* ghook.c (g_hook_compare_ids): Don't compare a
	and b as 'a - b'.

	* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
	GSIZE_TO_POINTER.

	* gmain.c (g_timeout_prepare): Rewrite to avoid
	overflows. (Fixes bug when system clock skews
	backwards more than 24 days.)

	* gmarkup.[ch]: Make lengths passed to callbacks
	gsize, length for g_markup_parse-context_parse(),
	g_markup_escape_text() gssize.

	* gmessages.[ch] (g_printf_string_upper_bound): Change
	return value to gsize.

	* gmessages.c (printf_string_upper_bound): Remove
	a ridiculous use of 'inline' on a 300 line function.

	* gstring.[ch]: Represent size of string as a gsize,
	not gint. Make parameters to functions take gsize,
	or gssize where -1 is allowed.

	* gstring.c (g_string_erase): Make
	g_string_erase (string, pos, -1) a synonym for
	g_string_truncate for consistency with other G*
	APIs.

	* gstrfuncs.[ch]: Make all functions taking a string
	length, take a gsize, or gssize if -1 is allowed.
	(g_strstr_len, g_strrstr_len). Also fix some boundary
	conditions in g_str[r]str[_len].

	* gutf8.c tests/unicode-encoding.c: Make parameters that
	are byte lengths gsize, gssize as appropriate. Make
	character offsets, other counts, glong.

	* gasyncqueue.c gcompletion.c
          timeloop.c timeloop-basic.c gutils.c gspawn.c.
	Small 64 bit cleanliness fixups.

	* glist.c (g_list_sort2, g_list_sort_real): Fix functions
	that should have been static.

	* gdate.c (g_date_fill_parse_tokens): Fix extra
	declaration that was shadowing another.

	* tests/module-test.c: Include string.h

Mon Jun 18 15:43:29 2001  Owen Taylor  &lt;otaylor@redhat.com&gt;

	* gutf8.c (g_get_charset): Make argument
	G_CONST_RETURN char **.
</pre>
</div>
</content>
</entry>
<entry>
<title>-DG_DISABLE_DEPRECATED</title>
<updated>2001-03-26T19:23:17+00:00</updated>
<author>
<name>Owen Taylor</name>
<email>otaylor@redhat.com</email>
</author>
<published>2001-03-26T19:23:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=df2f429cff283621c463fafb2996f74cfde25043'/>
<id>df2f429cff283621c463fafb2996f74cfde25043</id>
<content type='text'>
Mon Mar 26 14:14:53 2001  Owen Taylor  &lt;otaylor@redhat.com&gt;

	* Makefile.am (INCLUDES): -DG_DISABLE_DEPRECATED

	* gmain.h timeloop.c: Surround the cruftiest stuff with
	#ifndef G_DISABLE_DEPRECATED.

	* gcompat.h gdate.h: Move compat defines back to
	gdate.h, surround with #ifndef G_DISABLE_DEPRECATED.
	Remove gcompat.h.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mon Mar 26 14:14:53 2001  Owen Taylor  &lt;otaylor@redhat.com&gt;

	* Makefile.am (INCLUDES): -DG_DISABLE_DEPRECATED

	* gmain.h timeloop.c: Surround the cruftiest stuff with
	#ifndef G_DISABLE_DEPRECATED.

	* gcompat.h gdate.h: Move compat defines back to
	gdate.h, surround with #ifndef G_DISABLE_DEPRECATED.
	Remove gcompat.h.
</pre>
</div>
</content>
</entry>
<entry>
<title>Reorder headers to make FreeBSD happy.</title>
<updated>2001-03-18T00:55:10+00:00</updated>
<author>
<name>Owen Taylor</name>
<email>otaylor@redhat.com</email>
</author>
<published>2001-03-18T00:55:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=1d5b01bb5286277859d354a46c99fcee0a56113a'/>
<id>1d5b01bb5286277859d354a46c99fcee0a56113a</id>
<content type='text'>
Sat Mar 17 19:54:51 2001  Owen Taylor  &lt;otaylor@redhat.com&gt;

        * timeloop.c: Reorder headers to make FreeBSD happy.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sat Mar 17 19:54:51 2001  Owen Taylor  &lt;otaylor@redhat.com&gt;

        * timeloop.c: Reorder headers to make FreeBSD happy.
</pre>
</div>
</content>
</entry>
<entry>
<title>Major change in API for creating sources to handle multiple main loops</title>
<updated>2000-12-05T20:45:33+00:00</updated>
<author>
<name>Owen Taylor</name>
<email>otaylor@redhat.com</email>
</author>
<published>2000-12-05T20:45:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=e2fd4e2bd0589b159f87b491095565d16fac2789'/>
<id>e2fd4e2bd0589b159f87b491095565d16fac2789</id>
<content type='text'>
Tue Dec  5 12:23:04 2000  Owen Taylor  &lt;otaylor@redhat.com&gt;

        * gmain.[hc]: Major change in API for creating sources
	to handle multiple main loops (GMainContext *).

	GSources are now exposed as GSource * and implemented
	with structure derivation.

	* giochannel.[ch]: Changed vtable for GIOChannel to correspond
	to the new mainloop API, add g_io_channel_create_watch().

	* gtypes.h: Move GTimeVal here.

	* gthread.h: Remove gmain.h include to avoid circularity.

        * giounix.c: Update for new GMain API.

	* giowin32.c: Update for new GMain API. (No check for
	proper compilation or working.)

	* timeloop.c timeloop-basic.c: A benchmarking program for
	the main loop comparing the main loop against a
	hand-written (timeloop-basic.c) variant.

	* tests/mainloop-test.c: New torture test of mainloop.

	* docs/Changes-2.0.txt: Started. Added text about
	changes to GMain.

	* gmain.c (g_main_add_poll_unlocked): Initial fd-&gt;revents
	to zero. (#8482, Benjamin Kahn)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tue Dec  5 12:23:04 2000  Owen Taylor  &lt;otaylor@redhat.com&gt;

        * gmain.[hc]: Major change in API for creating sources
	to handle multiple main loops (GMainContext *).

	GSources are now exposed as GSource * and implemented
	with structure derivation.

	* giochannel.[ch]: Changed vtable for GIOChannel to correspond
	to the new mainloop API, add g_io_channel_create_watch().

	* gtypes.h: Move GTimeVal here.

	* gthread.h: Remove gmain.h include to avoid circularity.

        * giounix.c: Update for new GMain API.

	* giowin32.c: Update for new GMain API. (No check for
	proper compilation or working.)

	* timeloop.c timeloop-basic.c: A benchmarking program for
	the main loop comparing the main loop against a
	hand-written (timeloop-basic.c) variant.

	* tests/mainloop-test.c: New torture test of mainloop.

	* docs/Changes-2.0.txt: Started. Added text about
	changes to GMain.

	* gmain.c (g_main_add_poll_unlocked): Initial fd-&gt;revents
	to zero. (#8482, Benjamin Kahn)
</pre>
</div>
</content>
</entry>
</feed>
