From 8f57187fa3e0a3e5840175c4a2af09b98c10f744 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 18 Mar 2015 15:01:44 +0100 Subject: Fix compiler warning in dtoa.c --- Python/dtoa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Python/dtoa.c') diff --git a/Python/dtoa.c b/Python/dtoa.c index 8996a7210c..3da546ed07 100644 --- a/Python/dtoa.c +++ b/Python/dtoa.c @@ -373,7 +373,7 @@ Balloc(int k) x = 1 << k; len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1) /sizeof(double); - if (k <= Kmax && pmem_next - private_mem + len <= PRIVATE_mem) { + if (k <= Kmax && pmem_next - private_mem + len <= (Py_ssize_t)PRIVATE_mem) { rv = (Bigint*)pmem_next; pmem_next += len; } @@ -1087,7 +1087,7 @@ sd2b(U *d, int scale, int *e) b = Balloc(1); if (b == NULL) return NULL; - + /* First construct b and e assuming that scale == 0. */ b->wds = 2; b->x[0] = word1(d); -- cgit v1.2.1 From d1ba93f9a6a441ac31c5fd1890ce730b9e6d330d Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 25 Dec 2015 19:53:18 +0200 Subject: Issue #25923: Added the const qualifier to static constant arrays. --- Python/dtoa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Python/dtoa.c') diff --git a/Python/dtoa.c b/Python/dtoa.c index 3da546ed07..3121cd6b9b 100644 --- a/Python/dtoa.c +++ b/Python/dtoa.c @@ -747,7 +747,7 @@ pow5mult(Bigint *b, int k) { Bigint *b1, *p5, *p51; int i; - static int p05[3] = { 5, 25, 125 }; + static const int p05[3] = { 5, 25, 125 }; if ((i = k & 3)) { b = multadd(b, p05[i-1], 0); @@ -803,7 +803,7 @@ pow5mult(Bigint *b, int k) { Bigint *b1, *p5, *p51; int i; - static int p05[3] = { 5, 25, 125 }; + static const int p05[3] = { 5, 25, 125 }; if ((i = k & 3)) { b = multadd(b, p05[i-1], 0); -- cgit v1.2.1 From 5c633fc25fc6f9beee3ccb9ebc06633d1c9a1bc3 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 25 Dec 2015 20:01:53 +0200 Subject: Issue #25923: Added more const qualifiers to signatures of static and private functions. --- Python/dtoa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/dtoa.c') diff --git a/Python/dtoa.c b/Python/dtoa.c index 3121cd6b9b..e0665b667e 100644 --- a/Python/dtoa.c +++ b/Python/dtoa.c @@ -2315,7 +2315,7 @@ rv_alloc(int i) } static char * -nrv_alloc(char *s, char **rve, int n) +nrv_alloc(const char *s, char **rve, int n) { char *rv, *t; -- cgit v1.2.1