Skip to content

Commit

Permalink
_hashsplit.c: get rid of some warnings indicated by a C++ compiler.
Browse files Browse the repository at this point in the history
Not hugely important, but might as well fix them.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
  • Loading branch information
apenwarr committed Jul 28, 2010
1 parent 55a2df0 commit cf7b0d4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/bup/_hashsplit.c
Expand Up @@ -57,7 +57,7 @@ static uint32_t rollsum_digest(Rollsum *r)

static uint32_t rollsum_sum(uint8_t *buf, size_t ofs, size_t len)
{
int count;
size_t count;
Rollsum r;
rollsum_init(&r);
for (count = ofs; count < len; count++)
Expand All @@ -70,7 +70,7 @@ static PyObject *selftest(PyObject *self, PyObject *args)
{
uint8_t buf[100000];
uint32_t sum1a, sum1b, sum2a, sum2b, sum3a, sum3b;
int count;
unsigned count;

if (!PyArg_ParseTuple(args, ""))
return NULL;
Expand Down Expand Up @@ -190,14 +190,14 @@ static PyObject *write_random(PyObject *self, PyObject *args)

for (kbytes = 0; kbytes < len/1024; kbytes++)
{
int i;
unsigned i;
for (i = 0; i < sizeof(buf)/sizeof(buf[0]); i++)
buf[i] = random();
ret = write(fd, buf, sizeof(buf));
if (ret < 0)
ret = 0;
written += ret;
if (ret < sizeof(buf))
if (ret < (int)sizeof(buf))
break;
if (kbytes/1024 > 0 && !(kbytes%1024))
fprintf(stderr, "Random: %lld Mbytes\r", kbytes/1024);
Expand All @@ -206,7 +206,7 @@ static PyObject *write_random(PyObject *self, PyObject *args)
// handle non-multiples of 1024
if (len % 1024)
{
int i;
unsigned i;
for (i = 0; i < sizeof(buf)/sizeof(buf[0]); i++)
buf[i] = random();
ret = write(fd, buf, len % 1024);
Expand Down

0 comments on commit cf7b0d4

Please sign in to comment.