src/video/ataricommon/SDL_ataridevmouse.c
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
     1.1 --- a/src/video/ataricommon/SDL_ataridevmouse.c	Mon May 29 03:53:21 2006 +0000
     1.2 +++ b/src/video/ataricommon/SDL_ataridevmouse.c	Mon May 29 04:04:35 2006 +0000
     1.3 @@ -45,7 +45,7 @@
     1.4  /* Functions */
     1.5  
     1.6  int
     1.7 -SDL_AtariDevMouse_Open (void)
     1.8 +SDL_AtariDevMouse_Open(void)
     1.9  {
    1.10      int r;
    1.11      const char *mousedev;
    1.12 @@ -57,14 +57,14 @@
    1.13      return 0;
    1.14  
    1.15      /* First, try SDL_MOUSEDEV device */
    1.16 -    mousedev = SDL_getenv ("SDL_MOUSEDEV");
    1.17 +    mousedev = SDL_getenv("SDL_MOUSEDEV");
    1.18      if (!mousedev) {
    1.19 -        handle = open (mousedev, 0);
    1.20 +        handle = open(mousedev, 0);
    1.21      }
    1.22  
    1.23      /* Failed, try default device */
    1.24      if (handle < 0) {
    1.25 -        handle = open (DEVICE_NAME, 0);
    1.26 +        handle = open(DEVICE_NAME, 0);
    1.27      }
    1.28  
    1.29      if (handle < 0) {
    1.30 @@ -73,18 +73,18 @@
    1.31      }
    1.32  
    1.33      /* Set non blocking mode */
    1.34 -    r = fcntl (handle, F_GETFL, 0);
    1.35 +    r = fcntl(handle, F_GETFL, 0);
    1.36      if (r < 0) {
    1.37 -        close (handle);
    1.38 +        close(handle);
    1.39          handle = -1;
    1.40          return 0;
    1.41      }
    1.42  
    1.43      r |= O_NDELAY;
    1.44  
    1.45 -    r = fcntl (handle, F_SETFL, r);
    1.46 +    r = fcntl(handle, F_SETFL, r);
    1.47      if (r < 0) {
    1.48 -        close (handle);
    1.49 +        close(handle);
    1.50          handle = -1;
    1.51          return 0;
    1.52      }
    1.53 @@ -94,16 +94,16 @@
    1.54  }
    1.55  
    1.56  void
    1.57 -SDL_AtariDevMouse_Close (void)
    1.58 +SDL_AtariDevMouse_Close(void)
    1.59  {
    1.60      if (handle > 0) {
    1.61 -        close (handle);
    1.62 +        close(handle);
    1.63          handle = -1;
    1.64      }
    1.65  }
    1.66  
    1.67  static int
    1.68 -atari_GetButton (int button)
    1.69 +atari_GetButton(int button)
    1.70  {
    1.71      switch (button) {
    1.72      case 0:
    1.73 @@ -118,7 +118,7 @@
    1.74  }
    1.75  
    1.76  void
    1.77 -SDL_AtariDevMouse_PostMouseEvents (_THIS, SDL_bool buttonEvents)
    1.78 +SDL_AtariDevMouse_PostMouseEvents(_THIS, SDL_bool buttonEvents)
    1.79  {
    1.80      unsigned char buffer[3];
    1.81      int mousex, mousey;
    1.82 @@ -128,7 +128,7 @@
    1.83      }
    1.84  
    1.85      mousex = mousey = 0;
    1.86 -    while (read (handle, buffer, sizeof (buffer)) == sizeof (buffer)) {
    1.87 +    while (read(handle, buffer, sizeof(buffer)) == sizeof(buffer)) {
    1.88          mouseb = buffer[0] & 7;
    1.89          mousex += (char) buffer[1];
    1.90          mousey += (char) buffer[2];
    1.91 @@ -144,12 +144,12 @@
    1.92                  prevbutton = prev_mouseb & (1 << i);
    1.93  
    1.94                  if (curbutton && !prevbutton) {
    1.95 -                    SDL_PrivateMouseButton (SDL_RELEASED,
    1.96 -                                            atari_GetButton (i), 0, 0);
    1.97 +                    SDL_PrivateMouseButton(SDL_RELEASED,
    1.98 +                                           atari_GetButton(i), 0, 0);
    1.99                  }
   1.100                  if (!curbutton && prevbutton) {
   1.101 -                    SDL_PrivateMouseButton (SDL_PRESSED,
   1.102 -                                            atari_GetButton (i), 0, 0);
   1.103 +                    SDL_PrivateMouseButton(SDL_PRESSED,
   1.104 +                                           atari_GetButton(i), 0, 0);
   1.105                  }
   1.106              }
   1.107  
   1.108 @@ -159,7 +159,7 @@
   1.109  
   1.110      /* Mouse motion event */
   1.111      if (mousex || mousey) {
   1.112 -        SDL_PrivateMouseMotion (0, 1, mousex, -mousey);
   1.113 +        SDL_PrivateMouseMotion(0, 1, mousex, -mousey);
   1.114      }
   1.115  }
   1.116