Module: sip-router
Branch: master
Commit: 6a45c8eba310afa9b8173c0522d77e7a574ddc52
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6a45c8e…
Author: Konstantin M <evilzluk(a)gmail.com>
Committer: Ovidiu Sas <osas(a)voipembedded.com>
Date: Sun Dec 2 22:21:05 2012 -0500
app_python: fix compiler warnings
- patch provided by "Konstantin M <evilzluk(a)gmail.com>"
---
modules/app_python/python_iface.c | 4 ++--
modules/app_python/python_mod.c | 6 +++---
modules/app_python/python_msgobj.c | 9 +++------
modules/app_python/python_support.c | 6 +++---
4 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/modules/app_python/python_iface.c b/modules/app_python/python_iface.c
index ecf692c..7e571d8 100644
--- a/modules/app_python/python_iface.c
+++ b/modules/app_python/python_iface.c
@@ -20,13 +20,13 @@
*
*/
+#include <Python.h>
+
#include "../../action.h"
#include "../../dprint.h"
#include "../../route_struct.h"
#include "python_exec.h"
-#include <Python.h>
-
/* Return the number of arguments of the application command line */
static PyObject*
router_LM_ERR(PyObject *self, PyObject *args)
diff --git a/modules/app_python/python_mod.c b/modules/app_python/python_mod.c
index c178551..185bf99 100644
--- a/modules/app_python/python_mod.c
+++ b/modules/app_python/python_mod.c
@@ -20,6 +20,9 @@
*
*/
+#include <Python.h>
+#include <libgen.h>
+
#include "../../str.h"
#include "../../sr_module.h"
@@ -28,9 +31,6 @@
#include "python_msgobj.h"
#include "python_support.h"
-#include <Python.h>
-#include <libgen.h>
-
MODULE_VERSION
static int mod_init(void);
diff --git a/modules/app_python/python_msgobj.c b/modules/app_python/python_msgobj.c
index 3e4a2cd..3426b41 100644
--- a/modules/app_python/python_msgobj.c
+++ b/modules/app_python/python_msgobj.c
@@ -20,19 +20,16 @@
*
*/
+#include <Python.h>
+
#include "../../action.h"
#include "../../mem/mem.h"
#include "../../sr_module.h"
#include "../../dset.h"
#include "../../parser/msg_parser.h"
-#include <Python.h>
#include "structmember.h"
-#ifndef Py_TYPE
-#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
-#endif
-
typedef struct {
PyObject_HEAD
struct sip_msg *msg;
@@ -526,7 +523,7 @@ static PyTypeObject MSGtype = {
int
python_msgobj_init(void)
{
- Py_TYPE((void*)(&MSGtype)) = &PyType_Type;
+ MSGtype.ob_type = &PyType_Type;
if (PyType_Ready(&MSGtype) < 0)
return -1;
return 0;
diff --git a/modules/app_python/python_support.c b/modules/app_python/python_support.c
index 9c3cc2e..e0ac4eb 100644
--- a/modules/app_python/python_support.c
+++ b/modules/app_python/python_support.c
@@ -20,12 +20,12 @@
*
*/
+#include <Python.h>
+#include <stdio.h>
+
#include "../../dprint.h"
#include "python_mod.h"
-#include <stdio.h>
-#include <Python.h>
-
void
python_handle_exception(const char *fname)
{