From: Jeremy Hylton Date: Fri, 28 Nov 2008 23:42:59 +0000 (+0000) Subject: Move definition int sval into branch of ifdef where it is used. X-Git-Tag: v2.7a1~2610 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d52182f67bf8db13c15386bf6dd5a1ab9468a44;p=thirdparty%2FPython%2Fcpython.git Move definition int sval into branch of ifdef where it is used. Otherwise, you get a warning about an undefined variable. --- diff --git a/Modules/_multiprocessing/semaphore.c b/Modules/_multiprocessing/semaphore.c index a7ffd1ea7a62..a5ba71e30ca8 100644 --- a/Modules/_multiprocessing/semaphore.c +++ b/Modules/_multiprocessing/semaphore.c @@ -512,7 +512,6 @@ semlock_getvalue(SemLockObject *self) static PyObject * semlock_iszero(SemLockObject *self) { - int sval; #if HAVE_BROKEN_SEM_GETVALUE if (sem_trywait(self->handle) < 0) { if (errno == EAGAIN) @@ -524,6 +523,7 @@ semlock_iszero(SemLockObject *self) Py_RETURN_FALSE; } #else + int sval; if (SEM_GETVALUE(self->handle, &sval) < 0) return mp_SetError(NULL, MP_STANDARD_ERROR); return PyBool_FromLong((long)sval == 0);