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]

Re: two patches for bugs in BFD/peXXigen.c


Kai Tietz <ktietz70@googlemail.com> writes:

> 2010/9/6 Alan Modra <amodra@gmail.com>:
>> @@ -1860,12 +1855,14 @@ _bfd_XX_print_ce_compressed_pdata (bfd *
>> Â Â Â if (tsection && coff_section_data (abfd, tsection)
>> Â Â Â Â Â&& pei_section_data (abfd, tsection))
>> Â Â Â Â{
>> - Â Â Â Â if (bfd_malloc_and_get_section (abfd, tsection, & tdata))
>> - Â Â Â Â Â {
>> Â Â Â Â Â Â Âint xx = (begin_addr - 8) - tsection->vma;
>> + Â Â Â Â bfd_byte *tdata;
>>
>> Â Â Â Â Â Â Âtdata = (bfd_byte *) bfd_malloc (8);
>> - Â Â Â Â Â Â if (bfd_get_section_contents (abfd, tsection, tdata, (bfd_vma) xx, 8))
>> + Â Â Â Â if (tdata)
>> + Â Â Â Â Â {
>> + Â Â Â Â Â Â if (bfd_get_section_contents (abfd, tsection,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tdata, (bfd_vma) xx, 8))
>> Â Â Â Â Â Â Â Â{
>> Â Â Â Â Â Â Â Â Âbfd_vma eh, eh_data;
>>
>
> Here I don't see the reason for using 'int' as type for xx. Why not
> simply using here bfd_vma type and so no cast to this type is
> necessary?

And for extra bonus, rename the variable to something more
descriptive. :-)

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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