public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/libdm libdevmapper.h
@ 2010-08-20 12:44 wysochanski
  0 siblings, 0 replies; 4+ messages in thread
From: wysochanski @ 2010-08-20 12:44 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski@sourceware.org	2010-08-20 12:44:31

Modified files:
	libdm          : libdevmapper.h 

Log message:
	Add macro definitions to report infrastructure for character array length.
	
	Rather than hard code the size of the field, use a #define, so we can re-use.
	The #define will be needed in a future patch when we extend the reporting
	infrastructure to have 'get' and 'set' functions for each field, allowing
	lvm2app functions which query any report field.  In order to provide a
	generic lookup based on the field id, we will define a type containing this
	field id, and thus, we will need to re-use the length of this string as
	it's defined inside libdevmapper.h.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.124&r2=1.125

--- LVM2/libdm/libdevmapper.h	2010/07/21 13:40:22	1.124
+++ LVM2/libdm/libdevmapper.h	2010/08/20 12:44:30	1.125
@@ -1048,14 +1048,19 @@
 #define DM_REPORT_FIELD_TYPE_STRING	0x00000010
 #define DM_REPORT_FIELD_TYPE_NUMBER	0x00000020
 
+#define DM_REPORT_FIELD_TYPE_ID_LEN 32
+#define DM_REPORT_FIELD_TYPE_HEADING_LEN 32
+
 struct dm_report;
 struct dm_report_field_type {
 	uint32_t type;		/* object type id */
 	uint32_t flags;		/* DM_REPORT_FIELD_* */
 	uint32_t offset;	/* byte offset in the object */
 	int32_t width;		/* default width */
-	const char id[32];	/* string used to specify the field */
-	const char heading[32];	/* string printed in header */
+	/* string used to specify the field */
+	const char id[DM_REPORT_FIELD_TYPE_ID_LEN];
+	/* string printed in header */
+	const char heading[DM_REPORT_FIELD_TYPE_HEADING_LEN];
 	int (*report_fn)(struct dm_report *rh, struct dm_pool *mem,
 			 struct dm_report_field *field, const void *data,
 			 void *private_data);


^ permalink raw reply	[flat|nested] 4+ messages in thread

* LVM2/libdm libdevmapper.h
@ 2011-10-28 20:04 zkabelac
  0 siblings, 0 replies; 4+ messages in thread
From: zkabelac @ 2011-10-28 20:04 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-10-28 20:04:18

Modified files:
	libdm          : libdevmapper.h 

Log message:
	Update header comment

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.164&r2=1.165

--- LVM2/libdm/libdevmapper.h	2011/10/20 10:33:30	1.164
+++ LVM2/libdm/libdevmapper.h	2011/10/28 20:04:17	1.165
@@ -905,7 +905,7 @@
 void dm_list_move(struct dm_list *head, struct dm_list *elem);
 
 /*
- * Join 'head1' to the of 'head'.
+ * Join 'head1' to the end of 'head'.
  */
 void dm_list_splice(struct dm_list *head, struct dm_list *head1);
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* LVM2/libdm libdevmapper.h
@ 2010-12-20 13:39 zkabelac
  0 siblings, 0 replies; 4+ messages in thread
From: zkabelac @ 2010-12-20 13:39 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-12-20 13:39:13

Modified files:
	libdm          : libdevmapper.h 

Log message:
	Use const char* for offset calculation
	
	As 'const' types are also passed to macro dm_list_struct_base -
	keep offset calculation with const char pointers.
	Fixes several gcc constness warnings.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.130&r2=1.131

--- LVM2/libdm/libdevmapper.h	2010/12/20 13:23:12	1.130
+++ LVM2/libdm/libdevmapper.h	2010/12/20 13:39:12	1.131
@@ -814,7 +814,7 @@
  * contained in a structure of type t, return the containing structure.
  */
 #define dm_list_struct_base(v, t, head) \
-    ((t *)((char*)(v) - (char*)&((t *) 0)->head))
+    ((t *)((const char *)(v) - (const char *)&((t *) 0)->head))
 
 /*
  * Given the address v of an instance of 'struct dm_list list' contained in


^ permalink raw reply	[flat|nested] 4+ messages in thread

* LVM2/libdm libdevmapper.h
@ 2010-01-14 10:12 zkabelac
  0 siblings, 0 replies; 4+ messages in thread
From: zkabelac @ 2010-01-14 10:12 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-01-14 10:12:44

Modified files:
	libdm          : libdevmapper.h 

Log message:
	Cleanup gcc warning: cast from function call of type 'struct dm_list *'
	to non-matching type 'long unsigned int'
	
	Casting pointer to long and back to pointer could be easily
	handled with just pointer arithmetic.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.106&r2=1.107

--- LVM2/libdm/libdevmapper.h	2010/01/13 01:39:45	1.106
+++ LVM2/libdm/libdevmapper.h	2010/01/14 10:12:44	1.107
@@ -754,7 +754,7 @@
  * contained in a structure of type t, return the containing structure.
  */
 #define dm_list_struct_base(v, t, head) \
-    ((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->head))
+    ((t *)((char*)(v) - (char*)&((t *) 0)->head))
 
 /*
  * Given the address v of an instance of 'struct dm_list list' contained in


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-28 20:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-20 12:44 LVM2/libdm libdevmapper.h wysochanski
  -- strict thread matches above, loose matches on Subject: below --
2011-10-28 20:04 zkabelac
2010-12-20 13:39 zkabelac
2010-01-14 10:12 zkabelac

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).