File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ static PyObject *
164164imath_ilog2 (PyObject * module , PyObject * n )
165165/*[clinic end generated code: output=6ab48d1a7f5160c2 input=e2d8e8631ec5c29b]*/
166166{
167- size_t bits ;
167+ int64_t bits ;
168168
169169 n = PyNumber_Index (n );
170170 if (n == NULL ) {
@@ -174,17 +174,17 @@ imath_ilog2(PyObject *module, PyObject *n)
174174 if (!_PyLong_IsPositive ((PyLongObject * )n )) {
175175 PyErr_SetString (
176176 PyExc_ValueError ,
177- "ilog () argument must be positive" );
177+ "ilog2 () argument must be positive" );
178178 Py_DECREF (n );
179179 return NULL ;
180180 }
181181
182182 bits = _PyLong_NumBits (n );
183183 Py_DECREF (n );
184- if (bits == ( size_t )( -1 ) ) {
184+ if (bits == -1 ) {
185185 return NULL ;
186186 }
187- return PyLong_FromSize_t (bits - 1 );
187+ return PyLong_FromInt64 (bits - 1 );
188188}
189189
190190
You can’t perform that action at this time.
0 commit comments