mirror of
https://github.com/borgbackup/borg.git
synced 2025-03-19 10:25:49 +00:00
Merge pull request #62 from tungd/master
Fix for ISO C90 compliance This fixes a "-Werror=declaration-after-statement" related compile issue with Python 3.4
This commit is contained in:
commit
16ab296ce1
1 changed files with 5 additions and 4 deletions
|
@ -117,6 +117,7 @@ static int
|
|||
chunker_fill(Chunker *c)
|
||||
{
|
||||
size_t n;
|
||||
PyObject *data;
|
||||
memmove(c->data, c->data + c->last, c->position + c->remaining - c->last);
|
||||
c->position -= c->last;
|
||||
c->last = 0;
|
||||
|
@ -124,7 +125,7 @@ chunker_fill(Chunker *c)
|
|||
if(c->eof || n == 0) {
|
||||
return 1;
|
||||
}
|
||||
PyObject *data = PyObject_CallMethod(c->fd, "read", "i", n);
|
||||
data = PyObject_CallMethod(c->fd, "read", "i", n);
|
||||
if(!data) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -159,6 +160,7 @@ chunker_process(Chunker *c)
|
|||
{
|
||||
uint32_t sum, chunk_mask = c->chunk_mask, min_size = c->min_size, window_size = c->window_size;
|
||||
int n = 0;
|
||||
int old_last;
|
||||
|
||||
if(c->done) {
|
||||
if(c->bytes_read == c->bytes_yielded)
|
||||
|
@ -204,10 +206,9 @@ chunker_process(Chunker *c)
|
|||
c->position += c->remaining;
|
||||
c->remaining = 0;
|
||||
}
|
||||
int old_last = c->last;
|
||||
old_last = c->last;
|
||||
c->last = c->position;
|
||||
n = c->last - old_last;
|
||||
c->bytes_yielded += n;
|
||||
return PyBuffer_FromMemory(c->data + old_last, n);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue