[PATCH] bdiff: use the new type hg_ssize_t

Kevin Bullock kbullock+mercurial at ringworld.org
Tue Jul 12 10:36:15 EDT 2016


> On Jul 11, 2016, at 09:24, Maciej Fijalkowski <fijall at gmail.com> wrote:
> 
> hoopefully not if we can get hg_ssize_t right
> 
> (the idea is that it's the same as Py_ssize_t, just not defined in Python.h)

Procedural nit: Since this patch depends on _having_ an hg_ssize_t, they should be patchbombed together in a series. If you're not sufficiently sure we've got the right implementation for hg_ssize_t, then let's drop this patch and you can re-send when hg_ssize_t lands.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock

> On Mon, Jul 11, 2016 at 3:43 PM, Adrian Buehlmann <adrian at cadifra.com> wrote:
>> On 2016-07-11 14:20, Maciej Fijalkowski wrote:
>>> # HG changeset patch
>>> # User Maciej Fijalkowski <fijall at gmail.com>
>>> # Date 1468239647 -7200
>>> #      Mon Jul 11 14:20:47 2016 +0200
>>> # Node ID 82d3a8b7e1e017a9cf2ccfe9f767fb5377a381fb
>>> # Parent  069b332ce21d278384f0b571349b9aba57b42056
>>> bdiff: use the new type hg_ssize_t
>>> 
>>> diff -r 069b332ce21d -r 82d3a8b7e1e0 mercurial/bdiff.c
>>> --- a/mercurial/bdiff.c       Mon Jul 11 13:53:35 2016 +0200
>>> +++ b/mercurial/bdiff.c       Mon Jul 11 14:20:47 2016 +0200
>>> @@ -16,11 +16,12 @@
>>> #include <limits.h>
>>> 
>>> #include "util.h"
>>> +#include "compat.h"
>>> #include "bitmanipulation.h"
>>> 
>>> struct line {
>>>      int hash, n, e;
>>> -     Py_ssize_t len;
>>> +     hg_ssize_t len;
>>>      const char *l;
>>> };
>>> 
>>> @@ -34,7 +35,7 @@
>>>      struct hunk *next;
>>> };
>>> 
>>> -static int splitlines(const char *a, Py_ssize_t len, struct line **lr)
>>> +static int splitlines(const char *a, hg_ssize_t len, struct line **lr)
>>> {
>>>      unsigned hash;
>>>      int i;
>> 
>> I suspect this reintroduces the problems that eab8ca175262 fixed.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list