* python/py-progspace.c (py_free_pspace): Obtain arch another
[deliverable/binutils-gdb.git] / gdb / jv-exp.y
index a904c3295f5e971c34ab16429393f2d74c6a1979..678a4341923f5ef3c51a12698089f4388f8ebc0b 100644 (file)
@@ -547,7 +547,6 @@ CastExpression:
                  write_exp_elt_opcode (UNOP_CAST); }
 |      '(' Expression ')' UnaryExpressionNotPlusMinus
                {
-                 int exp_size = expout_ptr;
                  int last_exp_size = length_of_subexp(expout, expout_ptr);
                  struct type *type;
                  int i;
@@ -704,25 +703,28 @@ parse_number (char *p, int len, int parsed_float, YYSTYPE *putithere)
 
   if (parsed_float)
     {
-      /* It's a float since it contains a point or an exponent.  */
-      char c;
-      int num = 0;     /* number of tokens scanned by scanf */
-      char saved_char = p[len];
-
-      p[len] = 0;      /* null-terminate the token */
-      num = sscanf (p, "%" DOUBLEST_SCAN_FORMAT "%c",
-                   &putithere->typed_val_float.dval, &c);
-      p[len] = saved_char;     /* restore the input stream */
-      if (num != 1)            /* check scanf found ONLY a float ... */
+      const char *suffix;
+      int suffix_len;
+
+      if (! parse_float (p, len, &putithere->typed_val_float.dval, &suffix))
        return ERROR;
-      /* See if it has `f' or `d' suffix (float or double).  */
 
-      c = tolower (p[len - 1]);
+      suffix_len = p + len - suffix;
 
-      if (c == 'f' || c == 'F')
-       putithere->typed_val_float.type = parse_type->builtin_float;
-      else if (isdigit (c) || c == '.' || c == 'd' || c == 'D')
+      if (suffix_len == 0)
        putithere->typed_val_float.type = parse_type->builtin_double;
+      else if (suffix_len == 1)
+       {
+         /* See if it has `f' or `d' suffix (float or double).  */
+         if (tolower (*suffix) == 'f')
+           putithere->typed_val_float.type =
+             parse_type->builtin_float;
+         else if (tolower (*suffix) == 'd')
+           putithere->typed_val_float.type =
+             parse_type->builtin_double;
+         else
+           return ERROR;
+       }
       else
        return ERROR;
 
@@ -1358,7 +1360,6 @@ push_expression_name (struct stoken name)
 {
   char *tmp;
   struct type *typ;
-  char *ptr;
   int i;
 
   for (i = 0;  i < name.length;  i++)
This page took 0.028233 seconds and 4 git commands to generate.