summaryrefslogtreecommitdiff
path: root/opcodes/xc16x-asm.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-03-03 15:57:43 +0000
committerNick Clifton <nickc@redhat.com>2006-03-03 15:57:43 +0000
commitc46798bb8fede9807a5d1d1dba39ff1dadd2acbd (patch)
tree2511442281ba5de093802b400560ecf14a177829 /opcodes/xc16x-asm.c
parent8a3672b5b84bd580f36ea0924760749e7eb79370 (diff)
downloadbinutils-redhat-c46798bb8fede9807a5d1d1dba39ff1dadd2acbd.tar.gz
Fix parseing functions to return an error message if the parse failedgdb-csl-available-20060303-branchpoint
Diffstat (limited to 'opcodes/xc16x-asm.c')
-rw-r--r--opcodes/xc16x-asm.c56
1 files changed, 38 insertions, 18 deletions
diff --git a/opcodes/xc16x-asm.c b/opcodes/xc16x-asm.c
index eb3a0e51b1..63d7318ce0 100644
--- a/opcodes/xc16x-asm.c
+++ b/opcodes/xc16x-asm.c
@@ -58,8 +58,11 @@ parse_hash (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
long *valuep ATTRIBUTE_UNUSED)
{
if (**strp == '#')
- ++*strp;
- return NULL;
+ {
+ ++*strp;
+ return NULL;
+ }
+ return _("Missing '#' prefix");
}
/* Handle '.' prefixes (i.e. skip over them). */
@@ -71,11 +74,14 @@ parse_dot (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
long *valuep ATTRIBUTE_UNUSED)
{
if (**strp == '.')
- ++*strp;
- return NULL;
+ {
+ ++*strp;
+ return NULL;
+ }
+ return _("Missing '.' prefix");
}
-/* Handle '.' prefixes (i.e. skip over them). */
+/* Handle 'pof:' prefixes (i.e. skip over them). */
static const char *
parse_pof (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
@@ -83,12 +89,15 @@ parse_pof (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
int opindex ATTRIBUTE_UNUSED,
long *valuep ATTRIBUTE_UNUSED)
{
- if (!strncasecmp (*strp, "pof:", 4))
- *strp += 4;
- return NULL;
+ if (strncasecmp (*strp, "pof:", 4) == 0)
+ {
+ *strp += 4;
+ return NULL;
+ }
+ return _("Missing 'pof:' prefix");
}
-/* Handle '.' prefixes (i.e. skip over them). */
+/* Handle 'pag:' prefixes (i.e. skip over them). */
static const char *
parse_pag (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
@@ -96,33 +105,44 @@ parse_pag (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
int opindex ATTRIBUTE_UNUSED,
long *valuep ATTRIBUTE_UNUSED)
{
- if (!strncasecmp (*strp, "pag:", 4))
- *strp += 4;
- return NULL;
+ if (strncasecmp (*strp, "pag:", 4) == 0)
+ {
+ *strp += 4;
+ return NULL;
+ }
+ return _("Missing 'pag:' prefix");
}
/* Handle 'sof' prefixes (i.e. skip over them). */
+
static const char *
parse_sof (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
const char **strp,
int opindex ATTRIBUTE_UNUSED,
long *valuep ATTRIBUTE_UNUSED)
{
- if (!strncasecmp (*strp, "sof:", 4))
- *strp += 4;
- return NULL;
+ if (strncasecmp (*strp, "sof:", 4) == 0)
+ {
+ *strp += 4;
+ return NULL;
+ }
+ return _("Missing 'sof:' prefix");
}
/* Handle 'seg' prefixes (i.e. skip over them). */
+
static const char *
parse_seg (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
const char **strp,
int opindex ATTRIBUTE_UNUSED,
long *valuep ATTRIBUTE_UNUSED)
{
- if (!strncasecmp (*strp, "seg:", 4))
- *strp += 4;
- return NULL;
+ if (strncasecmp (*strp, "seg:", 4) == 0)
+ {
+ *strp += 4;
+ return NULL;
+ }
+ return _("Missing 'seg:' prefix");
}
/* -- */