mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
Fix formatting of examples.
2003-04-01 Matthias Clasen <maclas@gmx.de> * glib/tmpl/error_reporting.sgml: * glib/tmpl/random_numbers.sgml: * glib/tmpl/arrays_pointer.sgml: * glib/tmpl/arrays.sgml: Fix formatting of examples.
This commit is contained in:
parent
e4112b8b1b
commit
aad05b82e0
@ -1,3 +1,10 @@
|
||||
2003-04-01 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* glib/tmpl/error_reporting.sgml:
|
||||
* glib/tmpl/random_numbers.sgml:
|
||||
* glib/tmpl/arrays_pointer.sgml:
|
||||
* glib/tmpl/arrays.sgml: Fix formatting of examples.
|
||||
|
||||
2003-04-01 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* glib/glib-sections.txt: Add g_string_chunk_insert_len.
|
||||
|
@ -44,7 +44,7 @@ To free an array, use g_array_free().
|
||||
|
||||
for (i = 0; i < 10000; i++)
|
||||
if (g_array_index (garray, gint, i) != i)
|
||||
g_print ("ERROR: got %d instead of %d\n",
|
||||
g_print ("ERROR: got %d instead of %d\n",
|
||||
g_array_index (garray, gint, i), i);
|
||||
|
||||
g_array_free (garray, TRUE);
|
||||
|
@ -49,7 +49,7 @@ To free a pointer array, use g_ptr_array_free().
|
||||
g_ptr_array_add (gparray, (gpointer) string3);
|
||||
|
||||
if (g_ptr_array_index (gparray, 0) != (gpointer) string1)
|
||||
g_print ("ERROR: got %p instead of %p\n",
|
||||
g_print ("ERROR: got %p instead of %p\n",
|
||||
g_ptr_array_index (gparray, 0), string1);
|
||||
|
||||
g_ptr_array_free (gparray, TRUE);
|
||||
|
@ -52,7 +52,7 @@ if (err != NULL)
|
||||
{
|
||||
/* Report error to user, and free error */
|
||||
g_assert (contents == NULL);
|
||||
fprintf (stderr, "Unable to read file: %s\n", err->message);
|
||||
fprintf (stderr, "Unable to read file: %s\n", err->message);
|
||||
g_error_free (err);
|
||||
}
|
||||
else
|
||||
@ -115,7 +115,7 @@ foo_open_file (GError **error)
|
||||
g_set_error (error,
|
||||
FOO_ERROR, /* error domain */
|
||||
FOO_ERROR_BLAH, /* error code */
|
||||
"Failed to open file: %s", /* error message format string */
|
||||
"Failed to open file: %s", /* error message format string */
|
||||
g_strerror (errno));
|
||||
return -1;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ on all platforms. This can thus be used as a seed for e.g. games.
|
||||
<para>
|
||||
The <function>g_rand*_range</function> functions will return high quality
|
||||
equally distributed random numbers, whereas for example the
|
||||
<literal>(g_random_int()%%max)</literal> approach often doesn't
|
||||
<literal>(g_random_int()%max)</literal> approach often doesn't
|
||||
yield equally distributed numbers.
|
||||
</para>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user