src/file/SDL_rwops.c
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
     1.1 --- a/src/file/SDL_rwops.c	Mon May 29 03:53:21 2006 +0000
     1.2 +++ b/src/file/SDL_rwops.c	Mon May 29 04:04:35 2006 +0000
     1.3 @@ -44,7 +44,7 @@
     1.4  #endif
     1.5  
     1.6  static int SDLCALL
     1.7 -win32_file_open (SDL_RWops * context, const char *filename, const char *mode)
     1.8 +win32_file_open(SDL_RWops * context, const char *filename, const char *mode)
     1.9  {
    1.10  #ifndef _WIN32_WCE
    1.11      UINT old_error_mode;
    1.12 @@ -66,12 +66,12 @@
    1.13      /* "a+"= append + read, file may not exist              */
    1.14      /* "w+" = read, write, truncate. file may not exist    */
    1.15  
    1.16 -    must_exist = (SDL_strchr (mode, 'r') != NULL) ? OPEN_EXISTING : 0;
    1.17 -    truncate = (SDL_strchr (mode, 'w') != NULL) ? CREATE_ALWAYS : 0;
    1.18 -    r_right = (SDL_strchr (mode, '+') != NULL
    1.19 +    must_exist = (SDL_strchr(mode, 'r') != NULL) ? OPEN_EXISTING : 0;
    1.20 +    truncate = (SDL_strchr(mode, 'w') != NULL) ? CREATE_ALWAYS : 0;
    1.21 +    r_right = (SDL_strchr(mode, '+') != NULL
    1.22                 || must_exist) ? GENERIC_READ : 0;
    1.23 -    a_mode = (SDL_strchr (mode, 'a') != NULL) ? OPEN_ALWAYS : 0;
    1.24 -    w_right = (a_mode || SDL_strchr (mode, '+')
    1.25 +    a_mode = (SDL_strchr(mode, 'a') != NULL) ? OPEN_ALWAYS : 0;
    1.26 +    w_right = (a_mode || SDL_strchr(mode, '+')
    1.27                 || truncate) ? GENERIC_WRITE : 0;
    1.28  
    1.29      if (!r_right && !w_right)   /* inconsistent mode */
    1.30 @@ -79,37 +79,37 @@
    1.31  
    1.32  #ifdef _WIN32_WCE
    1.33      {
    1.34 -        size_t size = SDL_strlen (filename) + 1;
    1.35 -        wchar_t *filenameW = SDL_stack_alloc (wchar_t, size);
    1.36 +        size_t size = SDL_strlen(filename) + 1;
    1.37 +        wchar_t *filenameW = SDL_stack_alloc(wchar_t, size);
    1.38  
    1.39 -        if (MultiByteToWideChar (CP_UTF8, 0, filename, -1, filenameW, size) ==
    1.40 +        if (MultiByteToWideChar(CP_UTF8, 0, filename, -1, filenameW, size) ==
    1.41              0) {
    1.42 -            SDL_SetError ("Unable to convert filename to Unicode");
    1.43 -            SDL_stack_free (filenameW);
    1.44 +            SDL_SetError("Unable to convert filename to Unicode");
    1.45 +            SDL_stack_free(filenameW);
    1.46              return -1;
    1.47          }
    1.48 -        h = CreateFile (filenameW, (w_right | r_right),
    1.49 -                        (w_right) ? 0 : FILE_SHARE_READ, NULL,
    1.50 -                        (must_exist | truncate | a_mode),
    1.51 -                        FILE_ATTRIBUTE_NORMAL, NULL);
    1.52 -        SDL_stack_free (filenameW);
    1.53 +        h = CreateFile(filenameW, (w_right | r_right),
    1.54 +                       (w_right) ? 0 : FILE_SHARE_READ, NULL,
    1.55 +                       (must_exist | truncate | a_mode),
    1.56 +                       FILE_ATTRIBUTE_NORMAL, NULL);
    1.57 +        SDL_stack_free(filenameW);
    1.58      }
    1.59  #else
    1.60      /* Do not open a dialog box if failure */
    1.61      old_error_mode =
    1.62 -        SetErrorMode (SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
    1.63 +        SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
    1.64  
    1.65 -    h = CreateFile (filename, (w_right | r_right),
    1.66 -                    (w_right) ? 0 : FILE_SHARE_READ, NULL,
    1.67 -                    (must_exist | truncate | a_mode), FILE_ATTRIBUTE_NORMAL,
    1.68 -                    NULL);
    1.69 +    h = CreateFile(filename, (w_right | r_right),
    1.70 +                   (w_right) ? 0 : FILE_SHARE_READ, NULL,
    1.71 +                   (must_exist | truncate | a_mode), FILE_ATTRIBUTE_NORMAL,
    1.72 +                   NULL);
    1.73  
    1.74      /* restore old behaviour */
    1.75 -    SetErrorMode (old_error_mode);
    1.76 +    SetErrorMode(old_error_mode);
    1.77  #endif /* _WIN32_WCE */
    1.78  
    1.79      if (h == INVALID_HANDLE_VALUE) {
    1.80 -        SDL_SetError ("Couldn't open %s", filename);
    1.81 +        SDL_SetError("Couldn't open %s", filename);
    1.82          return -2;              /* failed (CreateFile) */
    1.83      }
    1.84      context->hidden.win32io.h = h;
    1.85 @@ -118,13 +118,13 @@
    1.86      return 0;                   /* ok */
    1.87  }
    1.88  static int SDLCALL
    1.89 -win32_file_seek (SDL_RWops * context, int offset, int whence)
    1.90 +win32_file_seek(SDL_RWops * context, int offset, int whence)
    1.91  {
    1.92      DWORD win32whence;
    1.93      int file_pos;
    1.94  
    1.95      if (!context || context->hidden.win32io.h == INVALID_HANDLE_VALUE) {
    1.96 -        SDL_SetError ("win32_file_seek: invalid context/file not opened");
    1.97 +        SDL_SetError("win32_file_seek: invalid context/file not opened");
    1.98          return -1;
    1.99      }
   1.100  
   1.101 @@ -139,21 +139,21 @@
   1.102          win32whence = FILE_END;
   1.103          break;
   1.104      default:
   1.105 -        SDL_SetError ("win32_file_seek: Unknown value for 'whence'");
   1.106 +        SDL_SetError("win32_file_seek: Unknown value for 'whence'");
   1.107          return -1;
   1.108      }
   1.109  
   1.110      file_pos =
   1.111 -        SetFilePointer (context->hidden.win32io.h, offset, NULL, win32whence);
   1.112 +        SetFilePointer(context->hidden.win32io.h, offset, NULL, win32whence);
   1.113  
   1.114      if (file_pos != INVALID_SET_FILE_POINTER)
   1.115          return file_pos;        /* success */
   1.116  
   1.117 -    SDL_Error (SDL_EFSEEK);
   1.118 +    SDL_Error(SDL_EFSEEK);
   1.119      return -1;                  /* error */
   1.120  }
   1.121  static int SDLCALL
   1.122 -win32_file_read (SDL_RWops * context, void *ptr, int size, int maxnum)
   1.123 +win32_file_read(SDL_RWops * context, void *ptr, int size, int maxnum)
   1.124  {
   1.125  
   1.126      int total_bytes;
   1.127 @@ -167,14 +167,14 @@
   1.128  
   1.129      if (!ReadFile
   1.130          (context->hidden.win32io.h, ptr, total_bytes, &byte_read, NULL)) {
   1.131 -        SDL_Error (SDL_EFREAD);
   1.132 +        SDL_Error(SDL_EFREAD);
   1.133          return 0;
   1.134      }
   1.135      nread = byte_read / size;
   1.136      return nread;
   1.137  }
   1.138  static int SDLCALL
   1.139 -win32_file_write (SDL_RWops * context, const void *ptr, int size, int num)
   1.140 +win32_file_write(SDL_RWops * context, const void *ptr, int size, int num)
   1.141  {
   1.142  
   1.143      int total_bytes;
   1.144 @@ -188,16 +188,16 @@
   1.145  
   1.146      /* if in append mode, we must go to the EOF before write */
   1.147      if (context->hidden.win32io.append) {
   1.148 -        if (SetFilePointer (context->hidden.win32io.h, 0L, NULL, FILE_END)
   1.149 +        if (SetFilePointer(context->hidden.win32io.h, 0L, NULL, FILE_END)
   1.150              == INVALID_SET_FILE_POINTER) {
   1.151 -            SDL_Error (SDL_EFWRITE);
   1.152 +            SDL_Error(SDL_EFWRITE);
   1.153              return 0;
   1.154          }
   1.155      }
   1.156  
   1.157      if (!WriteFile
   1.158          (context->hidden.win32io.h, ptr, total_bytes, &byte_written, NULL)) {
   1.159 -        SDL_Error (SDL_EFWRITE);
   1.160 +        SDL_Error(SDL_EFWRITE);
   1.161          return 0;
   1.162      }
   1.163  
   1.164 @@ -205,15 +205,15 @@
   1.165      return nwritten;
   1.166  }
   1.167  static int SDLCALL
   1.168 -win32_file_close (SDL_RWops * context)
   1.169 +win32_file_close(SDL_RWops * context)
   1.170  {
   1.171  
   1.172      if (context) {
   1.173          if (context->hidden.win32io.h != INVALID_HANDLE_VALUE) {
   1.174 -            CloseHandle (context->hidden.win32io.h);
   1.175 +            CloseHandle(context->hidden.win32io.h);
   1.176              context->hidden.win32io.h = INVALID_HANDLE_VALUE;   /* to be sure */
   1.177          }
   1.178 -        SDL_FreeRW (context);
   1.179 +        SDL_FreeRW(context);
   1.180      }
   1.181      return (0);
   1.182  }
   1.183 @@ -224,46 +224,46 @@
   1.184  /* Functions to read/write stdio file pointers */
   1.185  
   1.186  static int SDLCALL
   1.187 -stdio_seek (SDL_RWops * context, int offset, int whence)
   1.188 +stdio_seek(SDL_RWops * context, int offset, int whence)
   1.189  {
   1.190 -    if (fseek (context->hidden.stdio.fp, offset, whence) == 0) {
   1.191 -        return (ftell (context->hidden.stdio.fp));
   1.192 +    if (fseek(context->hidden.stdio.fp, offset, whence) == 0) {
   1.193 +        return (ftell(context->hidden.stdio.fp));
   1.194      } else {
   1.195 -        SDL_Error (SDL_EFSEEK);
   1.196 +        SDL_Error(SDL_EFSEEK);
   1.197          return (-1);
   1.198      }
   1.199  }
   1.200  static int SDLCALL
   1.201 -stdio_read (SDL_RWops * context, void *ptr, int size, int maxnum)
   1.202 +stdio_read(SDL_RWops * context, void *ptr, int size, int maxnum)
   1.203  {
   1.204      size_t nread;
   1.205  
   1.206 -    nread = fread (ptr, size, maxnum, context->hidden.stdio.fp);
   1.207 -    if (nread == 0 && ferror (context->hidden.stdio.fp)) {
   1.208 -        SDL_Error (SDL_EFREAD);
   1.209 +    nread = fread(ptr, size, maxnum, context->hidden.stdio.fp);
   1.210 +    if (nread == 0 && ferror(context->hidden.stdio.fp)) {
   1.211 +        SDL_Error(SDL_EFREAD);
   1.212      }
   1.213      return (nread);
   1.214  }
   1.215  static int SDLCALL
   1.216 -stdio_write (SDL_RWops * context, const void *ptr, int size, int num)
   1.217 +stdio_write(SDL_RWops * context, const void *ptr, int size, int num)
   1.218  {
   1.219      size_t nwrote;
   1.220  
   1.221 -    nwrote = fwrite (ptr, size, num, context->hidden.stdio.fp);
   1.222 -    if (nwrote == 0 && ferror (context->hidden.stdio.fp)) {
   1.223 -        SDL_Error (SDL_EFWRITE);
   1.224 +    nwrote = fwrite(ptr, size, num, context->hidden.stdio.fp);
   1.225 +    if (nwrote == 0 && ferror(context->hidden.stdio.fp)) {
   1.226 +        SDL_Error(SDL_EFWRITE);
   1.227      }
   1.228      return (nwrote);
   1.229  }
   1.230  static int SDLCALL
   1.231 -stdio_close (SDL_RWops * context)
   1.232 +stdio_close(SDL_RWops * context)
   1.233  {
   1.234      if (context) {
   1.235          if (context->hidden.stdio.autoclose) {
   1.236              /* WARNING:  Check the return value here! */
   1.237 -            fclose (context->hidden.stdio.fp);
   1.238 +            fclose(context->hidden.stdio.fp);
   1.239          }
   1.240 -        SDL_FreeRW (context);
   1.241 +        SDL_FreeRW(context);
   1.242      }
   1.243      return (0);
   1.244  }
   1.245 @@ -272,7 +272,7 @@
   1.246  /* Functions to read/write memory pointers */
   1.247  
   1.248  static int SDLCALL
   1.249 -mem_seek (SDL_RWops * context, int offset, int whence)
   1.250 +mem_seek(SDL_RWops * context, int offset, int whence)
   1.251  {
   1.252      Uint8 *newpos;
   1.253  
   1.254 @@ -287,7 +287,7 @@
   1.255          newpos = context->hidden.mem.stop + offset;
   1.256          break;
   1.257      default:
   1.258 -        SDL_SetError ("Unknown value for 'whence'");
   1.259 +        SDL_SetError("Unknown value for 'whence'");
   1.260          return (-1);
   1.261      }
   1.262      if (newpos < context->hidden.mem.base) {
   1.263 @@ -300,7 +300,7 @@
   1.264      return (context->hidden.mem.here - context->hidden.mem.base);
   1.265  }
   1.266  static int SDLCALL
   1.267 -mem_read (SDL_RWops * context, void *ptr, int size, int maxnum)
   1.268 +mem_read(SDL_RWops * context, void *ptr, int size, int maxnum)
   1.269  {
   1.270      size_t total_bytes;
   1.271      size_t mem_available;
   1.272 @@ -316,32 +316,32 @@
   1.273          total_bytes = mem_available;
   1.274      }
   1.275  
   1.276 -    SDL_memcpy (ptr, context->hidden.mem.here, total_bytes);
   1.277 +    SDL_memcpy(ptr, context->hidden.mem.here, total_bytes);
   1.278      context->hidden.mem.here += total_bytes;
   1.279  
   1.280      return (total_bytes / size);
   1.281  }
   1.282  static int SDLCALL
   1.283 -mem_write (SDL_RWops * context, const void *ptr, int size, int num)
   1.284 +mem_write(SDL_RWops * context, const void *ptr, int size, int num)
   1.285  {
   1.286      if ((context->hidden.mem.here + (num * size)) > context->hidden.mem.stop) {
   1.287          num = (context->hidden.mem.stop - context->hidden.mem.here) / size;
   1.288      }
   1.289 -    SDL_memcpy (context->hidden.mem.here, ptr, num * size);
   1.290 +    SDL_memcpy(context->hidden.mem.here, ptr, num * size);
   1.291      context->hidden.mem.here += num * size;
   1.292      return (num);
   1.293  }
   1.294  static int SDLCALL
   1.295 -mem_writeconst (SDL_RWops * context, const void *ptr, int size, int num)
   1.296 +mem_writeconst(SDL_RWops * context, const void *ptr, int size, int num)
   1.297  {
   1.298 -    SDL_SetError ("Can't write to read-only memory");
   1.299 +    SDL_SetError("Can't write to read-only memory");
   1.300      return (-1);
   1.301  }
   1.302  static int SDLCALL
   1.303 -mem_close (SDL_RWops * context)
   1.304 +mem_close(SDL_RWops * context)
   1.305  {
   1.306      if (context) {
   1.307 -        SDL_FreeRW (context);
   1.308 +        SDL_FreeRW(context);
   1.309      }
   1.310      return (0);
   1.311  }
   1.312 @@ -355,10 +355,10 @@
   1.313   * name; return malloced string
   1.314   */
   1.315  static char *
   1.316 -unix_to_mac (const char *file)
   1.317 +unix_to_mac(const char *file)
   1.318  {
   1.319 -    int flen = SDL_strlen (file);
   1.320 -    char *path = SDL_malloc (flen + 2);
   1.321 +    int flen = SDL_strlen(file);
   1.322 +    char *path = SDL_malloc(flen + 2);
   1.323      const char *src = file;
   1.324      char *dst = path;
   1.325      if (*src == '/') {
   1.326 @@ -370,7 +370,7 @@
   1.327              *dst++ = ':';       /* relative paths begin with ':' */
   1.328      }
   1.329      while (src < file + flen) {
   1.330 -        const char *end = SDL_strchr (src, '/');
   1.331 +        const char *end = SDL_strchr(src, '/');
   1.332          int len;
   1.333          if (!end)
   1.334              end = file + flen;  /* last component */
   1.335 @@ -381,7 +381,7 @@
   1.336              if (len == 2 && src[0] == '.' && src[1] == '.') {
   1.337                  /* replace .. with the empty string */
   1.338              } else {
   1.339 -                SDL_memcpy (dst, src, len);
   1.340 +                SDL_memcpy(dst, src, len);
   1.341                  dst += len;
   1.342              }
   1.343              if (end < file + flen)
   1.344 @@ -395,23 +395,23 @@
   1.345  #endif /* __MACOS__ */
   1.346  
   1.347  SDL_RWops *
   1.348 -SDL_RWFromFile (const char *file, const char *mode)
   1.349 +SDL_RWFromFile(const char *file, const char *mode)
   1.350  {
   1.351      SDL_RWops *rwops = NULL;
   1.352  #ifdef HAVE_STDIO_H
   1.353      FILE *fp = NULL;
   1.354  #endif
   1.355      if (!file || !*file || !mode || !*mode) {
   1.356 -        SDL_SetError ("SDL_RWFromFile(): No file or no mode specified");
   1.357 +        SDL_SetError("SDL_RWFromFile(): No file or no mode specified");
   1.358          return NULL;
   1.359      }
   1.360  #if defined(__WIN32__)
   1.361 -    rwops = SDL_AllocRW ();
   1.362 +    rwops = SDL_AllocRW();
   1.363      if (!rwops)
   1.364          return NULL;            /* SDL_SetError already setup by SDL_AllocRW() */
   1.365      rwops->hidden.win32io.h = INVALID_HANDLE_VALUE;
   1.366 -    if (win32_file_open (rwops, file, mode)) {
   1.367 -        SDL_FreeRW (rwops);
   1.368 +    if (win32_file_open(rwops, file, mode)) {
   1.369 +        SDL_FreeRW(rwops);
   1.370          return NULL;
   1.371      }
   1.372      rwops->seek = win32_file_seek;
   1.373 @@ -423,20 +423,20 @@
   1.374  
   1.375  #ifdef __MACOS__
   1.376      {
   1.377 -        char *mpath = unix_to_mac (file);
   1.378 -        fp = fopen (mpath, mode);
   1.379 -        SDL_free (mpath);
   1.380 +        char *mpath = unix_to_mac(file);
   1.381 +        fp = fopen(mpath, mode);
   1.382 +        SDL_free(mpath);
   1.383      }
   1.384  #else
   1.385 -    fp = fopen (file, mode);
   1.386 +    fp = fopen(file, mode);
   1.387  #endif
   1.388      if (fp == NULL) {
   1.389 -        SDL_SetError ("Couldn't open %s", file);
   1.390 +        SDL_SetError("Couldn't open %s", file);
   1.391      } else {
   1.392 -        rwops = SDL_RWFromFP (fp, 1);
   1.393 +        rwops = SDL_RWFromFP(fp, 1);
   1.394      }
   1.395  #else
   1.396 -    SDL_SetError ("SDL not compiled with stdio support");
   1.397 +    SDL_SetError("SDL not compiled with stdio support");
   1.398  #endif /* !HAVE_STDIO_H */
   1.399  
   1.400      return (rwops);
   1.401 @@ -444,11 +444,11 @@
   1.402  
   1.403  #ifdef HAVE_STDIO_H
   1.404  SDL_RWops *
   1.405 -SDL_RWFromFP (FILE * fp, int autoclose)
   1.406 +SDL_RWFromFP(FILE * fp, int autoclose)
   1.407  {
   1.408      SDL_RWops *rwops = NULL;
   1.409  
   1.410 -    rwops = SDL_AllocRW ();
   1.411 +    rwops = SDL_AllocRW();
   1.412      if (rwops != NULL) {
   1.413          rwops->seek = stdio_seek;
   1.414          rwops->read = stdio_read;
   1.415 @@ -462,11 +462,11 @@
   1.416  #endif /* HAVE_STDIO_H */
   1.417  
   1.418  SDL_RWops *
   1.419 -SDL_RWFromMem (void *mem, int size)
   1.420 +SDL_RWFromMem(void *mem, int size)
   1.421  {
   1.422      SDL_RWops *rwops;
   1.423  
   1.424 -    rwops = SDL_AllocRW ();
   1.425 +    rwops = SDL_AllocRW();
   1.426      if (rwops != NULL) {
   1.427          rwops->seek = mem_seek;
   1.428          rwops->read = mem_read;
   1.429 @@ -480,11 +480,11 @@
   1.430  }
   1.431  
   1.432  SDL_RWops *
   1.433 -SDL_RWFromConstMem (const void *mem, int size)
   1.434 +SDL_RWFromConstMem(const void *mem, int size)
   1.435  {
   1.436      SDL_RWops *rwops;
   1.437  
   1.438 -    rwops = SDL_AllocRW ();
   1.439 +    rwops = SDL_AllocRW();
   1.440      if (rwops != NULL) {
   1.441          rwops->seek = mem_seek;
   1.442          rwops->read = mem_read;
   1.443 @@ -498,119 +498,119 @@
   1.444  }
   1.445  
   1.446  SDL_RWops *
   1.447 -SDL_AllocRW (void)
   1.448 +SDL_AllocRW(void)
   1.449  {
   1.450      SDL_RWops *area;
   1.451  
   1.452 -    area = (SDL_RWops *) SDL_malloc (sizeof *area);
   1.453 +    area = (SDL_RWops *) SDL_malloc(sizeof *area);
   1.454      if (area == NULL) {
   1.455 -        SDL_OutOfMemory ();
   1.456 +        SDL_OutOfMemory();
   1.457      }
   1.458      return (area);
   1.459  }
   1.460  
   1.461  void
   1.462 -SDL_FreeRW (SDL_RWops * area)
   1.463 +SDL_FreeRW(SDL_RWops * area)
   1.464  {
   1.465 -    SDL_free (area);
   1.466 +    SDL_free(area);
   1.467  }
   1.468  
   1.469  /* Functions for dynamically reading and writing endian-specific values */
   1.470  
   1.471  Uint16
   1.472 -SDL_ReadLE16 (SDL_RWops * src)
   1.473 +SDL_ReadLE16(SDL_RWops * src)
   1.474  {
   1.475      Uint16 value;
   1.476  
   1.477 -    SDL_RWread (src, &value, (sizeof value), 1);
   1.478 -    return (SDL_SwapLE16 (value));
   1.479 +    SDL_RWread(src, &value, (sizeof value), 1);
   1.480 +    return (SDL_SwapLE16(value));
   1.481  }
   1.482  
   1.483  Uint16
   1.484 -SDL_ReadBE16 (SDL_RWops * src)
   1.485 +SDL_ReadBE16(SDL_RWops * src)
   1.486  {
   1.487      Uint16 value;
   1.488  
   1.489 -    SDL_RWread (src, &value, (sizeof value), 1);
   1.490 -    return (SDL_SwapBE16 (value));
   1.491 +    SDL_RWread(src, &value, (sizeof value), 1);
   1.492 +    return (SDL_SwapBE16(value));
   1.493  }
   1.494  
   1.495  Uint32
   1.496 -SDL_ReadLE32 (SDL_RWops * src)
   1.497 +SDL_ReadLE32(SDL_RWops * src)
   1.498  {
   1.499      Uint32 value;
   1.500  
   1.501 -    SDL_RWread (src, &value, (sizeof value), 1);
   1.502 -    return (SDL_SwapLE32 (value));
   1.503 +    SDL_RWread(src, &value, (sizeof value), 1);
   1.504 +    return (SDL_SwapLE32(value));
   1.505  }
   1.506  
   1.507  Uint32
   1.508 -SDL_ReadBE32 (SDL_RWops * src)
   1.509 +SDL_ReadBE32(SDL_RWops * src)
   1.510  {
   1.511      Uint32 value;
   1.512  
   1.513 -    SDL_RWread (src, &value, (sizeof value), 1);
   1.514 -    return (SDL_SwapBE32 (value));
   1.515 +    SDL_RWread(src, &value, (sizeof value), 1);
   1.516 +    return (SDL_SwapBE32(value));
   1.517  }
   1.518  
   1.519  Uint64
   1.520 -SDL_ReadLE64 (SDL_RWops * src)
   1.521 +SDL_ReadLE64(SDL_RWops * src)
   1.522  {
   1.523      Uint64 value;
   1.524  
   1.525 -    SDL_RWread (src, &value, (sizeof value), 1);
   1.526 -    return (SDL_SwapLE64 (value));
   1.527 +    SDL_RWread(src, &value, (sizeof value), 1);
   1.528 +    return (SDL_SwapLE64(value));
   1.529  }
   1.530  
   1.531  Uint64
   1.532 -SDL_ReadBE64 (SDL_RWops * src)
   1.533 +SDL_ReadBE64(SDL_RWops * src)
   1.534  {
   1.535      Uint64 value;
   1.536  
   1.537 -    SDL_RWread (src, &value, (sizeof value), 1);
   1.538 -    return (SDL_SwapBE64 (value));
   1.539 +    SDL_RWread(src, &value, (sizeof value), 1);
   1.540 +    return (SDL_SwapBE64(value));
   1.541  }
   1.542  
   1.543  int
   1.544 -SDL_WriteLE16 (SDL_RWops * dst, Uint16 value)
   1.545 +SDL_WriteLE16(SDL_RWops * dst, Uint16 value)
   1.546  {
   1.547 -    value = SDL_SwapLE16 (value);
   1.548 -    return (SDL_RWwrite (dst, &value, (sizeof value), 1));
   1.549 +    value = SDL_SwapLE16(value);
   1.550 +    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
   1.551  }
   1.552  
   1.553  int
   1.554 -SDL_WriteBE16 (SDL_RWops * dst, Uint16 value)
   1.555 +SDL_WriteBE16(SDL_RWops * dst, Uint16 value)
   1.556  {
   1.557 -    value = SDL_SwapBE16 (value);
   1.558 -    return (SDL_RWwrite (dst, &value, (sizeof value), 1));
   1.559 +    value = SDL_SwapBE16(value);
   1.560 +    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
   1.561  }
   1.562  
   1.563  int
   1.564 -SDL_WriteLE32 (SDL_RWops * dst, Uint32 value)
   1.565 +SDL_WriteLE32(SDL_RWops * dst, Uint32 value)
   1.566  {
   1.567 -    value = SDL_SwapLE32 (value);
   1.568 -    return (SDL_RWwrite (dst, &value, (sizeof value), 1));
   1.569 +    value = SDL_SwapLE32(value);
   1.570 +    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
   1.571  }
   1.572  
   1.573  int
   1.574 -SDL_WriteBE32 (SDL_RWops * dst, Uint32 value)
   1.575 +SDL_WriteBE32(SDL_RWops * dst, Uint32 value)
   1.576  {
   1.577 -    value = SDL_SwapBE32 (value);
   1.578 -    return (SDL_RWwrite (dst, &value, (sizeof value), 1));
   1.579 +    value = SDL_SwapBE32(value);
   1.580 +    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
   1.581  }
   1.582  
   1.583  int
   1.584 -SDL_WriteLE64 (SDL_RWops * dst, Uint64 value)
   1.585 +SDL_WriteLE64(SDL_RWops * dst, Uint64 value)
   1.586  {
   1.587 -    value = SDL_SwapLE64 (value);
   1.588 -    return (SDL_RWwrite (dst, &value, (sizeof value), 1));
   1.589 +    value = SDL_SwapLE64(value);
   1.590 +    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
   1.591  }
   1.592  
   1.593  int
   1.594 -SDL_WriteBE64 (SDL_RWops * dst, Uint64 value)
   1.595 +SDL_WriteBE64(SDL_RWops * dst, Uint64 value)
   1.596  {
   1.597 -    value = SDL_SwapBE64 (value);
   1.598 -    return (SDL_RWwrite (dst, &value, (sizeof value), 1));
   1.599 +    value = SDL_SwapBE64(value);
   1.600 +    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
   1.601  }
   1.602  
   1.603  /* vi: set ts=4 sw=4 expandtab: */