Patchwork bdiff: use the new type hg_ssize_t

login
register
mail settings
Submitter Maciej Fijalkowski
Date July 11, 2016, 12:20 p.m.
Message ID <82d3a8b7e1e017a9cf2c.1468239655@brick.arcode.com>
Download mbox | patch
Permalink /patch/15789/
State Superseded
Headers show

Comments

Maciej Fijalkowski - July 11, 2016, 12:20 p.m.
# HG changeset patch
# User Maciej Fijalkowski <fijall@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
Adrian Buehlmann - July 11, 2016, 1:43 p.m.
On 2016-07-11 14:20, Maciej Fijalkowski wrote:
> # HG changeset patch
> # User Maciej Fijalkowski <fijall@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.
Maciej Fijalkowski - July 11, 2016, 2:24 p.m.
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)

On Mon, Jul 11, 2016 at 3:43 PM, Adrian Buehlmann <adrian@cadifra.com> wrote:
> On 2016-07-11 14:20, Maciej Fijalkowski wrote:
>> # HG changeset patch
>> # User Maciej Fijalkowski <fijall@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.

Patch

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;