/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/diff-delta.c

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
220
220
    unsigned int i, j, hmask, memsize, fit_in_old, copied_count;
221
221
    struct unpacked_index_entry *entry;
222
222
    struct delta_index *index;
223
 
    struct index_entry *packed_entry, **packed_hash, *old_entry;
 
223
    struct index_entry *packed_entry, **packed_hash, *old_entry, *copy_from;
224
224
    struct index_entry null_entry = {0};
225
225
    void *mem;
226
226
 
334
334
             * old_index->hash_mask? Would it make any real difference?
335
335
             */
336
336
            j = i & old_index->hash_mask;
 
337
            copy_from = old_index->hash[j];
337
338
            for (old_entry = old_index->hash[j];
338
339
                 old_entry < old_index->hash[j + 1] && old_entry->ptr != NULL;
339
340
                 old_entry++) {
904
905
    int inscnt;
905
906
    const unsigned char *ref_data, *ref_top, *data, *top;
906
907
    unsigned char *out;
 
908
    unsigned long source_size;
907
909
 
908
910
    if (!trg_buf || !trg_size)
909
911
        return DELTA_BUFFER_EMPTY;
918
920
    if (!out)
919
921
        return DELTA_OUT_OF_MEMORY;
920
922
 
 
923
    source_size = index->last_src->size + index->last_src->agg_offset;
 
924
 
921
925
    /* store target buffer size */
922
926
    i = trg_size;
923
927
    while (i >= 0x80) {
1049
1053
             */
1050
1054
            assert(moff < msource->size);
1051
1055
            moff += msource->agg_offset;
1052
 
            assert(moff + msize
1053
 
                <= index->last_src->size + index->last_src->agg_offset);
 
1056
            assert(moff + msize <= source_size);
1054
1057
            if (moff & 0x000000ff)
1055
1058
                out[outpos++] = moff >> 0,  i |= 0x01;
1056
1059
            if (moff & 0x0000ff00)