From 5f2e4c818c41000a85546b4a4882c5ca43709dba Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Mon, 8 Sep 2008 12:00:27 +0000
Subject: [PATCH] [Alex V. Myltsev] idle.c: cleanup.

Replace METH_VARARGS with METH_NOARGS, discard win32 ifdefs (it's no more compiled on win32 anyway).
---
 src/common/idle.c | 30 ++++++++++--------------------
 1 file changed, 10 insertions(+), 20 deletions(-)

diff --git a/src/common/idle.c b/src/common/idle.c
index 1e5b9c39c5..124a07c502 100644
--- a/src/common/idle.c
+++ b/src/common/idle.c
@@ -23,36 +23,27 @@
  * along with Gajim.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef _WIN32
-	#include <X11/Xlib.h>
-	#include <X11/Xutil.h>
-	#include <X11/extensions/scrnsaver.h>
-#endif
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/extensions/scrnsaver.h>
 
 #include <Python.h>
 
-#ifndef _WIN32
-	Display *display;
-#endif
-
+Display *display;
 
 static PyObject * idle_init(PyObject *self, PyObject *args)
 {
-#ifndef _WIN32
 	display = XOpenDisplay(NULL);
-#endif
+
 	Py_INCREF(Py_None);
 	return Py_None;
 }
 
 static PyObject * idle_getIdleSec(PyObject *self, PyObject *args)
 {
-#ifndef _WIN32
 	static XScreenSaverInfo *mit_info = NULL;
 	int idle_time, event_base, error_base;
-#endif
 
-#ifndef _WIN32
 	if (XScreenSaverQueryExtension(display, &event_base, &error_base))
 	{
 		if (mit_info == NULL)
@@ -62,24 +53,23 @@ static PyObject * idle_getIdleSec(PyObject *self, PyObject *args)
 	}
 	else
 		idle_time = 0;
-#endif
+
 	return Py_BuildValue("i", idle_time);
 }
 
 static PyObject * idle_close(PyObject *self, PyObject *args)
 {
-#ifndef _WIN32
 	XCloseDisplay(display);
-#endif
+
 	Py_INCREF(Py_None);
 	return Py_None;
 }
 
 static PyMethodDef idleMethods[] =
 {
-	{"init",  idle_init, METH_VARARGS, "init idle"},
-	{"getIdleSec",  idle_getIdleSec, METH_VARARGS, "Give the idle time in secondes"},
-	{"close",  idle_close, METH_VARARGS, "close idle"},
+	{"init",  idle_init, METH_NOARGS, "init idle"},
+	{"getIdleSec",  idle_getIdleSec, METH_NOARGS, "Give the idle time in secondes"},
+	{"close",  idle_close, METH_NOARGS, "close idle"},
 	{NULL, NULL, 0, NULL}
 };
 
-- 
GitLab