summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-12-14 17:17:07 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2010-12-14 17:17:07 +0100
commitb1f4a3256004e8f12c15511d2b77074a3002b9f2 (patch)
treed87ed73b341bafa0831668ed2a7fdb4431cdcb82 /src
parent8598b22e101201de4d06ea48f2b500f81f2b30d5 (diff)
downloadabrt-b1f4a3256004e8f12c15511d2b77074a3002b9f2.tar.gz
abrt-b1f4a3256004e8f12c15511d2b77074a3002b9f2.tar.xz
abrt-b1f4a3256004e8f12c15511d2b77074a3002b9f2.zip
jury-rig compile for python2.6; small style fixes
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/report-python/Makefile.am7
-rw-r--r--src/report-python/crash_dump.c35
-rw-r--r--src/report-python/py_crash_dump.h2
-rw-r--r--src/report-python/reportmodule.c2
4 files changed, 24 insertions, 22 deletions
diff --git a/src/report-python/Makefile.am b/src/report-python/Makefile.am
index 34ec090c..9c7e86d7 100644
--- a/src/report-python/Makefile.am
+++ b/src/report-python/Makefile.am
@@ -5,7 +5,9 @@ pyreportexec_PYTHON = __init__.py
pyreportexec_LTLIBRARIES = _pyreport.la
_pyreport_la_SOURCES = \
- reportmodule.c crash_dump.c py_crash_dump.h pyreport_common.h
+ reportmodule.c \
+ crash_dump.c py_crash_dump.h \
+ pyreport_common.h
_pyreport_la_CPPFLAGS = \
-I$(srcdir)/../include/report -I$(srcdir)/../include \
-DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \
@@ -16,7 +18,8 @@ _pyreport_la_CPPFLAGS = \
-DVAR_RUN=\"$(VAR_RUN)\" \
$(GLIB_CFLAGS) \
$(PYTHON_CFLAGS) \
- -D_GNU_SOURCE
+ -D_GNU_SOURCE \
+ -Wall -Werror
_pyreport_la_LDFLAGS = \
-module \
-avoid-version \
diff --git a/src/report-python/crash_dump.c b/src/report-python/crash_dump.c
index 078e96bd..4ca7cf22 100644
--- a/src/report-python/crash_dump.c
+++ b/src/report-python/crash_dump.c
@@ -1,6 +1,6 @@
/*
- Copyright (C) 2009 Abrt team.
- Copyright (C) 2009 RedHat inc.
+ Copyright (C) 2010 Abrt team.
+ Copyright (C) 2010 RedHat inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@
*/
#include <Python.h>
#include <structmember.h>
+
#include <errno.h>
#include "crash_dump.h"
#include "pyreport_common.h"
@@ -61,13 +62,12 @@ void add_to_crash_data_ext(crash_data_t *crash_data,
unsigned flags);
*/
-static PyObject * p_crash_data_add_ext(PyObject *pself, PyObject *args, PyObject *kwds)
+static PyObject *p_crash_data_add_ext(PyObject *pself, PyObject *args, PyObject *kwds)
{
- p_crash_data* self = (p_crash_data*)pself;
+ p_crash_data *self = (p_crash_data*)pself;
-
- const char * name;
- const char * content;
+ const char *name;
+ const char *content;
int FLAGS;
if(!PyArg_ParseTuple(args, "ssi", &name, &content, &FLAGS))
{
@@ -79,13 +79,12 @@ static PyObject * p_crash_data_add_ext(PyObject *pself, PyObject *args, PyObject
/* every function returns PyObject to return void we need to do this */
Py_RETURN_NONE;
}
-static PyObject * p_crash_data_add(PyObject *pself, PyObject *args, PyObject *kwds)
+static PyObject *p_crash_data_add(PyObject *pself, PyObject *args, PyObject *kwds)
{
- p_crash_data* self = (p_crash_data*)pself;
+ p_crash_data *self = (p_crash_data*)pself;
-
- const char * name;
- const char * content;
+ const char *name;
+ const char *content;
if(!PyArg_ParseTuple(args, "ss", &name, &content))
{
/* PyArg_ParseTuple raises the exception saying why it fails
@@ -106,9 +105,9 @@ static inline struct crash_item *get_crash_data_item_or_NULL(crash_data_t *crash
}
*/
-static PyObject * p_get_crash_data_item(PyObject *pself, PyObject *args, PyObject *kwds)
+static PyObject *p_get_crash_data_item(PyObject *pself, PyObject *args, PyObject *kwds)
{
- p_crash_data* self = (p_crash_data*)pself;
+ p_crash_data *self = (p_crash_data*)pself;
const char *key;
if(!PyArg_ParseTuple(args, "s", &key))
@@ -120,9 +119,9 @@ static PyObject * p_get_crash_data_item(PyObject *pself, PyObject *args, PyObjec
}
-static PyObject * p_create_crash_dump_dir(PyObject *pself, PyObject *args)
+static PyObject *p_create_crash_dump_dir(PyObject *pself, PyObject *args)
{
- p_crash_data* self = (p_crash_data*)pself;
+ p_crash_data *self = (p_crash_data*)pself;
struct dump_dir *dd = create_crash_dump_dir(self->cd);
if(dd == NULL)
{
@@ -156,7 +155,7 @@ static PyMethodDef p_crash_data_methods[] = {
PyTypeObject p_crash_data_type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "report.p_crash_data", /*tp_name*/
+ "report.crash_data", /*tp_name*/
sizeof(p_crash_data), /*tp_basicsize*/
0, /*tp_itemsize*/
p_crash_data_dealloc, /*tp_dealloc*/
@@ -175,7 +174,7 @@ PyTypeObject p_crash_data_type = {
0, /*tp_setattro*/
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
- "p_crash_data objects", /* tp_doc */
+ "crash_data objects", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
diff --git a/src/report-python/py_crash_dump.h b/src/report-python/py_crash_dump.h
index a188e522..93ce5f84 100644
--- a/src/report-python/py_crash_dump.h
+++ b/src/report-python/py_crash_dump.h
@@ -27,4 +27,4 @@ PyObject *p_crash_data_add(PyObject *pself, PyObject *args, PyObject *kwds);
/* crash_data object */
extern PyTypeObject p_crash_data_type;
/* crash_data methods */
-extern PyMethodDef module_methods[]; \ No newline at end of file
+extern PyMethodDef module_methods[];
diff --git a/src/report-python/reportmodule.c b/src/report-python/reportmodule.c
index b73f88f5..7955ab83 100644
--- a/src/report-python/reportmodule.c
+++ b/src/report-python/reportmodule.c
@@ -20,7 +20,7 @@ init_pyreport(void)
m = Py_InitModule3("_pyreport", module_methods, "Python wrapper around crash_data_t");
if (m == NULL)
{
- printf("m == NULL");
+ printf("m == NULL\n");
return;
}