From 8f3b2e9b4d9f1f82682e1eed018153091cddee9f Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Sat, 29 Nov 2008 18:01:16 +0000 Subject: Remove warnings from NDS build. svn-id: r35172 --- backends/platform/ds/arm9/source/fat/disc_io.c | 54 +++++++++++----------- .../platform/ds/arm9/source/wordcompletion.cpp | 5 +- 2 files changed, 29 insertions(+), 30 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/ds/arm9/source/fat/disc_io.c b/backends/platform/ds/arm9/source/fat/disc_io.c index 6d48674d62..9a65812f89 100644 --- a/backends/platform/ds/arm9/source/fat/disc_io.c +++ b/backends/platform/ds/arm9/source/fat/disc_io.c @@ -5,7 +5,7 @@ uniformed io-interface to work with Chishm's FAT library Written by MightyMax - + Modified by Chishm: 2005-11-06 * Added WAIT_CR modifications for NDS @@ -28,13 +28,13 @@ * Added EFA2 support */ -#include "disc_io.h" -#include "scummconsole.h" - #ifdef NDS #include #endif +#include "disc_io.h" +#include "scummconsole.h" + // Include known io-interfaces: #ifdef SUPPORT_MPCF @@ -87,7 +87,7 @@ LPIO_INTERFACE active_interface = 0; Disc Cache functions 2006-02-03: - Added by www.neoflash.com + Added by www.neoflash.com */ int discDetect = 0; @@ -99,7 +99,7 @@ int dldiFound = FALSE; #include #define CACHE_FREE 0xFFFFFFFF - + static u8 cacheBuffer[ DISC_CACHE_COUNT * 512 ]; static struct { @@ -112,20 +112,20 @@ FATDevice currentDevice; static u32 disc_CacheFind(u32 sector) { u32 i; - + for( i = 0; i < DISC_CACHE_COUNT; i++ ) { if( cache[ i ].sector == sector ) return i; } - + return CACHE_FREE; } static u32 disc_CacheFindFree(void) { - + u32 i = 0, j; u32 count = -1; - + for( j = 0; j < DISC_CACHE_COUNT; j++ ) { if( cache[ j ].sector == CACHE_FREE ) { @@ -142,7 +142,7 @@ static u32 disc_CacheFindFree(void) { if( cache[ i ].sector != CACHE_FREE && cache[i].dirty != 0 ) { active_interface->fn_WriteSectors( cache[ i ].sector, 1, &cacheBuffer[ i * 512 ] ); - /* todo: handle write error here + // todo: handle write error here cache[ i ].sector = CACHE_FREE; cache[ i ].dirty = 0; @@ -368,7 +368,7 @@ bool disc_setDsSlotInterface (void) active_interface = DLDI_GetInterface(); - if (stricmp(&_dldi_driver_name, "Default (No interface)")) { + if (stricmp((char *)(&_dldi_driver_name), "Default (No interface)")) { char name[48]; memcpy(name, &_dldi_driver_name, 48); name[47] = '\0'; @@ -431,7 +431,7 @@ bool disc_setDsSlotInterface (void) #endif -bool disc_Init(void) +bool disc_Init(void) { #ifdef DISC_CACHE disc_CacheInit(); @@ -455,15 +455,15 @@ bool disc_Init(void) // could not find a working IO Interface active_interface = 0 ; return false ; -} +} -bool disc_IsInserted(void) +bool disc_IsInserted(void) { if (active_interface) return active_interface->fn_IsInserted() ; return false ; -} +} -bool disc_ReadSectors(u32 sector, u8 numSecs, void* buffer) +bool disc_ReadSectors(u32 sector, u8 numSecs, void* buffer) { #ifdef DISC_CACHE u8 *p=(u8*)buffer; @@ -480,9 +480,9 @@ bool disc_ReadSectors(u32 sector, u8 numSecs, void* buffer) if (active_interface) return active_interface->fn_ReadSectors(sector,numSecs,buffer) ; return false ; #endif -} +} -bool disc_WriteSectors(u32 sector, u8 numSecs, void* buffer) +bool disc_WriteSectors(u32 sector, u8 numSecs, void* buffer) { /*#ifdef DISC_CACHE u8 *p=(u8*)buffer; @@ -513,32 +513,32 @@ bool disc_WriteSectors(u32 sector, u8 numSecs, void* buffer) int r; for (r = 0; r < numSecs; r++) { - memcpy(sectorBuffer, &buffer[r * 512], 512); + memcpy(sectorBuffer, &((char *)buffer)[r * 512], 512); if (!active_interface->fn_WriteSectors(sector + r, 1, sectorBuffer)) { return false; } } - + return true; } #else if (active_interface) return active_interface->fn_WriteSectors(sector,numSecs,buffer) ; - return false ; #endif //#endif -} + return false ; +} -bool disc_ClearStatus(void) +bool disc_ClearStatus(void) { if (active_interface) return active_interface->fn_ClearStatus() ; return false ; -} +} -bool disc_Shutdown(void) +bool disc_Shutdown(void) { #ifdef DISC_CACHE disc_CacheFlush(); @@ -546,7 +546,7 @@ bool disc_Shutdown(void) if (active_interface) active_interface->fn_Shutdown() ; active_interface = 0 ; return true ; -} +} u32 disc_HostType (void) { diff --git a/backends/platform/ds/arm9/source/wordcompletion.cpp b/backends/platform/ds/arm9/source/wordcompletion.cpp index ff52572a40..60ac673b69 100644 --- a/backends/platform/ds/arm9/source/wordcompletion.cpp +++ b/backends/platform/ds/arm9/source/wordcompletion.cpp @@ -70,7 +70,6 @@ void sortAutoCompleteWordList() { // Sends the current available words to the virtual keyboard code for display bool findWordCompletions(char* input) { - char testWord[32]; int min = 0; int max = wordBufferPtrPos - 1; char* word; @@ -136,7 +135,7 @@ bool findWordCompletions(char* input) bool match = true; - for (int r = 0; r < strlen(partialWord); r++) { + for (int r = 0; partialWord[r] != 0; r++) { if (word[r] != partialWord[r]) { match = false; break; @@ -155,7 +154,7 @@ bool findWordCompletions(char* input) do { - for (int r = 0; r < strlen(partialWord); r++) { + for (int r = 0; partialWord[r] != 0; r++) { if (word[r] != partialWord[r]) { match = false; break; -- cgit v1.2.3