From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23493 invoked by alias); 17 Aug 2009 09:13:12 -0000 Received: (qmail 23482 invoked by uid 22791); 17 Aug 2009 09:13:11 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 Aug 2009 09:13:03 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7H9D1YR026309 for ; Mon, 17 Aug 2009 05:13:01 -0400 Received: from pobox.fab.redhat.com (pobox.fab.redhat.com [10.33.63.12]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n7H9D04i011406 for ; Mon, 17 Aug 2009 05:13:00 -0400 Received: from localhost.localdomain.redhat.com (vpn1-4-108.ams2.redhat.com [10.36.4.108]) by pobox.fab.redhat.com (8.13.1/8.13.1) with ESMTP id n7H9CsvS001903 for ; Mon, 17 Aug 2009 05:12:57 -0400 To: binutils@sourceware.org Subject: Committed: Update tc-microblaze.c to use safe-ctype.h From: Nick Clifton Date: Mon, 17 Aug 2009 09:24:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2009-08/txt/msg00275.txt.bz2 --=-=-= Content-length: 387 Hi Guys, I am applying the patch below to change the recently contributed tc-microblaze.c file over from using to using "safe-ctype.h". Cheers Nick gas/ChangeLog 2009-08-17 Nick Clifton * 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. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=tc-microblaze.c.patch Content-length: 4986 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 #include #include #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 #include #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. */ --=-=-=--