Skip to content

Commit 90a97ee

Browse files
committed
Revert fix warnings for semaphore
1 parent 5a8b32f commit 90a97ee

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Modules/_multiprocessing/semaphore.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -631,14 +631,14 @@ _multiprocessing_SemLock__get_value_impl(SemLockObject *self)
631631
PyErr_SetNone(PyExc_NotImplementedError);
632632
return NULL;
633633
#else
634-
long sval;
634+
int sval;
635635
if (SEM_GETVALUE(self->handle, &sval) < 0)
636636
return _PyMp_SetError(NULL, MP_STANDARD_ERROR);
637637
/* some posix implementations use negative numbers to indicate
638638
the number of waiting threads */
639639
if (sval < 0)
640640
sval = 0;
641-
return PyLong_FromLong(sval);
641+
return PyLong_FromLong((long)sval);
642642
#endif
643643
}
644644

@@ -663,10 +663,10 @@ _multiprocessing_SemLock__is_zero_impl(SemLockObject *self)
663663
Py_RETURN_FALSE;
664664
}
665665
#else
666-
long sval;
666+
int sval;
667667
if (SEM_GETVALUE(self->handle, &sval) < 0)
668668
return _PyMp_SetError(NULL, MP_STANDARD_ERROR);
669-
return PyBool_FromLong(sval == 0);
669+
return PyBool_FromLong((long)sval == 0);
670670
#endif
671671
}
672672

0 commit comments

Comments
 (0)