mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-24 03:02:10 +01:00
gvariant: Zero-initialise various GVariantSerialised objects
The following few commits will add a couple of new fields to `GVariantSerialised`, and they should be zero-filled by default. Try and pre-empt that a bit by zero-filling `GVariantSerialised` by default in a few places. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #2121
This commit is contained in:
parent
d51c16a7c8
commit
fd215233ae
@ -5944,7 +5944,7 @@ g_variant_byteswap (GVariant *value)
|
||||
if (alignment)
|
||||
/* (potentially) contains multi-byte numeric data */
|
||||
{
|
||||
GVariantSerialised serialised;
|
||||
GVariantSerialised serialised = { 0, };
|
||||
GVariant *trusted;
|
||||
GBytes *bytes;
|
||||
|
||||
|
@ -1438,7 +1438,7 @@ test_maybe (void)
|
||||
|
||||
for (flavour = 0; flavour < 8; flavour += alignment)
|
||||
{
|
||||
GVariantSerialised serialised;
|
||||
GVariantSerialised serialised = { 0, };
|
||||
GVariantSerialised child;
|
||||
|
||||
serialised.type_info = type_info;
|
||||
@ -1562,7 +1562,7 @@ test_array (void)
|
||||
|
||||
for (flavour = 0; flavour < 8; flavour += alignment)
|
||||
{
|
||||
GVariantSerialised serialised;
|
||||
GVariantSerialised serialised = { 0, };
|
||||
|
||||
serialised.type_info = array_info;
|
||||
serialised.data = flavoured_malloc (needed_size, flavour);
|
||||
@ -1726,7 +1726,7 @@ test_tuple (void)
|
||||
|
||||
for (flavour = 0; flavour < 8; flavour += alignment)
|
||||
{
|
||||
GVariantSerialised serialised;
|
||||
GVariantSerialised serialised = { 0, };
|
||||
|
||||
serialised.type_info = type_info;
|
||||
serialised.data = flavoured_malloc (needed_size, flavour);
|
||||
@ -1821,7 +1821,7 @@ test_variant (void)
|
||||
|
||||
for (flavour = 0; flavour < 8; flavour += alignment)
|
||||
{
|
||||
GVariantSerialised serialised;
|
||||
GVariantSerialised serialised = { 0, };
|
||||
GVariantSerialised child;
|
||||
|
||||
serialised.type_info = type_info;
|
||||
@ -2268,7 +2268,7 @@ serialise_tree (TreeInstance *tree,
|
||||
static void
|
||||
test_byteswap (void)
|
||||
{
|
||||
GVariantSerialised one, two;
|
||||
GVariantSerialised one = { 0, }, two = { 0, };
|
||||
TreeInstance *tree;
|
||||
|
||||
tree = tree_instance_new (NULL, 3);
|
||||
@ -2342,7 +2342,7 @@ test_serialiser_children (void)
|
||||
static void
|
||||
test_fuzz (gdouble *fuzziness)
|
||||
{
|
||||
GVariantSerialised serialised;
|
||||
GVariantSerialised serialised = { 0, };
|
||||
TreeInstance *tree;
|
||||
|
||||
/* make an instance */
|
||||
|
Loading…
x
Reference in New Issue
Block a user