From 03cf620f1b5e88dd5ebf1c87afe81764708caae0 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 23 Jun 2020 10:40:35 +0100 Subject: [PATCH 1/2] gvdb-reader: Reword a comment for clarity Avoid ableist phrases. Signed-off-by: Philip Withnall --- gvdb-reader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gvdb-reader.c b/gvdb-reader.c index 6bc4c6f36..820ce4c3d 100644 --- a/gvdb-reader.c +++ b/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). */ From 1b6fa560b0e64b37108544b7aa493e6698e609b5 Mon Sep 17 00:00:00 2001 From: Frederic Martinsons Date: Sat, 2 Jan 2021 18:45:01 +0100 Subject: [PATCH 2/2] Fix warnings Related: glib#1735 Signed-off-by: Frederic Martinsons --- gvdb-builder.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gvdb-builder.c b/gvdb-builder.c index b8ecbe3d7..918ee43fd 100644 --- a/gvdb-builder.c +++ b/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;