size down insn_map structructure by reducing the size of some fields. this alone makes lib binary size 2.6MB smaller
diff --git a/utils.c b/utils.c
index 800aa2c..1504048 100644
--- a/utils.c
+++ b/utils.c
@@ -71,7 +71,7 @@
// 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 count_positive(unsigned char *list)
{
unsigned int c;
diff --git a/utils.h b/utils.h
index 7400524..cac94fa 100644
--- a/utils.h
+++ b/utils.h
@@ -18,9 +18,9 @@
typedef struct insn_map {
unsigned int id;
unsigned int mapid;
- unsigned int regs_use[32]; // list of implicit registers used by this instruction
- unsigned int regs_mod[32]; // list of implicit registers modified by this instruction
- unsigned int groups[8]; // list of group this instruction belong to
+ unsigned char regs_use[12]; // list of implicit registers used by this instruction
+ unsigned char regs_mod[20]; // list of implicit registers modified by this instruction
+ unsigned char groups[8]; // list of group this instruction belong to
bool branch; // branch instruction?
bool indirect_branch; // indirect branch instruction?
} insn_map;
@@ -48,7 +48,7 @@
// 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 count_positive(unsigned char *list);
#define ARR_SIZE(a) (sizeof(a)/sizeof(a[0]))