src/joystick/bsd/SDL_sysjoystick.c
changeset 7037 3fedf1f25b94
parent 6963 4658b1101200
child 7191 75360622e65f
     1.1 --- a/src/joystick/bsd/SDL_sysjoystick.c	Fri Mar 29 21:29:57 2013 -0400
     1.2 +++ b/src/joystick/bsd/SDL_sysjoystick.c	Sun Mar 31 12:48:50 2013 -0400
     1.3 @@ -297,17 +297,15 @@
     1.4  
     1.5      fd = open(path, O_RDONLY);
     1.6      if (fd == -1) {
     1.7 -        SDL_SetError("%s: %s", path, strerror(errno));
     1.8 -        return (-1);
     1.9 +        return SDL_SetError("%s: %s", path, strerror(errno));
    1.10      }
    1.11  
    1.12      joy->instance_id = device_index;
    1.13      hw = (struct joystick_hwdata *)
    1.14          SDL_malloc(sizeof(struct joystick_hwdata));
    1.15      if (hw == NULL) {
    1.16 -        SDL_OutOfMemory();
    1.17          close(fd);
    1.18 -        return (-1);
    1.19 +        return SDL_OutOfMemory();
    1.20      }
    1.21      joy->hwdata = hw;
    1.22      hw->fd = fd;
    1.23 @@ -634,8 +632,7 @@
    1.24  #endif
    1.25  
    1.26      if (len < 0) {
    1.27 -        SDL_SetError("Negative HID report size");
    1.28 -        return (-1);
    1.29 +        return SDL_SetError("Negative HID report size");
    1.30      }
    1.31      r->size = len;
    1.32  
    1.33 @@ -647,15 +644,14 @@
    1.34                              r->size);
    1.35  #endif
    1.36          if (r->buf == NULL) {
    1.37 -            SDL_OutOfMemory();
    1.38 -            return (-1);
    1.39 +            return SDL_OutOfMemory();
    1.40          }
    1.41      } else {
    1.42          r->buf = NULL;
    1.43      }
    1.44  
    1.45      r->status = SREPORT_CLEAN;
    1.46 -    return (0);
    1.47 +    return 0;
    1.48  }
    1.49  
    1.50  static void