Skip to content

Commit

Permalink
make parsing case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
bartman committed Apr 8, 2012
1 parent 2bba212 commit 031a759
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion include/0x10c_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__
6 changes: 3 additions & 3 deletions lib/0x10c_isn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 031a759

Please sign in to comment.