summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2021-01-04 11:38:54 +0000
committerPhilip Withnall <pwithnall@endlessos.org>2021-01-04 11:38:54 +0000
commit0d3473d3bb8fb8fdc593a5577ed884721abea254 (patch)
treefd9b41476340a73b5f85212fcd638f08b7e94fea
parent9a7ca661a3ae8c599b7f5281404b03ffec0e643b (diff)
parent3d50fe28e8e8f8b215a36581c6b4c9b199b60eb6 (diff)
downloadglib-0d3473d3bb8fb8fdc593a5577ed884721abea254.tar.gz
Merge remote-tracking branch 'gvdb/master' into update-gvdb
This is the result of `git merge gvdb/master`.
-rw-r--r--gio/gvdb/gvdb-builder.c8
-rw-r--r--gio/gvdb/gvdb-reader.c2
2 files changed, 6 insertions, 4 deletions
diff --git a/gio/gvdb/gvdb-builder.c b/gio/gvdb/gvdb-builder.c
index b8ecbe3d7..918ee43fd 100644
--- a/gio/gvdb/gvdb-builder.c
+++ b/gio/gvdb/gvdb-builder.c
@@ -206,7 +206,7 @@ item_to_index (GvdbItem *item)
if (item != NULL)
return item->assigned_index;
- return guint32_to_le (-1u);
+ return guint32_to_le ((guint32) -1);
}
typedef struct
@@ -234,7 +234,7 @@ file_builder_allocate (FileBuilder *fb,
if (size == 0)
return NULL;
- fb->offset += (-fb->offset) & (alignment - 1);
+ fb->offset += (guint64) (-fb->offset) & (alignment - 1);
chunk = g_slice_new (FileChunk);
chunk->offset = fb->offset;
chunk->size = size;
@@ -463,9 +463,11 @@ static GString *
file_builder_serialise (FileBuilder *fb,
struct gvdb_pointer root)
{
- struct gvdb_header header = { { 0, }, };
+ struct gvdb_header header;
GString *result;
+ memset (&header, 0, sizeof (header));
+
if (fb->byteswap)
{
header.signature[0] = GVDB_SWAPPED_SIGNATURE0;
diff --git a/gio/gvdb/gvdb-reader.c b/gio/gvdb/gvdb-reader.c
index 6bc4c6f36..820ce4c3d 100644
--- a/gio/gvdb/gvdb-reader.c
+++ b/gio/gvdb/gvdb-reader.c
@@ -379,7 +379,7 @@ gvdb_table_get_names (GvdbTable *table,
* a pass that fills in no additional items.
*
* This takes an O(n) algorithm and turns it into O(n*m) where m is
- * the depth of the tree, but in all sane cases the tree won't be very
+ * the depth of the tree, but typically the tree won't be very
* deep and the constant factor of this algorithm is lower (and the
* complexity of coding it, as well).
*/