X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=opcodes%2Fcgen-opc.c;h=263eb2c4d58f393dd87ae99d56868ef083a1a931;hb=0e8aefe7f01abedbb2e011e8b451ac6cfbc61ffe;hp=d34aac826cf67eeb1ceb367978b19747b5f0f558;hpb=01f0fe5e0450edf168c1f612feb93cf588e4e7ea;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/cgen-opc.c b/opcodes/cgen-opc.c index d34aac826c..263eb2c4d5 100644 --- a/opcodes/cgen-opc.c +++ b/opcodes/cgen-opc.c @@ -1,24 +1,25 @@ /* CGEN generic opcode support. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2005 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2005, 2007, 2009 Free Software Foundation, Inc. - This file is part of the GNU Binutils and GDB, the GNU debugger. + This file is part of libopcodes. - This program is free software; you can redistribute it and/or modify + This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + It is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "alloca-conf.h" #include "sysdep.h" #include #include "ansidecl.h" @@ -28,10 +29,6 @@ #include "symcat.h" #include "opcode/cgen.h" -#ifdef HAVE_ALLOCA_H -#include -#endif - static unsigned int hash_keyword_name (const CGEN_KEYWORD *, const char *, int); static unsigned int hash_keyword_value @@ -379,10 +376,11 @@ cgen_get_insn_value (CGEN_CPU_DESC cd, unsigned char *buf, int length) for (i = 0; i < length; i += insn_chunk_bitsize) /* NB: i == bits */ { - int index; + int bit_index; bfd_vma this_value; - index = i; /* NB: not dependent on endianness; opposite of cgen_put_insn_value! */ - this_value = bfd_get_bits (& buf[index / 8], insn_chunk_bitsize, big_p); + + bit_index = i; /* NB: not dependent on endianness; opposite of cgen_put_insn_value! */ + this_value = bfd_get_bits (& buf[bit_index / 8], insn_chunk_bitsize, big_p); value = (value << insn_chunk_bitsize) | this_value; } } @@ -417,9 +415,10 @@ cgen_put_insn_value (CGEN_CPU_DESC cd, for (i = 0; i < length; i += insn_chunk_bitsize) /* NB: i == bits */ { - int index; - index = (length - insn_chunk_bitsize - i); /* NB: not dependent on endianness! */ - bfd_put_bits ((bfd_vma) value, & buf[index / 8], insn_chunk_bitsize, big_p); + int bit_index; + + bit_index = (length - insn_chunk_bitsize - i); /* NB: not dependent on endianness! */ + bfd_put_bits ((bfd_vma) value, & buf[bit_index / 8], insn_chunk_bitsize, big_p); value >>= insn_chunk_bitsize; } }