Permalink
Browse files

make parsing case insensitive

  • Loading branch information...
1 parent 2bba212 commit 031a75978c6547d86887c75e35fe02a79b9c985d @bartman committed Apr 8, 2012
Showing with 6 additions and 4 deletions.
  1. +3 −1 include/0x10c_def.h
  2. +3 −3 lib/0x10c_isn.c
View
@@ -67,7 +67,9 @@ typedef uint16_t x10c_word;
#define X10C_ARG_LITERAL_BASE 0x20
#define X10C_ARG_LITERAL(n) (X10C_ARG_LITERAL_BASE + n)
-
+/* are comparisons case sensitive? */
+#define X10C_OP_NAME_CMP strcasecmp
+#define X10C_REG_NAME_CMP strcasecmp
#endif // __included_0x10c_def_h__
View
@@ -54,13 +54,13 @@ struct x10c_isn * x10c_lookup_isn_for_name(const char *name)
for (i=0; i<X10C_OP_MAX; i++) {
isn = &x10c_basic_isns[i];
- if (isn->op_name && !strcmp(isn->op_name, name))
+ if (isn->op_name && !X10C_OP_NAME_CMP(isn->op_name, name))
return isn;
}
for (i=0; i<X10C_XOP_MAX; i++) {
isn = &x10c_non_basic_isns[i];
- if (isn->op_name && !strcmp(isn->op_name, name))
+ if (isn->op_name && !X10C_OP_NAME_CMP(isn->op_name, name))
return isn;
}
@@ -96,7 +96,7 @@ struct x10c_reg * x10c_lookup_reg_for_name(const char *name)
for (i=0; i<X10C_REGS_MAX; i++) {
reg = & x10c_regs[i];
- if (reg->reg_name && !strcmp(reg->reg_name, name))
+ if (reg->reg_name && !X10C_REG_NAME_CMP(reg->reg_name, name))
return reg;
}

0 comments on commit 031a759

Please sign in to comment.