src/file/SDL_rwops.c
changeset 7037 3fedf1f25b94
parent 7011 82bbfbbc720e
child 7070 65df21723f58
child 8460 f483e8bdae3c
     1.1 --- a/src/file/SDL_rwops.c	Fri Mar 29 21:29:57 2013 -0400
     1.2 +++ b/src/file/SDL_rwops.c	Sun Mar 31 12:48:50 2013 -0400
     1.3 @@ -87,8 +87,7 @@
     1.4      context->hidden.windowsio.buffer.data =
     1.5          (char *) SDL_malloc(READAHEAD_BUFFER_SIZE);
     1.6      if (!context->hidden.windowsio.buffer.data) {
     1.7 -        SDL_OutOfMemory();
     1.8 -        return -1;
     1.9 +        return SDL_OutOfMemory();
    1.10      }
    1.11      /* Do not open a dialog box if failure */
    1.12      old_error_mode =
    1.13 @@ -124,13 +123,11 @@
    1.14      LARGE_INTEGER size;
    1.15  
    1.16      if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE) {
    1.17 -        SDL_SetError("windows_file_size: invalid context/file not opened");
    1.18 -        return -1;
    1.19 +        return SDL_SetError("windows_file_size: invalid context/file not opened");
    1.20      }
    1.21  
    1.22      if (!GetFileSizeEx(context->hidden.windowsio.h, &size)) {
    1.23 -        WIN_SetError("windows_file_size");
    1.24 -        return -1;
    1.25 +        return WIN_SetError("windows_file_size");
    1.26      }
    1.27  
    1.28      return size.QuadPart;
    1.29 @@ -143,8 +140,7 @@
    1.30      LARGE_INTEGER windowsoffset;
    1.31  
    1.32      if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE) {
    1.33 -        SDL_SetError("windows_file_seek: invalid context/file not opened");
    1.34 -        return -1;
    1.35 +        return SDL_SetError("windows_file_seek: invalid context/file not opened");
    1.36      }
    1.37  
    1.38      /* FIXME: We may be able to satisfy the seek within buffered data */
    1.39 @@ -164,14 +160,12 @@
    1.40          windowswhence = FILE_END;
    1.41          break;
    1.42      default:
    1.43 -        SDL_SetError("windows_file_seek: Unknown value for 'whence'");
    1.44 -        return -1;
    1.45 +        return SDL_SetError("windows_file_seek: Unknown value for 'whence'");
    1.46      }
    1.47  
    1.48      windowsoffset.QuadPart = offset;
    1.49      if (!SetFilePointerEx(context->hidden.windowsio.h, windowsoffset, &windowsoffset, windowswhence)) {
    1.50 -        WIN_SetError("windows_file_seek");
    1.51 -        return -1;
    1.52 +        return WIN_SetError("windows_file_seek");
    1.53      }
    1.54      return windowsoffset.QuadPart;
    1.55  }
    1.56 @@ -325,8 +319,7 @@
    1.57          return (ftell(context->hidden.stdio.fp));
    1.58      }
    1.59  #endif
    1.60 -    SDL_Error(SDL_EFSEEK);
    1.61 -    return (-1);
    1.62 +    return SDL_Error(SDL_EFSEEK);
    1.63  }
    1.64  
    1.65  static size_t SDLCALL
    1.66 @@ -361,8 +354,7 @@
    1.67          if (context->hidden.stdio.autoclose) {
    1.68              /* WARNING:  Check the return value here! */
    1.69              if (fclose(context->hidden.stdio.fp) != 0) {
    1.70 -                SDL_Error(SDL_EFWRITE);
    1.71 -                status = -1;
    1.72 +                status = SDL_Error(SDL_EFWRITE);
    1.73              }
    1.74          }
    1.75          SDL_FreeRW(context);
    1.76 @@ -395,8 +387,7 @@
    1.77          newpos = context->hidden.mem.stop + offset;
    1.78          break;
    1.79      default:
    1.80 -        SDL_SetError("Unknown value for 'whence'");
    1.81 -        return (-1);
    1.82 +        return SDL_SetError("Unknown value for 'whence'");
    1.83      }
    1.84      if (newpos < context->hidden.mem.base) {
    1.85          newpos = context->hidden.mem.base;