fix indentation and spaces
authorEdward Rudd <urkle@outoforder.cc>
Thu, 06 Feb 2014 09:11:05 -0500
changeset 818292f71edde3be
parent 8181 3632013330ad
child 8183 f8404b0e00ac
fix indentation and spaces
src/haptic/darwin/SDL_syshaptic.c
src/haptic/dummy/SDL_syshaptic.c
src/haptic/linux/SDL_syshaptic.c
     1.1 --- a/src/haptic/darwin/SDL_syshaptic.c	Thu Feb 06 07:38:41 2014 -0500
     1.2 +++ b/src/haptic/darwin/SDL_syshaptic.c	Thu Feb 06 09:11:05 2014 -0500
     1.3 @@ -192,17 +192,17 @@
     1.4  HapticByDevIndex(int device_index)
     1.5  {
     1.6      SDL_hapticlist_item *item = SDL_hapticlist;
     1.7 -    
     1.8 +
     1.9      if ((device_index < 0) || (device_index >= numhaptics)) {
    1.10          return NULL;
    1.11      }
    1.12 -    
    1.13 +
    1.14      while (device_index > 0) {
    1.15          SDL_assert(item != NULL);
    1.16          device_index--;
    1.17          item = item->next;
    1.18      }
    1.19 -    
    1.20 +
    1.21      return item;
    1.22  }
    1.23  
    1.24 @@ -232,7 +232,7 @@
    1.25      if (item == NULL) {
    1.26          return SDL_SetError("Could not allocate haptic storage");
    1.27      }
    1.28 -    
    1.29 +
    1.30      /* retain it as we are going to keep it around a while */
    1.31      IOObjectRetain(device);
    1.32  
    1.33 @@ -240,7 +240,7 @@
    1.34      HIDGetDeviceProduct(device, item->name);
    1.35      item->dev = device;
    1.36      item->haptic = NULL;
    1.37 -    
    1.38 +
    1.39      /* Set usage pages. */
    1.40      hidProperties = 0;
    1.41      refCF = 0;
    1.42 @@ -268,14 +268,14 @@
    1.43          }
    1.44          CFRelease(hidProperties);
    1.45      }
    1.46 -    
    1.47 +
    1.48      if (SDL_hapticlist_tail == NULL) {
    1.49          SDL_hapticlist = SDL_hapticlist_tail = item;
    1.50      } else {
    1.51          SDL_hapticlist_tail->next = item;
    1.52          SDL_hapticlist_tail = item;
    1.53      }
    1.54 -    
    1.55 +
    1.56      /* Device has been added. */
    1.57      ++numhaptics;
    1.58  
    1.59 @@ -287,7 +287,7 @@
    1.60  {
    1.61      SDL_hapticlist_item *item;
    1.62      SDL_hapticlist_item *prev = NULL;
    1.63 -    
    1.64 +
    1.65      for (item = SDL_hapticlist; item != NULL; item = item->next) {
    1.66          /* found it, remove it. */
    1.67          if (IOObjectIsEqualTo((io_object_t) item->dev, device)) {
    1.68 @@ -306,14 +306,14 @@
    1.69              /* Need to decrement the haptic count */
    1.70              --numhaptics;
    1.71              /* !!! TODO: Send a haptic remove event? */
    1.72 -            
    1.73 +
    1.74              IOObjectRelease(item->dev);
    1.75              SDL_free(item);
    1.76              return retval;
    1.77          }
    1.78          prev = item;
    1.79      }
    1.80 -    
    1.81 +
    1.82      return -1;
    1.83  }
    1.84  
     2.1 --- a/src/haptic/dummy/SDL_syshaptic.c	Thu Feb 06 07:38:41 2014 -0500
     2.2 +++ b/src/haptic/dummy/SDL_syshaptic.c	Thu Feb 06 09:11:05 2014 -0500
     2.3 @@ -42,7 +42,7 @@
     2.4  int
     2.5  SDL_SYS_NumHaptics(void)
     2.6  {
     2.7 -	return 0;
     2.8 +    return 0;
     2.9  }
    2.10  
    2.11  const char *
     3.1 --- a/src/haptic/linux/SDL_syshaptic.c	Thu Feb 06 07:38:41 2014 -0500
     3.2 +++ b/src/haptic/linux/SDL_syshaptic.c	Thu Feb 06 09:11:05 2014 -0500
     3.3 @@ -59,7 +59,7 @@
     3.4  {
     3.5      char *fname;                /* Dev path name (like /dev/input/event1) */
     3.6      SDL_Haptic *haptic;         /* Assosciated haptic. */
     3.7 -	struct SDL_hapticlist_item *next;
     3.8 +    struct SDL_hapticlist_item *next;
     3.9  } SDL_hapticlist_item;
    3.10  
    3.11  
    3.12 @@ -172,16 +172,16 @@
    3.13      }
    3.14  
    3.15  #if SDL_USE_LIBUDEV
    3.16 -	if (SDL_UDEV_Init() < 0) {
    3.17 +    if (SDL_UDEV_Init() < 0) {
    3.18          return SDL_SetError("Could not initialize UDEV");
    3.19      }
    3.20  
    3.21 -	if ( SDL_UDEV_AddCallback(haptic_udev_callback) < 0) {
    3.22 -		SDL_UDEV_Quit();
    3.23 -		return SDL_SetError("Could not setup haptic <-> udev callback");
    3.24 -	}
    3.25 +    if ( SDL_UDEV_AddCallback(haptic_udev_callback) < 0) {
    3.26 +        SDL_UDEV_Quit();
    3.27 +        return SDL_SetError("Could not setup haptic <-> udev callback");
    3.28 +    }
    3.29  #endif /* SDL_USE_LIBUDEV */
    3.30 -	
    3.31 +
    3.32      return numhaptics;
    3.33  }
    3.34  
    3.35 @@ -215,21 +215,21 @@
    3.36      if (devpath == NULL || !(udev_class & SDL_UDEV_DEVICE_JOYSTICK)) {
    3.37          return;
    3.38      }
    3.39 -    
    3.40 +
    3.41      switch( udev_type )
    3.42      {
    3.43          case SDL_UDEV_DEVICEADDED:
    3.44              MaybeAddDevice(devpath);
    3.45              break;
    3.46 -            
    3.47 +
    3.48          case SDL_UDEV_DEVICEREMOVED:
    3.49              MaybeRemoveDevice(devpath);
    3.50              break;
    3.51 -            
    3.52 +
    3.53          default:
    3.54              break;
    3.55      }
    3.56 -    
    3.57 +
    3.58  }
    3.59  #endif /* SDL_USE_LIBUDEV */
    3.60  
    3.61 @@ -252,7 +252,7 @@
    3.62      /* check to see if file exists */
    3.63      if (stat(path, &sb) != 0) {
    3.64          return -1;
    3.65 -	}
    3.66 +    }
    3.67  
    3.68      /* check for duplicates */
    3.69      duplicate = 0;
    3.70 @@ -269,7 +269,7 @@
    3.71      fd = open(path, O_RDWR, 0);
    3.72      if (fd < 0) {
    3.73          return -1;
    3.74 -	}
    3.75 +    }
    3.76  
    3.77  #ifdef DEBUG_INPUT_EVENTS
    3.78      printf("Checking %s\n", path);
    3.79 @@ -375,11 +375,11 @@
    3.80  const char *
    3.81  SDL_SYS_HapticName(int index)
    3.82  {
    3.83 -	SDL_hapticlist_item *item;
    3.84 +    SDL_hapticlist_item *item;
    3.85      int fd;
    3.86      const char *name;
    3.87  
    3.88 -	item = HapticByDevIndex(index);
    3.89 +    item = HapticByDevIndex(index);
    3.90      /* Open the haptic device. */
    3.91      name = NULL;
    3.92      fd = open(item->fname, O_RDONLY, 0);
    3.93 @@ -456,9 +456,9 @@
    3.94  {
    3.95      int fd;
    3.96      int ret;
    3.97 -	SDL_hapticlist_item *item;
    3.98 +    SDL_hapticlist_item *item;
    3.99  
   3.100 -	item = HapticByDevIndex(haptic->index);
   3.101 +    item = HapticByDevIndex(haptic->index);
   3.102      /* Open the character device */
   3.103      fd = open(item->fname, O_RDWR, 0);
   3.104      if (fd < 0) {
   3.105 @@ -486,9 +486,8 @@
   3.106  {
   3.107      int fd;
   3.108      int device_index = 0;
   3.109 -	SDL_hapticlist_item *item;
   3.110 +    SDL_hapticlist_item *item;
   3.111  
   3.112 -	
   3.113      for (item = SDL_hapticlist; item; item = item->next) {
   3.114          /* Open the device. */
   3.115          fd = open(item->fname, O_RDWR, 0);
   3.116 @@ -505,7 +504,7 @@
   3.117  
   3.118          close(fd);
   3.119  
   3.120 -		++device_index;
   3.121 +        ++device_index;
   3.122      }
   3.123  
   3.124      return -1;
   3.125 @@ -546,16 +545,16 @@
   3.126      int device_index = 0;
   3.127      int fd;
   3.128      int ret;
   3.129 -	SDL_hapticlist_item *item;
   3.130 +    SDL_hapticlist_item *item;
   3.131  
   3.132  
   3.133      /* Find the joystick in the haptic list. */
   3.134      for (item = SDL_hapticlist; item; item = item->next) {
   3.135 -		if (SDL_strcmp(item->fname, joystick->hwdata->fname) == 0) {
   3.136 -			haptic->index = device_index;
   3.137 -			break;
   3.138 -		}
   3.139 -		++device_index;
   3.140 +        if (SDL_strcmp(item->fname, joystick->hwdata->fname) == 0) {
   3.141 +            haptic->index = device_index;
   3.142 +            break;
   3.143 +        }
   3.144 +        ++device_index;
   3.145      }
   3.146      if (device_index >= MAX_HAPTICS) {
   3.147          return SDL_SetError("Haptic: Joystick doesn't have Haptic capabilities");
   3.148 @@ -609,14 +608,14 @@
   3.149  SDL_SYS_HapticQuit(void)
   3.150  {
   3.151      SDL_hapticlist_item *item = NULL;
   3.152 -	SDL_hapticlist_item *next = NULL;
   3.153 +    SDL_hapticlist_item *next = NULL;
   3.154  
   3.155      for (item = SDL_hapticlist; item; item = next) {
   3.156 -		next = item->next;
   3.157 +        next = item->next;
   3.158          /* Opened and not closed haptics are leaked, this is on purpose.
   3.159           * Close your haptic devices after usage. */
   3.160 -		SDL_free(item->fname);
   3.161 -		item->fname = NULL;
   3.162 +        SDL_free(item->fname);
   3.163 +        item->fname = NULL;
   3.164      }
   3.165  
   3.166  #if SDL_USE_LIBUDEV
   3.167 @@ -911,7 +910,7 @@
   3.168          dest->u.rumble.strong_magnitude = leftright->large_magnitude;
   3.169          dest->u.rumble.weak_magnitude = leftright->small_magnitude;
   3.170  
   3.171 -	break;
   3.172 +        break;
   3.173  
   3.174  
   3.175      default: