~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff-delta.c

  • Committer: John Arbash Meinel
  • Date: 2010-07-28 21:52:51 UTC
  • mto: This revision was merged to the branch mainline in revision 5369.
  • Revision ID: john@arbash-meinel.com-20100728215251-ylmowc0jmddlbmuc
Fix some signed integer warnings in diff-delta.c

We know that the first item comes after the second, so 'x - y' is known
to be positive. So we can just cast it, to avoid the compiler warning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
853
853
    free(index);
854
854
}
855
855
 
856
 
unsigned long sizeof_delta_index(struct delta_index *index)
 
856
unsigned long
 
857
sizeof_delta_index(struct delta_index *index)
857
858
{
858
859
    if (index)
859
860
        return index->memsize;
956
957
                 * match more bytes with this location that we have already
957
958
                 * matched.
958
959
                 */
959
 
                if (ref_size > top - src)
 
960
                if (ref_size > (unsigned int)(top - src))
960
961
                    ref_size = top - src;
961
962
                if (ref_size <= msize)
962
963
                    break;
963
964
                /* See how many bytes actually match at this location. */
964
965
                while (ref_size-- && *src++ == *ref)
965
966
                    ref++;
966
 
                if (msize < ref - entry->ptr) {
 
967
                if (msize < (unsigned int)(ref - entry->ptr)) {
967
968
                    /* this is our best match so far */
968
969
                    msize = ref - entry->ptr;
969
970
                    msource = entry->src;