diff options
author | Tristan Gingold <gingold@adacore.com> | 2011-11-23 11:22:22 +0000 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2011-11-23 11:22:22 +0000 |
commit | 91ea3caed73075bebeaa2d0626b14fb7410cd15d (patch) | |
tree | 33d09696431095cbed06d64f75bddfa1f76169bf /bfd/vms-lib.c | |
parent | 837b3435bc80eade8aa655030173560af3be609c (diff) | |
download | gdb-91ea3caed73075bebeaa2d0626b14fb7410cd15d.zip gdb-91ea3caed73075bebeaa2d0626b14fb7410cd15d.tar.gz gdb-91ea3caed73075bebeaa2d0626b14fb7410cd15d.tar.bz2 |
2011-11-23 Tristan Gingold <gingold@adacore.com>
* vms-lib.c (get_idxlen): Add comments. Fix type in sizeof.
(vms_write_index): Add comments.
Diffstat (limited to 'bfd/vms-lib.c')
-rw-r--r-- | bfd/vms-lib.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/bfd/vms-lib.c b/bfd/vms-lib.c index 0584186..b325d74 100644 --- a/bfd/vms-lib.c +++ b/bfd/vms-lib.c @@ -1542,18 +1542,24 @@ get_idxlen (struct lib_index *idx, bfd_boolean is_elfidx) { if (is_elfidx) { + /* 9 is the size of struct vms_elfidx without keyname. */ if (idx->namlen > MAX_KEYLEN) - return 9 + sizeof (struct vms_rfa); + return 9 + sizeof (struct vms_kbn); else return 9 + idx->namlen; } else - return 7 + idx->namlen; + { + /* 7 is the size of struct vms_idx without keyname. */ + return 7 + idx->namlen; + } } -/* Write the index. VBN is the first vbn to be used, and will contain - on return the last vbn. +/* Write the index composed by NBR symbols contained in IDX. + VBN is the first vbn to be used, and will contain on return the last vbn. Can be called with ABFD set to NULL just to size the index. + If not null, TOPVBN will be assigned to the vbn of the root index tree. + IS_ELFIDX is true for elfidx (ie ia64) indexes layout. Return TRUE on success. */ static bfd_boolean @@ -1637,9 +1643,11 @@ vms_write_index (bfd *abfd, } *(unsigned short *)kbn_blk = 0; } + /* Allocate a new block for the keys. */ kbn_vbn = (*vbn)++; kbn_sz = VMS_BLOCK_SIZE - 2; } + /* Size of the chunk written to the current key block. */ if (kl + sizeof (struct vms_kbn) > kbn_sz) kl_chunk = kbn_sz - sizeof (struct vms_kbn); else |