diff options
Diffstat (limited to 'src/osd/sdl/sdlfile.c')
-rw-r--r-- | src/osd/sdl/sdlfile.c | 136 |
1 files changed, 68 insertions, 68 deletions
diff --git a/src/osd/sdl/sdlfile.c b/src/osd/sdl/sdlfile.c index 652b14e023c..cb46900cf08 100644 --- a/src/osd/sdl/sdlfile.c +++ b/src/osd/sdl/sdlfile.c @@ -52,7 +52,7 @@ extern const char *sdlfile_ptty_identifier; #define INVPATHSEPCH '\\' #endif -#define NO_ERROR (0) +#define NO_ERROR (0) //============================================================ // Prototypes @@ -276,41 +276,41 @@ file_error osd_read(osd_file *file, void *buffer, UINT64 offset, UINT32 count, U { ssize_t result; - switch (file->type) - { - case SDLFILE_FILE: + switch (file->type) + { + case SDLFILE_FILE: #if defined(SDLMAME_DARWIN) || defined(SDLMAME_BSD) - result = pread(file->handle, buffer, count, offset); - if (result < 0) + result = pread(file->handle, buffer, count, offset); + if (result < 0) #elif defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_OS2) - lseek(file->handle, (UINT32)offset&0xffffffff, SEEK_SET); - result = read(file->handle, buffer, count); - if (result < 0) + lseek(file->handle, (UINT32)offset&0xffffffff, SEEK_SET); + result = read(file->handle, buffer, count); + if (result < 0) #elif defined(SDLMAME_UNIX) - result = pread64(file->handle, buffer, count, offset); - if (result < 0) + result = pread64(file->handle, buffer, count, offset); + if (result < 0) #else #error Unknown SDL SUBARCH! #endif - return error_to_file_error(errno); + return error_to_file_error(errno); - if (actual != NULL) - *actual = result; + if (actual != NULL) + *actual = result; - return FILERR_NONE; - break; + return FILERR_NONE; + break; - case SDLFILE_SOCKET: - return sdl_read_socket(file, buffer, offset, count, actual); - break; + case SDLFILE_SOCKET: + return sdl_read_socket(file, buffer, offset, count, actual); + break; - case SDLFILE_PTTY: - return sdl_read_ptty(file, buffer, offset, count, actual); - break; + case SDLFILE_PTTY: + return sdl_read_ptty(file, buffer, offset, count, actual); + break; - default: - return FILERR_FAILURE; - } + default: + return FILERR_FAILURE; + } } @@ -322,40 +322,40 @@ file_error osd_write(osd_file *file, const void *buffer, UINT64 offset, UINT32 c { UINT32 result; - switch (file->type) - { - case SDLFILE_FILE: + switch (file->type) + { + case SDLFILE_FILE: #if defined(SDLMAME_DARWIN) || defined(SDLMAME_BSD) - result = pwrite(file->handle, buffer, count, offset); - if (!result) + result = pwrite(file->handle, buffer, count, offset); + if (!result) #elif defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_OS2) - lseek(file->handle, (UINT32)offset&0xffffffff, SEEK_SET); - result = write(file->handle, buffer, count); - if (!result) + lseek(file->handle, (UINT32)offset&0xffffffff, SEEK_SET); + result = write(file->handle, buffer, count); + if (!result) #elif defined(SDLMAME_UNIX) - result = pwrite64(file->handle, buffer, count, offset); - if (!result) + result = pwrite64(file->handle, buffer, count, offset); + if (!result) #else #error Unknown SDL SUBARCH! #endif return error_to_file_error(errno); - if (actual != NULL) - *actual = result; - return FILERR_NONE; - break; + if (actual != NULL) + *actual = result; + return FILERR_NONE; + break; - case SDLFILE_SOCKET: - return sdl_write_socket(file, buffer, offset, count, actual); - break; + case SDLFILE_SOCKET: + return sdl_write_socket(file, buffer, offset, count, actual); + break; - case SDLFILE_PTTY: - return sdl_write_ptty(file, buffer, offset, count, actual); - break; + case SDLFILE_PTTY: + return sdl_write_ptty(file, buffer, offset, count, actual); + break; - default: - return FILERR_FAILURE; - } + default: + return FILERR_FAILURE; + } } @@ -366,25 +366,25 @@ file_error osd_write(osd_file *file, const void *buffer, UINT64 offset, UINT32 c file_error osd_close(osd_file *file) { // close the file handle and free the file structure - switch (file->type) - { - case SDLFILE_FILE: - close(file->handle); - osd_free(file); - return FILERR_NONE; - break; - - case SDLFILE_SOCKET: - return sdl_close_socket(file); - break; - - case SDLFILE_PTTY: - return sdl_close_ptty(file); - break; - - default: - return FILERR_FAILURE; - } + switch (file->type) + { + case SDLFILE_FILE: + close(file->handle); + osd_free(file); + return FILERR_NONE; + break; + + case SDLFILE_SOCKET: + return sdl_close_socket(file); + break; + + case SDLFILE_PTTY: + return sdl_close_ptty(file); + break; + + default: + return FILERR_FAILURE; + } } //============================================================ @@ -441,7 +441,7 @@ static UINT32 create_path_recursive(char *path) int osd_get_physical_drive_geometry(const char *filename, UINT32 *cylinders, UINT32 *heads, UINT32 *sectors, UINT32 *bps) { - return FALSE; // no, no way, huh-uh, forget it + return FALSE; // no, no way, huh-uh, forget it } //============================================================ |