From a0c9be13b316e5a69c41d849e6eaa302b22c7e08 Mon Sep 17 00:00:00 2001
From: Andre Noll <maan@systemlinux.org>
Date: Fri, 6 Jun 2008 17:45:39 +0200
Subject: [PATCH] Change type of struct osl_table_description->flags to
 uint8_t.

We reserve only one byte in the index header of the table, so it
does not make sense to have this field of type enum.

Fixes:

	fsck.c:815: warning: dereferencing type-punned pointer will break strict-aliasing rules
---
 fsck.c   | 5 +++--
 osl.h.in | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/fsck.c b/fsck.c
index 29c4e2c..27004a6 100644
--- a/fsck.c
+++ b/fsck.c
@@ -754,7 +754,7 @@ static unsigned files_pruned;
 int prune_disk_storage_file(const char *path, void *private_data)
 {
 	HASH_TYPE hash[HASH_SIZE];
-	unsigned flags = *(unsigned *)private_data;
+	uint8_t flags = *(uint8_t *)private_data;
 	struct osl_object obj = {.data = hash, .size = HASH_SIZE};
 	struct osl_row *row;
 	int ret = -1;
@@ -811,8 +811,9 @@ static int prune_disk_storage_files(struct osl_table *t)
 	INFO_LOG("looking for unreferenced disk storage files\n");
 	FOR_EACH_DISK_STORAGE_COLUMN(i, t, cd) {
 		char *dirname = column_filename(t, i);
+		uint8_t flags = t->desc->flags;
 		ret = for_each_file_in_dir(dirname, prune_disk_storage_file,
-			(unsigned *)&t->desc->flags);
+			&flags);
 		free(dirname);
 	}
 	if (files_pruned)
diff --git a/osl.h.in b/osl.h.in
index 514baa2..e462479 100644
--- a/osl.h.in
+++ b/osl.h.in
@@ -135,8 +135,8 @@ struct osl_table_description {
 	const char *name;
 	/** The number of columns of this table. */
 	uint16_t num_columns;
-	/** Further table-wide information. */
-	enum osl_table_flags flags;
+	/** Further table-wide information, \sa osl_table_flags. */
+	uint8_t flags;
 	/** The array describing the individual columns of the table. */
 	struct osl_column_description *column_descriptions;
 };
-- 
2.39.5