add/use pid_branch_match macro

This commit is contained in:
Doug MacEachern 2007-06-02 17:37:05 +00:00
parent b498232e19
commit 17cfaa494a
1 changed files with 11 additions and 5 deletions

View File

@ -618,9 +618,19 @@ enum {
}; };
#ifdef SIGAR_64BIT #ifdef SIGAR_64BIT
#define str2pid(value, ptr) strtoull(value, &ptr, 10) #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 #else
#define str2pid(value, ptr) strtoul(value, &ptr, 10) #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 #endif
static int ptql_branch_init_pid(ptql_parse_branch_t *parsed, 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; return status;
} }
#ifdef SIGAR_64BIT matched = pid_branch_match(branch, pid, match_pid);
matched = ptql_op_ui64[branch->op_name](branch, pid, match_pid);
#else
matched = ptql_op_ui32[branch->op_name](branch, pid, match_pid);
#endif
return matched ? SIGAR_OK : 1; return matched ? SIGAR_OK : 1;
} }