From 1e68c15dfd99e85be1eecdd1c426a35c6b8a6cc5 Mon Sep 17 00:00:00 2001 From: "Bjoern B. Brandenburg" Date: Thu, 22 May 2008 11:08:30 -0400 Subject: follow kernel API change: use fixed width fields --- src/ftcat.c | 10 +++++----- src/timestamp.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ftcat.c b/src/ftcat.c index 0afba87..b317cba 100644 --- a/src/ftcat.c +++ b/src/ftcat.c @@ -11,14 +11,14 @@ static int fd; static int event_count = 1; -static unsigned long ids[MAX_EVENTS]; +static cmd_t ids[MAX_EVENTS]; static int disable_all(int fd) { int ret, size; ids[0] = DISABLE_CMD; fprintf(stderr, "Disabling %d events.\n", event_count - 1); - size = event_count * sizeof(long); + size = event_count * sizeof(cmd_t); ret = write(fd, ids, size); //fprintf(stderr, "write = %d, meant to write %d (%m)\n", ret, size); return size == ret; @@ -26,8 +26,8 @@ static int disable_all(int fd) static int enable_events(int fd, char* str) { - unsigned long *id; - unsigned long cmd[3]; + cmd_t *id; + cmd_t cmd[3]; id = ids + event_count; if (!str2event(str, id)) @@ -38,7 +38,7 @@ static int enable_events(int fd, char* str) cmd[0] = ENABLE_CMD; cmd[1] = id[0]; cmd[2] = id[1]; - return write(fd, cmd, 3 * sizeof(long)) == 3 * sizeof(long); + return write(fd, cmd, 3 * sizeof(cmd_t)) == 3 * sizeof(cmd_t); } diff --git a/src/timestamp.c b/src/timestamp.c index b495603..1df252a 100644 --- a/src/timestamp.c +++ b/src/timestamp.c @@ -4,7 +4,7 @@ struct event_name { const char* name; - unsigned long id; + cmd_t id; }; #define EVENT(name) {#name, TS_ ## name ## _START} @@ -37,7 +37,7 @@ static struct event_name event_table[] = EVENT(SRPT) }; -int str2event(const char* str, unsigned long *id) +int str2event(const char* str, cmd_t *id) { int i; @@ -49,7 +49,7 @@ int str2event(const char* str, unsigned long *id) return 0; } -const char* event2str(unsigned long id) +const char* event2str(cmd_t id) { int i; -- cgit v1.2.2