Re: [libvirt] [PATCH 04/18] event-test: touch up coding style

2016-04-18 Thread Ján Tomko
On Thu, Apr 14, 2016 at 05:52:29PM +0200, Peter Krempa wrote:
> Break long lines and format headers correctly.
> ---
>  examples/object-events/event-test.c | 227 
> ++--
>  1 file changed, 137 insertions(+), 90 deletions(-)
> 

ACK

Jan

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 04/18] event-test: touch up coding style

2016-04-14 Thread Peter Krempa
Break long lines and format headers correctly.
---
 examples/object-events/event-test.c | 227 ++--
 1 file changed, 137 insertions(+), 90 deletions(-)

diff --git a/examples/object-events/event-test.c 
b/examples/object-events/event-test.c
index 63629c2..3ab2b64 100644
--- a/examples/object-events/event-test.c
+++ b/examples/object-events/event-test.c
@@ -18,11 +18,10 @@
 int run = 1;

 /* Callback functions */
-
-
-static void connectClose(virConnectPtr conn ATTRIBUTE_UNUSED,
- int reason,
- void *opaque ATTRIBUTE_UNUSED)
+static void
+connectClose(virConnectPtr conn ATTRIBUTE_UNUSED,
+ int reason,
+ void *opaque ATTRIBUTE_UNUSED)
 {
 switch (reason) {
 case VIR_CONNECT_CLOSE_REASON_ERROR:
@@ -44,7 +43,10 @@ static void connectClose(virConnectPtr conn ATTRIBUTE_UNUSED,
 run = 0;
 }

-const char *eventToString(int event) {
+
+static const char *
+eventToString(int event)
+{
 const char *ret = "";
 switch ((virDomainEventType) event) {
 case VIR_DOMAIN_EVENT_DEFINED:
@@ -78,7 +80,11 @@ const char *eventToString(int event) {
 return ret;
 }

-static const char *eventDetailToString(int event, int detail) {
+
+static const char *
+eventDetailToString(int event,
+int detail)
+{
 const char *ret = "";
 switch ((virDomainEventType) event) {
 case VIR_DOMAIN_EVENT_DEFINED:
@@ -216,6 +222,7 @@ static const char *eventDetailToString(int event, int 
detail) {
 return ret;
 }

+
 static const char *
 networkEventToString(int event)
 {
@@ -237,6 +244,7 @@ networkEventToString(int event)
 return ret;
 }

+
 static const char *
 guestAgentLifecycleEventStateToString(int event)
 {
@@ -255,6 +263,7 @@ guestAgentLifecycleEventStateToString(int event)
 return ret;
 }

+
 static const char *
 guestAgentLifecycleEventReasonToString(int event)
 {
@@ -278,11 +287,12 @@ guestAgentLifecycleEventReasonToString(int event)
 }


-static int myDomainEventCallback1(virConnectPtr conn ATTRIBUTE_UNUSED,
-  virDomainPtr dom,
-  int event,
-  int detail,
-  void *opaque ATTRIBUTE_UNUSED)
+static int
+myDomainEventCallback1(virConnectPtr conn ATTRIBUTE_UNUSED,
+   virDomainPtr dom,
+   int event,
+   int detail,
+   void *opaque ATTRIBUTE_UNUSED)
 {
 printf("%s EVENT: Domain %s(%d) %s %s\n", __func__, virDomainGetName(dom),
virDomainGetID(dom), eventToString(event),
@@ -290,11 +300,13 @@ static int myDomainEventCallback1(virConnectPtr conn 
ATTRIBUTE_UNUSED,
 return 0;
 }

-static int myDomainEventCallback2(virConnectPtr conn ATTRIBUTE_UNUSED,
-  virDomainPtr dom,
-  int event,
-  int detail,
-  void *opaque ATTRIBUTE_UNUSED)
+
+static int
+myDomainEventCallback2(virConnectPtr conn ATTRIBUTE_UNUSED,
+   virDomainPtr dom,
+   int event,
+   int detail,
+   void *opaque ATTRIBUTE_UNUSED)
 {
 printf("%s EVENT: Domain %s(%d) %s %s\n", __func__, virDomainGetName(dom),
virDomainGetID(dom), eventToString(event),
@@ -302,9 +314,11 @@ static int myDomainEventCallback2(virConnectPtr conn 
ATTRIBUTE_UNUSED,
 return 0;
 }

-static int myDomainEventRebootCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
-   virDomainPtr dom,
-   void *opaque ATTRIBUTE_UNUSED)
+
+static int
+myDomainEventRebootCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
+virDomainPtr dom,
+void *opaque ATTRIBUTE_UNUSED)
 {
 printf("%s EVENT: Domain %s(%d) rebooted\n", __func__, 
virDomainGetName(dom),
virDomainGetID(dom));
@@ -312,10 +326,12 @@ static int myDomainEventRebootCallback(virConnectPtr conn 
ATTRIBUTE_UNUSED,
 return 0;
 }

-static int myDomainEventRTCChangeCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
-  virDomainPtr dom,
-  long long offset,
-  void *opaque ATTRIBUTE_UNUSED)
+
+static int
+myDomainEventRTCChangeCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
+   virDomainPtr dom,
+   long long offset,
+   void *opaque ATTRIBUTE_UNUSED)
 {
 printf("%s EVENT: Domain %s(%d) rtc change %" PRIdMAX "\n",
__func__, virDomainGetName(dom), virDomainGetID(dom),
@@ -324,10 +340,12 @@ static int myDomainEventRTCChangeCallback(virConnectPtr 
conn ATTRIBUTE_UNUSED,
 return 0;
 }

-static int myDomainE