summaryrefslogtreecommitdiffstats
path: root/tools/dmsetup.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2008-06-18 10:19:25 +0000
committerJim Meyering <jim@meyering.net>2008-06-18 10:19:25 +0000
commitdacf86a12dfd7ced08181a9a316db2fe1a9e23ff (patch)
tree11529548132fb2ad4ed9089e1350c6d9a863d748 /tools/dmsetup.c
parent01871123962c641d4ec71fe4484f4ad2adcd76fd (diff)
downloadlvm2-dacf86a12dfd7ced08181a9a316db2fe1a9e23ff.tar.gz
lvm2-dacf86a12dfd7ced08181a9a316db2fe1a9e23ff.tar.xz
lvm2-dacf86a12dfd7ced08181a9a316db2fe1a9e23ff.zip
avoid compiler warning about cast in OFFSET_OF macro
* dmsetup/dmsetup.c (OFFSET_OF): Use an equivalent definition that does not cast a pointer value to a narrower type.
Diffstat (limited to 'tools/dmsetup.c')
-rw-r--r--tools/dmsetup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index fdc52e33..b242f1ca 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
* Copyright (C) 2005-2007 NEC Corporation
*
* This file is part of the device-mapper userspace tools.
@@ -1927,7 +1927,7 @@ static const struct dm_report_object_type _report_types[] = {
};
/* Column definitions */
-#define OFFSET_OF(strct, field) ((unsigned int) &((struct strct *)NULL)->field)
+#define OFFSET_OF(strct, field) (((char*)&((struct strct*)0)->field) - (char*)0)
#define STR (DM_REPORT_FIELD_TYPE_STRING)
#define NUM (DM_REPORT_FIELD_TYPE_NUMBER)
#define FIELD_O(type, strct, sorttype, head, field, width, func, id, desc) {DR_ ## type, sorttype, OFFSET_OF(strct, field), width, id, head, &_ ## func ## _disp, desc},