diff test/common.c @ 3186:51750b7a966f

indent
author Sam Lantinga <slouken@libsdl.org>
date Wed, 10 Jun 2009 13:34:20 +0000
parents 68d3b48a6002
children c18c03927a77
line wrap: on
line diff
--- a/test/common.c	Wed Jun 10 08:09:04 2009 +0000
+++ b/test/common.c	Wed Jun 10 13:34:20 2009 +0000
@@ -11,56 +11,59 @@
 #define AUDIO_USAGE \
 "[--rate N] [--format U8|S8|U16|U16LE|U16BE|S16|S16LE|S16BE] [--channels N] [--samples N]"
 
-struct pformat {
+struct pformat
+{
     Uint32 id;
-    const char* idstr;
-} pixel_format[]={
-    {SDL_PIXELFORMAT_INDEX1LSB, "SDL_PIXELFORMAT_INDEX1LSB"},
-    {SDL_PIXELFORMAT_INDEX1MSB, "SDL_PIXELFORMAT_INDEX1MSB"},
-    {SDL_PIXELFORMAT_INDEX4LSB, "SDL_PIXELFORMAT_INDEX4LSB"},
-    {SDL_PIXELFORMAT_INDEX4MSB, "SDL_PIXELFORMAT_INDEX4MSB"},
-    {SDL_PIXELFORMAT_INDEX8, "SDL_PIXELFORMAT_INDEX8"},
-    {SDL_PIXELFORMAT_RGB332, "SDL_PIXELFORMAT_RGB332"},
-    {SDL_PIXELFORMAT_RGB444, "SDL_PIXELFORMAT_RGB444"},
-    {SDL_PIXELFORMAT_RGB555, "SDL_PIXELFORMAT_RGB555"},
-    {SDL_PIXELFORMAT_BGR555, "SDL_PIXELFORMAT_BGR555"},
-    {SDL_PIXELFORMAT_ARGB4444, "SDL_PIXELFORMAT_ARGB4444"},
-    {SDL_PIXELFORMAT_ABGR4444, "SDL_PIXELFORMAT_ABGR4444"},
-    {SDL_PIXELFORMAT_ARGB1555, "SDL_PIXELFORMAT_ARGB1555"},
-    {SDL_PIXELFORMAT_ABGR1555, "SDL_PIXELFORMAT_ABGR1555"},
-    {SDL_PIXELFORMAT_RGB565, "SDL_PIXELFORMAT_RGB565"},
-    {SDL_PIXELFORMAT_BGR565, "SDL_PIXELFORMAT_BGR565"},
-    {SDL_PIXELFORMAT_RGB24, "SDL_PIXELFORMAT_RGB24"},
-    {SDL_PIXELFORMAT_BGR24, "SDL_PIXELFORMAT_BGR24"},
-    {SDL_PIXELFORMAT_RGB888, "SDL_PIXELFORMAT_RGB888"},
-    {SDL_PIXELFORMAT_BGR888, "SDL_PIXELFORMAT_BGR888"},
-    {SDL_PIXELFORMAT_ARGB8888, "SDL_PIXELFORMAT_ARGB8888"},
-    {SDL_PIXELFORMAT_RGBA8888, "SDL_PIXELFORMAT_RGBA8888"},
-    {SDL_PIXELFORMAT_ABGR8888, "SDL_PIXELFORMAT_ABGR8888"},
-    {SDL_PIXELFORMAT_BGRA8888, "SDL_PIXELFORMAT_BGRA8888"},
-    {SDL_PIXELFORMAT_ARGB2101010, "SDL_PIXELFORMAT_ARGB2101010"},
-    {SDL_PIXELFORMAT_YV12, "SDL_PIXELFORMAT_YV12"},
-    {SDL_PIXELFORMAT_IYUV, "SDL_PIXELFORMAT_IYUV"},
-    {SDL_PIXELFORMAT_YUY2, "SDL_PIXELFORMAT_YUY2"},
-    {SDL_PIXELFORMAT_UYVY, "SDL_PIXELFORMAT_UYVY"},
-    {SDL_PIXELFORMAT_YVYU, "SDL_PIXELFORMAT_YVYU"}
+    const char *idstr;
+} pixel_format[] = {
+    {
+    SDL_PIXELFORMAT_INDEX1LSB, "SDL_PIXELFORMAT_INDEX1LSB"}, {
+    SDL_PIXELFORMAT_INDEX1MSB, "SDL_PIXELFORMAT_INDEX1MSB"}, {
+    SDL_PIXELFORMAT_INDEX4LSB, "SDL_PIXELFORMAT_INDEX4LSB"}, {
+    SDL_PIXELFORMAT_INDEX4MSB, "SDL_PIXELFORMAT_INDEX4MSB"}, {
+    SDL_PIXELFORMAT_INDEX8, "SDL_PIXELFORMAT_INDEX8"}, {
+    SDL_PIXELFORMAT_RGB332, "SDL_PIXELFORMAT_RGB332"}, {
+    SDL_PIXELFORMAT_RGB444, "SDL_PIXELFORMAT_RGB444"}, {
+    SDL_PIXELFORMAT_RGB555, "SDL_PIXELFORMAT_RGB555"}, {
+    SDL_PIXELFORMAT_BGR555, "SDL_PIXELFORMAT_BGR555"}, {
+    SDL_PIXELFORMAT_ARGB4444, "SDL_PIXELFORMAT_ARGB4444"}, {
+    SDL_PIXELFORMAT_ABGR4444, "SDL_PIXELFORMAT_ABGR4444"}, {
+    SDL_PIXELFORMAT_ARGB1555, "SDL_PIXELFORMAT_ARGB1555"}, {
+    SDL_PIXELFORMAT_ABGR1555, "SDL_PIXELFORMAT_ABGR1555"}, {
+    SDL_PIXELFORMAT_RGB565, "SDL_PIXELFORMAT_RGB565"}, {
+    SDL_PIXELFORMAT_BGR565, "SDL_PIXELFORMAT_BGR565"}, {
+    SDL_PIXELFORMAT_RGB24, "SDL_PIXELFORMAT_RGB24"}, {
+    SDL_PIXELFORMAT_BGR24, "SDL_PIXELFORMAT_BGR24"}, {
+    SDL_PIXELFORMAT_RGB888, "SDL_PIXELFORMAT_RGB888"}, {
+    SDL_PIXELFORMAT_BGR888, "SDL_PIXELFORMAT_BGR888"}, {
+    SDL_PIXELFORMAT_ARGB8888, "SDL_PIXELFORMAT_ARGB8888"}, {
+    SDL_PIXELFORMAT_RGBA8888, "SDL_PIXELFORMAT_RGBA8888"}, {
+    SDL_PIXELFORMAT_ABGR8888, "SDL_PIXELFORMAT_ABGR8888"}, {
+    SDL_PIXELFORMAT_BGRA8888, "SDL_PIXELFORMAT_BGRA8888"}, {
+    SDL_PIXELFORMAT_ARGB2101010, "SDL_PIXELFORMAT_ARGB2101010"}, {
+    SDL_PIXELFORMAT_YV12, "SDL_PIXELFORMAT_YV12"}, {
+    SDL_PIXELFORMAT_IYUV, "SDL_PIXELFORMAT_IYUV"}, {
+    SDL_PIXELFORMAT_YUY2, "SDL_PIXELFORMAT_YUY2"}, {
+    SDL_PIXELFORMAT_UYVY, "SDL_PIXELFORMAT_UYVY"}, {
+    SDL_PIXELFORMAT_YVYU, "SDL_PIXELFORMAT_YVYU"}
 };
 
-const char* PixelFormatToString(Uint32 pformat)
+const char *
+PixelFormatToString(Uint32 pformat)
 {
-   Uint32 it=0;
+    Uint32 it = 0;
 
-   do {
-      if (pixel_format[it].idstr == NULL) {
-          break;
-      }
-      if (pixel_format[it].id == pformat) {
-          return pixel_format[it].idstr;
-      }
-      it++;
-   } while(1);
+    do {
+        if (pixel_format[it].idstr == NULL) {
+            break;
+        }
+        if (pixel_format[it].id == pformat) {
+            return pixel_format[it].idstr;
+        }
+        it++;
+    } while (1);
 
-   return "SDL_PIXELFORMAT_UNKNOWN";
+    return "SDL_PIXELFORMAT_UNKNOWN";
 }
 
 CommonState *
@@ -706,7 +709,7 @@
         fullscreen_mode.w = state->window_w;
         fullscreen_mode.h = state->window_h;
         fullscreen_mode.refresh_rate = state->refresh_rate;
-        if (SDL_SetFullscreenDisplayMode(&fullscreen_mode)<0) {
+        if (SDL_SetFullscreenDisplayMode(&fullscreen_mode) < 0) {
             fprintf(stderr, "Can't switch to fullscreen display mode: %s\n",
                     SDL_GetError());
             return SDL_FALSE;