* remote.c (struct packet_reg): Declare.
[deliverable/binutils-gdb.git] / gas / config / tc-i370.c
index bb6e01a3942a63c0e8d81c88852161663d1a2f49..de092b2b2990c7d6a81f51b587a7f3855b8917d3 100644 (file)
@@ -29,8 +29,8 @@
  */
 
 #include <stdio.h>
-#include <ctype.h>
 #include "as.h"
+#include "safe-ctype.h"
 #include "subsegs.h"
 #include "struc-symbol.h"
 
@@ -316,7 +316,7 @@ reg_name_search (regs, regcount, name)
  *
  * in:        Input_line_pointer points to 1st char of operand.
  *
- * out:        A expressionS.
+ * out:        An expressionS.
  *      The operand may have been a register: in this case, X_op == O_register,
  *      X_add_number is set to the register number, and truth is returned.
  *        Input_line_pointer->(next non-blank) char after operand, or is in its
@@ -332,9 +332,9 @@ register_name (expressionP)
   char *start;
   char c;
 
-  /* Find the spelling of the operand */
+  /* Find the spelling of the operand */
   start = name = input_line_pointer;
-  if (name[0] == '%' && isalpha (name[1]))
+  if (name[0] == '%' && ISALPHA (name[1]))
     name = ++input_line_pointer;
 
   else if (!reg_names_p)
@@ -343,36 +343,36 @@ register_name (expressionP)
   while (' ' == *name)
     name = ++input_line_pointer;
 
-  /* if its a number, treat it as a number */
-  /* if its alpha, look to see if it's in the register table */
-  if (!isalpha (name[0]))
+  /* If it's a number, treat it as a number.  If it's alpha, look to
+     see if it's in the register table.  */
+  if (!ISALPHA (name[0]))
     {
       reg_number = get_single_number ();
-      c = get_symbol_end ();
     }
   else
     {
       c = get_symbol_end ();
       reg_number = reg_name_search (pre_defined_registers, REG_NAME_CNT, name);
+
+      /* Put back the delimiting char.  */
+      *input_line_pointer = c;
     }
 
-  /* if numeric, make sure its not out of bounds */
+  /* If numeric, make sure its not out of bounds.  */
   if ((0 <= reg_number) && (16 >= reg_number))
     {
       expressionP->X_op = O_register;
       expressionP->X_add_number = reg_number;
 
-      /* make the rest nice */
+      /* Make the rest nice.  */
       expressionP->X_add_symbol = NULL;
       expressionP->X_op_symbol = NULL;
-      *input_line_pointer = c;   /* put back the delimiting char */
       return true;
     }
 
-    /* reset the line as if we had not done anything */
-    *input_line_pointer = c;   /* put back the delimiting char */
-    input_line_pointer = start; /* reset input_line pointer */
-    return false;
+  /* Reset the line as if we had not done anything.  */
+  input_line_pointer = start;
+  return false;
 }
 \f
 /* Local variables.  */
@@ -702,10 +702,10 @@ i370_elf_suffix (str_p, exp_p)
 
   for (ch = *str, str2 = ident;
        (str2 < ident + sizeof (ident) - 1
-        && (isalnum (ch) || ch == '@'));
+        && (ISALNUM (ch) || ch == '@'));
        ch = *++str)
     {
-      *str2++ = (islower (ch)) ? ch : tolower (ch);
+      *str2++ = TOLOWER (ch);
     }
 
   *str2 = '\0';
@@ -1489,11 +1489,11 @@ i370_addr_offset (expressionS *exx)
   lab = input_line_pointer;
   while (*lab && (',' != *lab) && ('(' != *lab))
     {
-      if (isdigit (*lab))
+      if (ISDIGIT (*lab))
        {
          all_digits = 1;
        }
-      else if (isalpha (*lab))
+      else if (ISALPHA (*lab))
        {
          if (!all_digits)
            {
@@ -1562,7 +1562,7 @@ i370_addr_cons (expressionS *exp)
   name = input_line_pointer;
   sym_name = input_line_pointer;
   /* Find the spelling of the operand */
-  if (name[0] == '=' && isalpha (name[1]))
+  if (name[0] == '=' && ISALPHA (name[1]))
     {
       name = ++input_line_pointer;
     }
@@ -1652,7 +1652,7 @@ i370_addr_cons (expressionS *exp)
              save = input_line_pointer;
              while (*save)
                {
-                 if (isxdigit (*save))
+                 if (ISXDIGIT (*save))
                    hex_len++;
                  save++;
                }
@@ -1979,7 +1979,7 @@ md_assemble (str)
 #endif
 
   /* Get the opcode.  */
-  for (s = str; *s != '\0' && ! isspace (*s); s++)
+  for (s = str; *s != '\0' && ! ISSPACE (*s); s++)
     ;
   if (*s != '\0')
     *s++ = '\0';
@@ -2004,7 +2004,7 @@ md_assemble (str)
   insn = opcode->opcode;
 
   str = s;
-  while (isspace (*str))
+  while (ISSPACE (*str))
     ++str;
 
   /* I370 operands are either expressions or address constants.
@@ -2183,7 +2183,7 @@ md_assemble (str)
             }
         }
 
-      /* check for a address constant expression */
+      /* Check for an address constant expression.  */
       /* We will put PSW-relative addresses in the text section,
        * and adress literals in the .data (or other) section.  */
       else if (i370_addr_cons (&ex))
@@ -2289,7 +2289,7 @@ md_assemble (str)
        ++str;
     }
 
-  while (isspace (*str))
+  while (ISSPACE (*str))
     ++str;
 
   if (*str != '\0')
@@ -2462,7 +2462,7 @@ i370_section_letter (letter, ptr_msg)
   if (letter == 'e')
     return SHF_EXCLUDE;
 
-  *ptr_msg = "Bad .section directive: want a,w,x,e in string";
+  *ptr_msg = "Bad .section directive: want a,e,w,x,M,S in string";
   return 0;
 }
 
This page took 0.025372 seconds and 4 git commands to generate.