style cleanup
[blender.git] / intern / ghost / test / multitest / EventToBuf.c
index 859600b..0eb37a5 100644 (file)
@@ -1,5 +1,4 @@
 /**
- * $Id$
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
@@ -35,8 +34,9 @@
 #include "GHOST_C-api.h"
 #include "EventToBuf.h"
 
-char *eventtype_to_string(GHOST_TEventType type) {
-       switch(type) {
+char *eventtype_to_string(GHOST_TEventType type)
+{
+       switch (type) {
        case GHOST_kEventCursorMove:            return "CursorMove";
        case GHOST_kEventButtonDown:            return "ButtonDown";
        case GHOST_kEventButtonUp:                      return "ButtonUp";
@@ -56,7 +56,8 @@ char *eventtype_to_string(GHOST_TEventType type) {
        }
 }
 
-static char *keytype_to_string(GHOST_TKey key) {
+static char *keytype_to_string(GHOST_TKey key)
+{
 #define K(key) case GHOST_k##key:      return #key;
        switch (key) {
        K(KeyBackSpace);
@@ -194,40 +195,44 @@ static char *keytype_to_string(GHOST_TKey key) {
 #undef K
 }
 
-void event_to_buf(GHOST_EventHandle evt, char buf[128]) {
+void event_to_buf(GHOST_EventHandle evt, char buf[128])
+{
        GHOST_TEventType type= GHOST_GetEventType(evt);
        double time= (double) ((GHOST_TInt64) GHOST_GetEventTime(evt))/1000;
        GHOST_WindowHandle win= GHOST_GetEventWindow(evt);
        void *data= GHOST_GetEventData(evt);
        char *pos= buf;
 
-       pos+= sprintf(pos, "event: %6.2f, %16s", time, eventtype_to_string(type));
+       pos += sprintf(pos, "event: %6.2f, %16s", time, eventtype_to_string(type));
        if (win) {
                char *s= GHOST_GetTitle(win);
-               pos+= sprintf(pos, " - win: %s", s);
+               pos += sprintf(pos, " - win: %s", s);
                free(s);
        } else {
                pos+= sprintf(pos, " - sys evt");
        }
        switch (type) {
-       case GHOST_kEventCursorMove: {
-               GHOST_TEventCursorData *cd= data;
-               pos+= sprintf(pos, " - pos: (%d, %d)", cd->x, cd->y);
-               break;
-       }
-       case GHOST_kEventButtonDown:
-       case GHOST_kEventButtonUp: {
-               GHOST_TEventButtonData *bd= data;
-               pos+= sprintf(pos, " - but: %d", bd->button);
-               break;
-       }
-       
-       case GHOST_kEventKeyDown:
-       case GHOST_kEventKeyUp: {
-               GHOST_TEventKeyData *kd= data;
-               pos+= sprintf(pos, " - key: %s (%d)", keytype_to_string(kd->key), kd->key);
-               if (kd->ascii) pos+= sprintf(pos, " ascii: '%c' (%d)", kd->ascii, kd->ascii);
-               break;
-       }
+               case GHOST_kEventCursorMove:
+               {
+                       GHOST_TEventCursorData *cd= data;
+                       pos += sprintf(pos, " - pos: (%d, %d)", cd->x, cd->y);
+                       break;
+               }
+               case GHOST_kEventButtonDown:
+               case GHOST_kEventButtonUp:
+               {
+                       GHOST_TEventButtonData *bd= data;
+                       pos += sprintf(pos, " - but: %d", bd->button);
+                       break;
+               }
+
+               case GHOST_kEventKeyDown:
+               case GHOST_kEventKeyUp:
+               {
+                       GHOST_TEventKeyData *kd= data;
+                       pos += sprintf(pos, " - key: %s (%d)", keytype_to_string(kd->key), kd->key);
+                       if (kd->ascii) pos+= sprintf(pos, " ascii: '%c' (%d)", kd->ascii, kd->ascii);
+                       break;
+               }
        }
 }