Follow the model of strtol() et al - input string is const-qualified to
signal that the string isn't altered, but the returned "end" pointer is
not const-qualified, requiring const to be cast away (which generally is
a bad idea, but the alternative would be more convoluted code).
/* REG_STRING starts *before* REGISTER_PREFIX. */
static const reg_entry *
-parse_real_register (char *reg_string, char **end_op)
+parse_real_register (const char *reg_string, char **end_op)
{
- char *s = reg_string;
+ const char *s = reg_string;
char *p;
char reg_name_given[MAX_REG_NAME_SIZE + 1];
const reg_entry *r;
if (is_part_of_name (*s))
return (const reg_entry *) NULL;
- *end_op = s;
+ *end_op = (char *) s;
r = (const reg_entry *) str_hash_find (reg_hash, reg_name_given);
++s;
if (*s == ')')
{
- *end_op = s + 1;
+ *end_op = (char *) s + 1;
know (r[fpr].reg_num == fpr);
return r + fpr;
}