# HG changeset patch # User nenolod # Date 1165099407 28800 # Node ID 90a843d02970479222cb5995a3fda3e1913b129e # Parent 31c9d8f37474f962d8827b3abcd6d13bb9355e89 [svn] - some OSes use macros for some f*() functions, therefore make sure we properly cast our opaque data to a FILE* struct. diff -r 31c9d8f37474 -r 90a843d02970 ChangeLog --- a/ChangeLog Fri Dec 01 00:03:10 2006 -0800 +++ b/ChangeLog Sat Dec 02 14:43:27 2006 -0800 @@ -1,3 +1,11 @@ +2006-12-01 08:03:10 +0000 William Pitcock + revision [714] + - disable the playlist when loading = false. + + trunk/src/console/Nsfe_Emu.cxx | 1 + + 1 file changed, 1 insertion(+) + + 2006-12-01 07:08:19 +0000 William Pitcock revision [712] - should return -1, not 1. diff -r 31c9d8f37474 -r 90a843d02970 src/stdio/stdio.c --- a/src/stdio/stdio.c Fri Dec 01 00:03:10 2006 -0800 +++ b/src/stdio/stdio.c Sat Dec 02 14:43:27 2006 -0800 @@ -53,8 +53,11 @@ if (file == NULL) return -1; - if (file->handle) { - if (fclose(file->handle) != 0) + if (file->handle) + { + FILE *handle = (FILE *) file->handle; + + if (fclose(handle) != 0) ret = -1; } @@ -67,10 +70,14 @@ size_t nmemb, VFSFile * file) { + FILE *handle; + if (file == NULL) return 0; - return fread(ptr, size, nmemb, file->handle); + handle = (FILE *) file->handle; + + return fread(ptr, size, nmemb, handle); } size_t @@ -79,22 +86,30 @@ size_t nmemb, VFSFile * file) { + FILE *handle; + if (file == NULL) return 0; - return fwrite(ptr, size, nmemb, file->handle); + handle = (FILE *) file->handle; + + return fwrite(ptr, size, nmemb, handle); } gint stdio_vfs_getc_impl(VFSFile *stream) { - return getc( stream->handle ); + FILE *handle = (FILE *) stream->handle; + + return getc( handle ); } gint stdio_vfs_ungetc_impl(gint c, VFSFile *stream) { - return ungetc( c , stream->handle ); + FILE *handle = (FILE *) stream->handle; + + return ungetc( c , handle ); } gint @@ -102,46 +117,66 @@ glong offset, gint whence) { + FILE *handle; + if (file == NULL) return 0; - return fseek(file->handle, offset, whence); + handle = (FILE *) file->handle; + + return fseek(handle, offset, whence); } void stdio_vfs_rewind_impl(VFSFile * file) { + FILE *handle; + if (file == NULL) return; - rewind(file->handle); + handle = (FILE *) file->handle; + + rewind(handle); } glong stdio_vfs_ftell_impl(VFSFile * file) { + FILE *handle; + if (file == NULL) return 0; - return ftell(file->handle); + handle = (FILE *) file->handle; + + return ftell(handle); } gboolean stdio_vfs_feof_impl(VFSFile * file) { + FILE *handle; + if (file == NULL) return FALSE; - return (gboolean) feof(file->handle); + handle = (FILE *) file->handle; + + return (gboolean) feof(handle); } gint stdio_vfs_truncate_impl(VFSFile * file, glong size) { + FILE *handle; + if (file == NULL) return -1; - return ftruncate(fileno(file->handle), size); + handle = (FILE *) file->handle; + + return ftruncate(fileno(handle), size); } VFSConstructor file_const = {