]> granicus.if.org Git - procps-ng/commitdiff
library: expand VAL macros to include the context parm
authorJim Warner <james.warner@comcast.net>
Fri, 5 Aug 2016 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Sun, 7 Aug 2016 11:40:48 +0000 (21:40 +1000)
This patch will set the stage for validating the types
referenced in the result union. For now, the parameter
representing that 'info' structure will remain unused.

[ and while we're at it, let us correct a faulty GET ]
[ macro in the diskstats header. that puppy missed a ]
[ parm which ain't so good if that guy is ever used! ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
proc/diskstats.h
proc/meminfo.h
proc/pids.h
proc/slabinfo.h
proc/stat.h
proc/vmstat.h

index 55e676360fe966ee4a3b929cde437c6874cce0f5..cebbd46f41c08bd08f9d5f9e54f1ca284942a581 100644 (file)
@@ -89,10 +89,10 @@ struct diskstats_reap {
 #define DISKSTATS_TYPE_DISK       -11111
 #define DISKSTATS_TYPE_PARTITION  -22222
 
-#define DISKSTATS_GET( info, actual_enum, type ) \
-    procps_diskstats_get( info, actual_enum ) -> result . type
+#define DISKSTATS_GET( info, name, actual_enum, type ) \
+    procps_diskstats_get( info, name, actual_enum ) -> result . type
 
-#define DISKSTATS_VAL( relative_enum, type, stack) \
+#define DISKSTATS_VAL( relative_enum, type, stack, info ) \
     stack -> head [ relative_enum ] . result . type
 
 
index cc24afa72d753a9eabaf0365bfdfd7ab4996be37..9b3b01925423af107bac032fe1d1035d51b16e65 100644 (file)
@@ -140,7 +140,7 @@ struct meminfo_stack {
 #define MEMINFO_GET( info, actual_enum, type ) \
     procps_meminfo_get( info, actual_enum ) -> result . type
 
-#define MEMINFO_VAL( relative_enum, type, stack) \
+#define MEMINFO_VAL( relative_enum, type, stack, info ) \
     stack -> head [ relative_enum ] . result . type
 
 
index 0b27f8471d9af31d1bd63a707734d3d6c55c6cd2..20af3e00a944808af0c02a9a4d20c240dab619c3 100644 (file)
@@ -195,7 +195,7 @@ struct pids_fetch {
 };
 
 
-#define PIDS_VAL( relative_enum, type, stack ) \
+#define PIDS_VAL( relative_enum, type, stack, info ) \
     stack -> head [ relative_enum ] . result . type
 
 
index e36b60fdb5cd15f9f63662844b1796b4376199bc..30ad06b6d71d8808b502f73a8f10d9140dad64fa 100644 (file)
@@ -98,7 +98,7 @@ struct slabinfo_reap {
 #define SLABINFO_GET( info, actual_enum, type ) \
     procps_slabinfo_get( info, actual_enum ) -> result . type
 
-#define SLABINFO_VAL( relative_enum, type, stack ) \
+#define SLABINFO_VAL( relative_enum, type, stack, info ) \
     stack -> head [ relative_enum ] . result . type
 
 
index b2fa3b97797568fbec47bb4b695e941434daf600..e6f74a476b89fec7906a846f663bd7a8a56b88b9 100644 (file)
@@ -108,7 +108,7 @@ struct stat_reaped {
 #define STAT_GET( info, actual_enum, type ) \
     procps_stat_get( info, actual_enum ) -> result . type
 
-#define STAT_VAL( relative_enum, type, stack ) \
+#define STAT_VAL( relative_enum, type, stack, info ) \
     stack -> head [ relative_enum ] . result . type
 
 
index 0ff8590f6ebddb9357e0e24d216ef09094a86f2c..483c0e2860f27306435284a62b269785fb3980f6 100644 (file)
@@ -288,7 +288,7 @@ struct vmstat_stack {
 #define VMSTAT_GET( info, actual_enum, type ) \
     procps_vmstat_get( info, actual_enum ) -> result . type
 
-#define VMSTAT_VAL( relative_enum, type, stack ) \
+#define VMSTAT_VAL( relative_enum, type, stack, info ) \
     stack -> head [ relative_enum ] . result . type