[Powertop] [PATCH] Fix gcc compiler warning on 32 bit hosts

Stefan Weil <sw at weilnetz.de> Thu, 12 Jul 2012 22:53:21 +0200
Newsgroups dev.linux.lists.powertop
Message-ID <[email protected]>
Pointers must only be casted to intptr_t or uintptr_t.
Both types are defined in stdint.h.

Signed-off-by: Stefan Weil <sw(a)weilnetz.de>
---
 pevent/parse-filter.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pevent/parse-filter.c b/pevent/parse-filter.c
index 0ce0122..3d2288b 100644
--- a/pevent/parse-filter.c
+++ b/pevent/parse-filter.c
@@ -22,6 +22,7 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 #include <stdio.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdarg.h>
@@ -1588,7 +1589,7 @@ get_value(struct event_format *event,
 		const char *name;
 
 		name = get_comm(event, record);
-		return (unsigned long long)name;
+		return (uintptr_t)name;
 	}
 
 	pevent_read_number_field(field, record->data, &val);
-- 
1.7.10