Rev 5365: Use signed ints to avoid the compiler warning. in http://bazaar.launchpad.net/~jameinel/bzr/2.3-sizeof
John Arbash Meinel
john at arbash-meinel.com
Mon Aug 2 17:35:20 BST 2010
At http://bazaar.launchpad.net/~jameinel/bzr/2.3-sizeof
------------------------------------------------------------
revno: 5365
revision-id: john at arbash-meinel.com-20100802163511-mb7oviwm3780iqa0
parent: john at arbash-meinel.com-20100728215742-esfp3yi4awd39070
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.3-sizeof
timestamp: Mon 2010-08-02 11:35:11 -0500
message:
Use signed ints to avoid the compiler warning.
-------------- next part --------------
=== modified file 'bzrlib/diff-delta.c'
--- a/bzrlib/diff-delta.c 2010-07-28 21:52:51 +0000
+++ b/bzrlib/diff-delta.c 2010-08-02 16:35:11 +0000
@@ -873,7 +873,8 @@
const void *trg_buf, unsigned long trg_size,
unsigned long *delta_size, unsigned long max_size)
{
- unsigned int i, outpos, outsize, moff, msize, val;
+ unsigned int i, outpos, outsize, moff, val;
+ int msize;
const struct source_info *msource;
int inscnt;
const unsigned char *ref_data, *ref_top, *data, *top;
@@ -944,7 +945,7 @@
entry++) {
const unsigned char *ref;
const unsigned char *src;
- unsigned int ref_size;
+ int ref_size;
if (entry->val != val)
continue;
ref = entry->ptr;
@@ -957,14 +958,14 @@
* match more bytes with this location that we have already
* matched.
*/
- if (ref_size > (unsigned int)(top - src))
+ if (ref_size > (top - src))
ref_size = top - src;
if (ref_size <= msize)
break;
/* See how many bytes actually match at this location. */
while (ref_size-- && *src++ == *ref)
ref++;
- if (msize < (unsigned int)(ref - entry->ptr)) {
+ if (msize < (ref - entry->ptr)) {
/* this is our best match so far */
msize = ref - entry->ptr;
msource = entry->src;
More information about the bazaar-commits
mailing list