On 09/24/2015 10:01 AM, Pavel Hrdina wrote:
Follow the libvirt hacking guide and make the code consistent.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
libvirt-lxc-override.c | 3 +-
libvirt-override.c | 305 +++++++++++++++++++++++++++++++++---------------
libvirt-qemu-override.c | 6 +-
libvirt-utils.c | 25 ++--
typewrappers.c | 3 +-
5 files changed, 232 insertions(+), 110 deletions(-)
[...]
static void
-libvirt_virEventUpdateTimeoutFunc(int timer, int timeout)
+libvirt_virEventUpdateTimeoutFunc(int timer,
+ int timeout)
{
PyObject *result = NULL;
PyObject *pyobj_args;
@@ -5332,7 +5425,7 @@ libvirt_virEventRemoveTimeoutFunc(int timer)
}
static PyObject *
-libvirt_virEventRegisterImpl(ATTRIBUTE_UNUSED PyObject * self,
+libvirt_virEventRegisterImpl(PyObject * self ATTRIBUTE_UNUSED,
PyObject * args)
There's an extra space between * and self and args... May as well be
consistent while you're at it.
{
/* Unref the previously-registered impl (if any) */
@@ -6596,7 +6689,7 @@ libvirt_virConnectDomainEventDeviceAddedCallback(virConnectPtr conn
ATTRIBUTE_UN
#endif /* VIR_DOMAIN_EVENT_ID_DEVICE_ADDED */
static PyObject *
-libvirt_virConnectDomainEventRegisterAny(ATTRIBUTE_UNUSED PyObject *self,
+libvirt_virConnectDomainEventRegisterAny(PyObject *self ATTRIBUTE_UNUSED,
PyObject *args)
{
PyObject *py_retval; /* return value */
@@ -6722,7 +6815,7 @@ libvirt_virConnectDomainEventRegisterAny(ATTRIBUTE_UNUSED PyObject
*self,
}
static PyObject *
-libvirt_virConnectDomainEventDeregisterAny(ATTRIBUTE_UNUSED PyObject *self,
+libvirt_virConnectDomainEventDeregisterAny(PyObject *self ATTRIBUTE_UNUSED,
PyObject *args)
{
PyObject *py_retval;
@@ -6871,9 +6964,9 @@ libvirt_virConnectNetworkEventRegisterAny(PyObject *self
ATTRIBUTE_UNUSED,
return py_retval;
}
-static PyObject
-*libvirt_virConnectNetworkEventDeregisterAny(PyObject *self ATTRIBUTE_UNUSED,
- PyObject *args)
+static PyObject *
+libvirt_virConnectNetworkEventDeregisterAny(PyObject *self ATTRIBUTE_UNUSED,
+ PyObject *args)
{
PyObject *py_retval;
PyObject *pyobj_conn;
@@ -6939,7 +7032,7 @@ libvirt_virConnectCloseCallbackDispatch(virConnectPtr conn
ATTRIBUTE_UNUSED,
}
static PyObject *
-libvirt_virConnectRegisterCloseCallback(ATTRIBUTE_UNUSED PyObject * self,
+libvirt_virConnectRegisterCloseCallback(PyObject * self ATTRIBUTE_UNUSED,
PyObject * args)
Ditto about spaces
{
PyObject *py_retval; /* return value */
@@ -6977,7 +7070,7 @@ libvirt_virConnectRegisterCloseCallback(ATTRIBUTE_UNUSED PyObject *
self,
}
static PyObject *
-libvirt_virConnectUnregisterCloseCallback(ATTRIBUTE_UNUSED PyObject * self,
+libvirt_virConnectUnregisterCloseCallback(PyObject * self ATTRIBUTE_UNUSED,
PyObject * args)
again
{
PyObject *py_retval;
@@ -7232,7 +7325,9 @@ libvirt_virDomainMigrateGetCompressionCache(PyObject *self
ATTRIBUTE_UNUSED,
#endif /* LIBVIR_CHECK_VERSION(1, 0, 3) */
[...]
--- a/typewrappers.c
+++ b/typewrappers.c
@@ -386,7 +386,8 @@ libvirt_charPtrUnwrap(PyObject *obj, char **str)
return ret && *str ? 0 : -1;
}
-int libvirt_charPtrSizeUnwrap(PyObject *obj, char **str, Py_ssize_t *size)
+int
+libvirt_charPtrSizeUnwrap(PyObject *obj, char **str, Py_ssize_t *size)
You didn't follow the model of one line per arg
John
{
int ret;
#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION <= 4