test/testpower.c
changeset 3186 51750b7a966f
parent 3170 b7a48f533966
child 5535 96594ac5fd1a
     1.1 --- a/test/testpower.c	Wed Jun 10 08:09:04 2009 +0000
     1.2 +++ b/test/testpower.c	Wed Jun 10 13:34:20 2009 +0000
     1.3 @@ -3,33 +3,33 @@
     1.4  #include <stdio.h>
     1.5  #include "SDL.h"
     1.6  
     1.7 -static void report_power(void)
     1.8 +static void
     1.9 +report_power(void)
    1.10  {
    1.11      int seconds, percent;
    1.12      const SDL_PowerState state = SDL_GetPowerInfo(&seconds, &percent);
    1.13      char *statestr = NULL;
    1.14  
    1.15      printf("SDL-reported power info...\n");
    1.16 -    switch(state)
    1.17 -    {
    1.18 -        case SDL_POWERSTATE_UNKNOWN:
    1.19 -            statestr = "Unknown";
    1.20 -            break;
    1.21 -        case SDL_POWERSTATE_ON_BATTERY:
    1.22 -            statestr = "On battery";
    1.23 -            break;
    1.24 -        case SDL_POWERSTATE_NO_BATTERY:
    1.25 -            statestr = "No battery";
    1.26 -            break;
    1.27 -        case SDL_POWERSTATE_CHARGING:
    1.28 -            statestr = "Charging";
    1.29 -            break;
    1.30 -        case SDL_POWERSTATE_CHARGED:
    1.31 -            statestr = "Charged";
    1.32 -            break;
    1.33 -        default:
    1.34 -            statestr = "!!API ERROR!!";
    1.35 -            break;
    1.36 +    switch (state) {
    1.37 +    case SDL_POWERSTATE_UNKNOWN:
    1.38 +        statestr = "Unknown";
    1.39 +        break;
    1.40 +    case SDL_POWERSTATE_ON_BATTERY:
    1.41 +        statestr = "On battery";
    1.42 +        break;
    1.43 +    case SDL_POWERSTATE_NO_BATTERY:
    1.44 +        statestr = "No battery";
    1.45 +        break;
    1.46 +    case SDL_POWERSTATE_CHARGING:
    1.47 +        statestr = "Charging";
    1.48 +        break;
    1.49 +    case SDL_POWERSTATE_CHARGED:
    1.50 +        statestr = "Charged";
    1.51 +        break;
    1.52 +    default:
    1.53 +        statestr = "!!API ERROR!!";
    1.54 +        break;
    1.55      }
    1.56  
    1.57      printf("State: %s\n", statestr);
    1.58 @@ -43,12 +43,14 @@
    1.59      if (seconds == -1) {
    1.60          printf("Time left: unknown\n");
    1.61      } else {
    1.62 -        printf("Time left: %d minutes, %d seconds\n", (int) (seconds / 60), (int) (seconds % 60));
    1.63 +        printf("Time left: %d minutes, %d seconds\n", (int) (seconds / 60),
    1.64 +               (int) (seconds % 60));
    1.65      }
    1.66  }
    1.67  
    1.68  
    1.69 -int main(int argc, char *argv[])
    1.70 +int
    1.71 +main(int argc, char *argv[])
    1.72  {
    1.73      if (SDL_Init(SDL_INIT_VIDEO) == -1) {
    1.74          fprintf(stderr, "SDL_Init() failed: %s\n", SDL_GetError());
    1.75 @@ -62,4 +64,3 @@
    1.76  }
    1.77  
    1.78  /* end of testpower.c ... */
    1.79 -