From 17cfaa494a1dfefdfaab3306f0f4de2b9e67fc43 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 2 Jun 2007 17:37:05 +0000 Subject: [PATCH] add/use pid_branch_match macro --- src/sigar_ptql.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/sigar_ptql.c b/src/sigar_ptql.c index 68718b54..ec333b84 100644 --- a/src/sigar_ptql.c +++ b/src/sigar_ptql.c @@ -618,9 +618,19 @@ enum { }; #ifdef SIGAR_64BIT + #define str2pid(value, ptr) strtoull(value, &ptr, 10) + +#define pid_branch_match(branch, pid, match_pid) \ + ptql_op_ui64[branch->op_name](branch, pid, match_pid) + #else + #define str2pid(value, ptr) strtoul(value, &ptr, 10) + +#define pid_branch_match(branch, pid, match_pid) \ + ptql_op_ui32[branch->op_name](branch, pid, match_pid) + #endif static int ptql_branch_init_pid(ptql_parse_branch_t *parsed, @@ -715,11 +725,7 @@ static int ptql_pid_match(sigar_t *sigar, return status; } -#ifdef SIGAR_64BIT - matched = ptql_op_ui64[branch->op_name](branch, pid, match_pid); -#else - matched = ptql_op_ui32[branch->op_name](branch, pid, match_pid); -#endif + matched = pid_branch_match(branch, pid, match_pid); return matched ? SIGAR_OK : 1; }