commit | f35e2ad35ca48347088be1a3e4f67fdfcda33db8 | [log] [tgz] |
---|---|---|
author | Nguyen Anh Quynh <aquynh@gmail.com> | Tue Dec 03 11:10:26 2013 +0800 |
committer | Nguyen Anh Quynh <aquynh@gmail.com> | Tue Dec 03 11:10:26 2013 +0800 |
tree | 04b36fd5fc3017b6e8a918f61b3a7d49266caf41 | |
parent | 25f5612d4d241be9be7c252a6e3945baedd8d697 [diff] [blame] |
add @regs_read_count, @regs_write_count, @groups_count to @cs_insn. bump API to 1.4
diff --git a/utils.c b/utils.c index 882ef2d..539ab14 100644 --- a/utils.c +++ b/utils.c
@@ -66,3 +66,13 @@ return 0; } +// count number of positive members in a list. +// NOTE: list must be guaranteed to end in 0 +unsigned int count_positive(unsigned int *list) +{ + unsigned int c; + + for (c = 0; list[c] > 0; c++); + + return c; +}