From 4ac1b2accb337ffacdbb20e2cc01f618513bbccd Mon Sep 17 00:00:00 2001 From: shashclp Date: Tue, 27 Mar 2007 02:57:36 +0000 Subject: [PATCH] - Changed a few functions not returning data when they should --- desmume/src/fs-windows.c | 2 ++ desmume/src/fs.h | 1 + desmume/src/mc.c | 10 ++++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/desmume/src/fs-windows.c b/desmume/src/fs-windows.c index aa6221fb2..e56e74b72 100644 --- a/desmume/src/fs-windows.c +++ b/desmume/src/fs-windows.c @@ -85,4 +85,6 @@ void FsClose(void * search) { int FsError(void) { if (GetLastError() == ERROR_NO_MORE_FILES) return FS_ERR_NO_MORE_FILES; + + return FS_ERR_UNKNOWN; } diff --git a/desmume/src/fs.h b/desmume/src/fs.h index 97cf21b4f..2cbdb4da6 100644 --- a/desmume/src/fs.h +++ b/desmume/src/fs.h @@ -28,6 +28,7 @@ extern "C" { #define FS_IS_DIR 1 +#define FS_ERR_UNKNOWN -1 #define FS_ERR_NO_MORE_FILES 1 extern const char FS_SEPARATOR; diff --git a/desmume/src/mc.c b/desmume/src/mc.c index 1adcfb9eb..2ca16af8d 100644 --- a/desmume/src/mc.c +++ b/desmume/src/mc.c @@ -80,11 +80,13 @@ u8 *mc_alloc(memory_chip_t *mc, u32 size) { u8 *buffer; buffer = malloc(size); - - mc->data = buffer; + + mc->data = buffer; if(!buffer) { return NULL; } - mc->size = size; - mc->writeable_buffer = TRUE; + mc->size = size; + mc->writeable_buffer = TRUE; + + return buffer; } void mc_free(memory_chip_t *mc)