Skip to content

Commit 57e4e6f

Browse files
committed
Clean up some type conversion issues that lead to C compiler warnings on Windows.
1 parent c55f00d commit 57e4e6f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/quicktions.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ cdef tuple _cache_pow10():
6666
cdef tuple POW_10 = _cache_pow10()
6767

6868

69-
cdef pow10(Py_ssize_t i):
69+
cdef pow10(long long i):
7070
if 0 <= i < CACHED_POW10:
7171
return POW_10[i]
7272
else:
@@ -156,9 +156,9 @@ cdef cunumber _ibgcd(cunumber a, cunumber b):
156156

157157
cdef _py_gcd(ullong a, ullong b):
158158
if a <= <ullong>INT_MAX and b <= <ullong>INT_MAX:
159-
return <int> _igcd[uint](a, b)
159+
return <int> _igcd[uint](<uint> a, <uint> b)
160160
elif a <= <ullong>LONG_MAX and b <= <ullong>LONG_MAX:
161-
return <long> _igcd[ulong](a, b)
161+
return <long> _igcd[ulong](<ulong> a, <ulong> b)
162162
elif b:
163163
a = _igcd[ullong](a, b)
164164
# try PyInt downcast in Py2
@@ -645,7 +645,7 @@ cdef class Fraction:
645645
return floor
646646
else:
647647
return floor + 1
648-
shift = pow10(abs(<Py_ssize_t>ndigits))
648+
shift = pow10(abs(<long long>ndigits))
649649
# See _operator_fallbacks.forward to check that the results of
650650
# these operations will always be Fraction and therefore have
651651
# round().

0 commit comments

Comments
 (0)