This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Committed: Update tc-microblaze.c to use safe-ctype.h


Hi Guys,

  I am applying the patch below to change the recently contributed
  tc-microblaze.c file over from using <ctype.h> to using
  "safe-ctype.h".

Cheers
  Nick

gas/ChangeLog
2009-08-17  Nick Clifton  <nickc@redhat.com>

	* config/tc-microblaze.c: Include safe-ctype.h instead of ctype.h.
	(parse_reg): Use safe-ctype.h macros.
	(parse_exp): Likewise.
	(md_assemble): Likewise.

Index: gas/config/tc-microblaze.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-microblaze.c,v
retrieving revision 1.1
diff -c -3 -p -r1.1 tc-microblaze.c
*** gas/config/tc-microblaze.c	6 Aug 2009 17:38:02 -0000	1.1
--- gas/config/tc-microblaze.c	17 Aug 2009 09:05:28 -0000
***************
*** 26,32 ****
  #define DEFINE_TABLE
  #include "../opcodes/microblaze-opc.h"
  #include "../opcodes/microblaze-opcm.h"
! #include <ctype.h>
  #include <string.h>
  #include <dwarf2dbg.h>
  #include "aout/stab_gnu.h"
--- 26,32 ----
  #define DEFINE_TABLE
  #include "../opcodes/microblaze-opc.h"
  #include "../opcodes/microblaze-opcm.h"
! #include "safe-ctype.h"
  #include <string.h>
  #include <dwarf2dbg.h>
  #include "aout/stab_gnu.h"
*************** parse_reg (char * s, unsigned * reg)
*** 409,415 ****
    unsigned tmpreg = 0;
  
    /* Strip leading whitespace.  */
!   while (isspace (* s))
      ++ s;
  
    if (strncasecmp (s, "rpc", 3) == 0)
--- 409,415 ----
    unsigned tmpreg = 0;
  
    /* Strip leading whitespace.  */
!   while (ISSPACE (* s))
      ++ s;
  
    if (strncasecmp (s, "rpc", 3) == 0)
*************** parse_reg (char * s, unsigned * reg)
*** 481,493 ****
    /* MMU registers end.  */
    else if (strncasecmp (s, "rpvr", 4) == 0)
      {
!       if (isdigit (s[4]) && isdigit (s[5]))
          {
            tmpreg = (s[4]-'0')*10 + s[5] - '0';
            s += 6;
          }
  
!       else if (isdigit (s[4]))
          {
            tmpreg = s[4] - '0';
            s += 5;
--- 481,493 ----
    /* MMU registers end.  */
    else if (strncasecmp (s, "rpvr", 4) == 0)
      {
!       if (ISDIGIT (s[4]) && ISDIGIT (s[5]))
          {
            tmpreg = (s[4]-'0')*10 + s[5] - '0';
            s += 6;
          }
  
!       else if (ISDIGIT (s[4]))
          {
            tmpreg = s[4] - '0';
            s += 5;
*************** parse_reg (char * s, unsigned * reg)
*** 510,521 ****
      }
    else if (strncasecmp (s, "rfsl", 4) == 0)
      {
!       if (isdigit (s[4]) && isdigit (s[5]))
          {
            tmpreg = (s[4] - '0') * 10 + s[5] - '0';
            s += 6;
          }
!       else if (isdigit (s[4]))
          {
            tmpreg = s[4] - '0';
            s += 5;
--- 510,521 ----
      }
    else if (strncasecmp (s, "rfsl", 4) == 0)
      {
!       if (ISDIGIT (s[4]) && ISDIGIT (s[5]))
          {
            tmpreg = (s[4] - '0') * 10 + s[5] - '0';
            s += 6;
          }
!       else if (ISDIGIT (s[4]))
          {
            tmpreg = s[4] - '0';
            s += 5;
*************** parse_reg (char * s, unsigned * reg)
*** 523,529 ****
        else
  	as_bad (_("register expected, but saw '%.6s'"), s);
  
!       if ((int)tmpreg >= MIN_REGNUM && tmpreg <= MAX_REGNUM)
          *reg = tmpreg;
        else
  	{
--- 523,529 ----
        else
  	as_bad (_("register expected, but saw '%.6s'"), s);
  
!       if ((int) tmpreg >= MIN_REGNUM && tmpreg <= MAX_REGNUM)
          *reg = tmpreg;
        else
  	{
*************** parse_reg (char * s, unsigned * reg)
*** 534,547 ****
      }
    else
      {
!       if (tolower (s[0]) == 'r')
          {
!           if (isdigit (s[1]) && isdigit (s[2]))
              {
                tmpreg = (s[1] - '0') * 10 + s[2] - '0';
                s += 3;
              }
!           else if (isdigit (s[1]))
              {
                tmpreg = s[1] - '0';
                s += 2;
--- 534,547 ----
      }
    else
      {
!       if (TOLOWER (s[0]) == 'r')
          {
!           if (ISDIGIT (s[1]) && ISDIGIT (s[2]))
              {
                tmpreg = (s[1] - '0') * 10 + s[2] - '0';
                s += 3;
              }
!           else if (ISDIGIT (s[1]))
              {
                tmpreg = s[1] - '0';
                s += 2;
*************** parse_exp (char *s, expressionS *e)
*** 571,577 ****
    char *new;
  
    /* Skip whitespace.  */
!   while (isspace (* s))
      ++ s;
  
    save = input_line_pointer;
--- 571,577 ----
    char *new;
  
    /* Skip whitespace.  */
!   while (ISSPACE (* s))
      ++ s;
  
    save = input_line_pointer;
*************** md_assemble (char * str)
*** 806,812 ****
    char name[20];
  
    /* Drop leading whitespace.  */
!   while (isspace (* str))
      str ++;
  
    /* Find the op code end.  */
--- 806,812 ----
    char name[20];
  
    /* Drop leading whitespace.  */
!   while (ISSPACE (* str))
      str ++;
  
    /* Find the op code end.  */
*************** md_assemble (char * str)
*** 1612,1618 ****
      }
  
    /* Drop whitespace after all the operands have been parsed.  */
!   while (isspace (* op_end))
      op_end ++;
  
    /* Give warning message if the insn has more operands than required.  */
--- 1612,1618 ----
      }
  
    /* Drop whitespace after all the operands have been parsed.  */
!   while (ISSPACE (* op_end))
      op_end ++;
  
    /* Give warning message if the insn has more operands than required.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]