aboutsummaryrefslogtreecommitdiff
path: root/gdb/go-exp.y
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2013-10-02 00:46:07 +0000
committerKeith Seitz <keiths@redhat.com>2013-10-02 00:46:07 +0000
commitd7561cbbf27a8ff771f85baf6696aa7645250484 (patch)
treeeb81d452fe456e9a043cc453bf8b65617b40e915 /gdb/go-exp.y
parent62574b938f80a485874b85a770d03bf0f21eece5 (diff)
downloadgdb-d7561cbbf27a8ff771f85baf6696aa7645250484.zip
gdb-d7561cbbf27a8ff771f85baf6696aa7645250484.tar.gz
gdb-d7561cbbf27a8ff771f85baf6696aa7645250484.tar.bz2
Constification of parse_linespec and fallout:
https://sourceware.org/ml/gdb-patches/2013-09/msg01017.html https://sourceware.org/ml/gdb-patches/2013-09/msg01018.html https://sourceware.org/ml/gdb-patches/2013-09/msg01019.html https://sourceware.org/ml/gdb-patches/2013-09/msg01020.html
Diffstat (limited to 'gdb/go-exp.y')
-rw-r--r--gdb/go-exp.y17
1 files changed, 9 insertions, 8 deletions
diff --git a/gdb/go-exp.y b/gdb/go-exp.y
index 2ccb394..01c382a 100644
--- a/gdb/go-exp.y
+++ b/gdb/go-exp.y
@@ -158,7 +158,7 @@ void yyerror (char *);
%{
/* YYSTYPE gets defined by %union. */
-static int parse_number (char *, int, int, YYSTYPE *);
+static int parse_number (const char *, int, int, YYSTYPE *);
static int parse_go_float (struct gdbarch *gdbarch, const char *p, int len,
DOUBLEST *d, struct type **t);
%}
@@ -704,7 +704,7 @@ parse_go_float (struct gdbarch *gdbarch, const char *p, int len,
as our YYSTYPE is different than c-exp.y's */
static int
-parse_number (char *p, int len, int parsed_float, YYSTYPE *putithere)
+parse_number (const char *p, int len, int parsed_float, YYSTYPE *putithere)
{
/* FIXME: Shouldn't these be unsigned? We don't deal with negative values
here, and we do kind of silly things like cast to unsigned. */
@@ -908,8 +908,8 @@ static int tempbuf_init;
number of host characters in the literal. */
static int
-parse_string_or_char (char *tokptr, char **outptr, struct typed_stoken *value,
- int *host_chars)
+parse_string_or_char (const char *tokptr, const char **outptr,
+ struct typed_stoken *value, int *host_chars)
{
int quote;
@@ -1049,7 +1049,7 @@ lex_one_token (void)
int c;
int namelen;
unsigned int i;
- char *tokstart;
+ const char *tokstart;
int saw_structop = last_was_structop;
char *copy;
@@ -1143,7 +1143,7 @@ lex_one_token (void)
{
/* It's a number. */
int got_dot = 0, got_e = 0, toktype;
- char *p = tokstart;
+ const char *p = tokstart;
int hex = input_radix > 10;
if (c == '0' && (p[1] == 'x' || p[1] == 'X'))
@@ -1190,7 +1190,7 @@ lex_one_token (void)
case '@':
{
- char *p = &tokstart[1];
+ const char *p = &tokstart[1];
size_t len = strlen ("entry");
while (isspace (*p))
@@ -1283,7 +1283,8 @@ lex_one_token (void)
&& strncmp (tokstart, "thread", namelen) == 0
&& (tokstart[namelen] == ' ' || tokstart[namelen] == '\t'))
{
- char *p = tokstart + namelen + 1;
+ const char *p = tokstart + namelen + 1;
+
while (*p == ' ' || *p == '\t')
p++;
if (*p >= '0' && *p <= '9')