mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-21 16:38:54 +02:00
Add a note about casting the results of g_new() and g_new0().
2006-01-17 Matthias Clasen <mclasen@redhat.com> * glib/tmpl/memory.sgml: Add a note about casting the results of g_new() and g_new0().
This commit is contained in:
committed by
Matthias Clasen
parent
f4484f51bf
commit
402a1081ae
@@ -1,3 +1,8 @@
|
|||||||
|
2006-01-17 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* glib/gkeyfile.c (g_key_file_get_groups): Correct a g_new0()
|
||||||
|
call. (#327421, Morten Welinder)
|
||||||
|
|
||||||
2006-01-17 Sebastian Wilhelmi <seppi@seppi.de>
|
2006-01-17 Sebastian Wilhelmi <seppi@seppi.de>
|
||||||
|
|
||||||
* glib/gthreadpool.c: To avoid deadlocks get rid of the settings
|
* glib/gthreadpool.c: To avoid deadlocks get rid of the settings
|
||||||
|
@@ -1,3 +1,8 @@
|
|||||||
|
2006-01-17 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* glib/gkeyfile.c (g_key_file_get_groups): Correct a g_new0()
|
||||||
|
call. (#327421, Morten Welinder)
|
||||||
|
|
||||||
2006-01-17 Sebastian Wilhelmi <seppi@seppi.de>
|
2006-01-17 Sebastian Wilhelmi <seppi@seppi.de>
|
||||||
|
|
||||||
* glib/gthreadpool.c: To avoid deadlocks get rid of the settings
|
* glib/gthreadpool.c: To avoid deadlocks get rid of the settings
|
||||||
|
@@ -1,3 +1,8 @@
|
|||||||
|
2006-01-17 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* glib/gkeyfile.c (g_key_file_get_groups): Correct a g_new0()
|
||||||
|
call. (#327421, Morten Welinder)
|
||||||
|
|
||||||
2006-01-17 Sebastian Wilhelmi <seppi@seppi.de>
|
2006-01-17 Sebastian Wilhelmi <seppi@seppi.de>
|
||||||
|
|
||||||
* glib/gthreadpool.c: To avoid deadlocks get rid of the settings
|
* glib/gthreadpool.c: To avoid deadlocks get rid of the settings
|
||||||
|
@@ -1,3 +1,8 @@
|
|||||||
|
2006-01-17 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* glib/tmpl/memory.sgml: Add a note about casting the results
|
||||||
|
of g_new() and g_new0().
|
||||||
|
|
||||||
2006-01-16 Matthias Clasen <mclasen@redhat.com>
|
2006-01-16 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* === Released 2.9.3 ===
|
* === Released 2.9.3 ===
|
||||||
|
@@ -29,6 +29,11 @@ Allocates @n_structs elements of type @struct_type.
|
|||||||
The returned pointer is cast to a pointer to the given type.
|
The returned pointer is cast to a pointer to the given type.
|
||||||
If @n_structs is 0 it returns %NULL.
|
If @n_structs is 0 it returns %NULL.
|
||||||
</para>
|
</para>
|
||||||
|
<para>
|
||||||
|
Since the returned pointer is already casted to the right type,
|
||||||
|
it is normally unnecessary to cast it explicitly, and doing
|
||||||
|
so might hide memory allocation errors.
|
||||||
|
</para>
|
||||||
|
|
||||||
@struct_type: the type of the elements to allocate.
|
@struct_type: the type of the elements to allocate.
|
||||||
@n_structs: the number of elements to allocate.
|
@n_structs: the number of elements to allocate.
|
||||||
@@ -41,6 +46,11 @@ Allocates @n_structs elements of type @struct_type, initialized to 0's.
|
|||||||
The returned pointer is cast to a pointer to the given type.
|
The returned pointer is cast to a pointer to the given type.
|
||||||
If @n_structs is 0 it returns %NULL.
|
If @n_structs is 0 it returns %NULL.
|
||||||
</para>
|
</para>
|
||||||
|
<para>
|
||||||
|
Since the returned pointer is already casted to the right type,
|
||||||
|
it is normally unnecessary to cast it explicitly, and doing
|
||||||
|
so might hide memory allocation errors.
|
||||||
|
</para>
|
||||||
|
|
||||||
@struct_type: the type of the elements to allocate.
|
@struct_type: the type of the elements to allocate.
|
||||||
@n_structs: the number of elements to allocate.
|
@n_structs: the number of elements to allocate.
|
||||||
|
@@ -1107,7 +1107,7 @@ g_key_file_get_groups (GKeyFile *key_file,
|
|||||||
* list) is always the comment group at the top,
|
* list) is always the comment group at the top,
|
||||||
* which we skip
|
* which we skip
|
||||||
*/
|
*/
|
||||||
groups = (gchar **) g_new0 (gchar **, num_groups);
|
groups = g_new0 (gchar *, num_groups);
|
||||||
|
|
||||||
group_node = g_list_last (key_file->groups);
|
group_node = g_list_last (key_file->groups);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user