From bf7f5eadf2b58cd561aa3e3e2be1230f969f7cda Mon Sep 17 00:00:00 2001 From: Darren Alton Date: Tue, 10 Jun 2008 06:45:39 +0000 Subject: [PATCH] First commit. Added header configs for DS as well as a Makefile. Initial work on framebuffer video driver, currently not functioning as desired. --- include/SDL_config.h.default | 4 +++- include/SDL_platform.h | 5 +++++ include/SDL_stdinc.h | 9 +++++++++ src/audio/SDL_wave.c | 6 ++---- src/audio/bsd/SDL_bsdaudio.c | 3 +-- src/audio/dma/SDL_dmaaudio.c | 3 +-- src/audio/esd/SDL_esdaudio.c | 5 ++--- src/audio/nto/SDL_nto_audio.c | 6 ++---- src/audio/paudio/SDL_paudio.c | 5 ++--- src/audio/ums/SDL_umsaudio.c | 6 ++---- src/audio/windib/SDL_dibaudio.c | 3 +-- src/cdrom/aix/SDL_syscdrom.c | 15 +++++---------- src/cdrom/beos/SDL_syscdrom.cc | 3 +-- src/cdrom/bsdi/SDL_syscdrom.c | 3 +-- src/cdrom/freebsd/SDL_syscdrom.c | 3 +-- src/cdrom/linux/SDL_syscdrom.c | 3 +-- src/cdrom/macosx/AudioFilePlayer.c | 3 +-- src/cdrom/macosx/CDPlayer.c | 3 +-- src/cdrom/openbsd/SDL_syscdrom.c | 3 +-- src/cdrom/osf/SDL_syscdrom.c | 3 +-- src/cdrom/qnx/SDL_syscdrom.c | 6 ++---- src/main/beos/SDL_BeApp.cc | 3 +-- src/thread/SDL_thread_c.h | 2 ++ src/thread/irix/SDL_syssem.c | 3 +-- src/thread/pthread/SDL_syssem.c | 3 +-- src/thread/riscos/SDL_syssem.c | 3 +-- src/timer/riscos/SDL_systimer.c | 3 +-- src/timer/unix/SDL_systimer.c | 3 +-- src/video/SDL_RLEaccel.c | 30 ++++++++++------------------- src/video/SDL_sysvideo.h | 3 +++ src/video/SDL_video.c | 3 +++ src/video/fbcon/SDL_fbelo.c | 3 +-- src/video/fbcon/SDL_fbevents.c | 8 +++----- src/video/fbcon/SDL_fbvideo.c | 12 ++++-------- src/video/ipod/SDL_ipodvideo.c | 9 +++------ src/video/photon/SDL_phyuv.c | 3 +-- src/video/ps2gs/SDL_gsevents.c | 8 +++----- src/video/svga/SDL_svgaevents.c | 3 +-- src/video/vgl/SDL_vglevents.c | 3 +-- src/video/wscons/SDL_wsconsevents.c | 3 +-- test/testblitspeed.c | 3 +-- test/testdyngl.c | 3 +-- test/testpalette.c | 3 +-- 43 files changed, 90 insertions(+), 127 deletions(-) diff --git a/include/SDL_config.h.default b/include/SDL_config.h.default index c7b1693b0..06027a2a7 100644 --- a/include/SDL_config.h.default +++ b/include/SDL_config.h.default @@ -26,7 +26,9 @@ #include "SDL_platform.h" /* Add any platform that doesn't build using the configure system */ -#if defined(__DREAMCAST__) +#if defined(__NINTENDODS__) +#include "SDL_config_nintendods.h" +#elif defined(__DREAMCAST__) #include "SDL_config_dreamcast.h" #elif defined(__MACOSX__) #include "SDL_config_macosx.h" diff --git a/include/SDL_platform.h b/include/SDL_platform.h index 1bfee29ec..e7f1c9e38 100644 --- a/include/SDL_platform.h +++ b/include/SDL_platform.h @@ -97,4 +97,9 @@ #define __WIN32__ 1 #endif +#if defined(__NDS__) +#undef __NINTENDODS__ +#define __NINTENDODS__ 1 +#endif + #endif /* _SDL_platform_h */ diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h index 3df9e2a22..7e3a00b05 100644 --- a/include/SDL_stdinc.h +++ b/include/SDL_stdinc.h @@ -147,8 +147,12 @@ SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); +#ifndef __NINTENDODS__ /* TODO: figure out why the following happens: +include/SDL_stdinc.h:150: error: size of array 'SDL_dummy_uint64' is negative +include/SDL_stdinc.h:151: error: size of array 'SDL_dummy_sint64' is negative */ SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); +#endif #endif /* DOXYGEN_SHOULD_IGNORE_THIS */ /* Check to make sure enums are the size of ints, for structure packing. @@ -162,12 +166,14 @@ SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); #endif #ifndef DOXYGEN_SHOULD_IGNORE_THIS +#ifndef __NINTENDODS__ /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */ typedef enum { DUMMY_ENUM_VALUE } SDL_DUMMY_ENUM; SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); +#endif #endif /* DOXYGEN_SHOULD_IGNORE_THIS */ #include "begin_code.h" @@ -425,6 +431,9 @@ extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string); #ifdef HAVE_WCSLEN #define SDL_wcslen wcslen #else +#if !defined(wchar_t) && defined(__NINTENDODS__) +#define wchar_t short /* TODO: figure out why libnds doesn't have this */ +#endif extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t * string); #endif diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index 630209ee6..c5eee2c42 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -462,8 +462,7 @@ SDL_LoadWAV_RW(SDL_RWops * src, int freesrc, } /* 2 Uint32's for chunk header+len, plus the lenread */ headerDiff += lenread + 2 * sizeof(Uint32); - } - while ((chunk.magic == FACT) || (chunk.magic == LIST)); + } while ((chunk.magic == FACT) || (chunk.magic == LIST)); /* Decode the audio data format */ format = (WaveFMT *) chunk.data; @@ -564,8 +563,7 @@ SDL_LoadWAV_RW(SDL_RWops * src, int freesrc, *audio_buf = chunk.data; if (chunk.magic != DATA) headerDiff += lenread + 2 * sizeof(Uint32); - } - while (chunk.magic != DATA); + } while (chunk.magic != DATA); headerDiff += 2 * sizeof(Uint32); /* for the data chunk and len */ if (MS_ADPCM_encoded) { diff --git a/src/audio/bsd/SDL_bsdaudio.c b/src/audio/bsd/SDL_bsdaudio.c index b7f01f15b..a5ada0b8b 100644 --- a/src/audio/bsd/SDL_bsdaudio.c +++ b/src/audio/bsd/SDL_bsdaudio.c @@ -270,8 +270,7 @@ BSDAUDIO_PlayDevice(_THIS) || ((written < 0) && ((errno == 0) || (errno == EAGAIN)))) { SDL_Delay(1); /* Let a little CPU time go by */ } - } - while (p < written); + } while (p < written); /* If timer synchronization is enabled, set the next write frame */ if (this->hidden->frame_ticks) { diff --git a/src/audio/dma/SDL_dmaaudio.c b/src/audio/dma/SDL_dmaaudio.c index ab5d9c85a..c7d071292 100644 --- a/src/audio/dma/SDL_dmaaudio.c +++ b/src/audio/dma/SDL_dmaaudio.c @@ -498,8 +498,7 @@ DMA_GetDeviceBuf(_THIS) this->enabled = 0; return (NULL); } - } - while (frame_ticks && (info.blocks < 1)); + } while (frame_ticks && (info.blocks < 1)); #ifdef DEBUG_AUDIO if (info.blocks > 1) { printf("Warning: audio underflow (%d frags)\n", info.blocks - 1); diff --git a/src/audio/esd/SDL_esdaudio.c b/src/audio/esd/SDL_esdaudio.c index 8c4b1b491..e52f546d9 100644 --- a/src/audio/esd/SDL_esdaudio.c +++ b/src/audio/esd/SDL_esdaudio.c @@ -154,9 +154,8 @@ ESD_PlayDevice(_THIS) if ((written < 0) && ((errno == 0) || (errno == EAGAIN))) { SDL_Delay(1); /* Let a little CPU time go by */ } - } - while ((written < 0) && - ((errno == 0) || (errno == EAGAIN) || (errno == EINTR))); + } while ((written < 0) && + ((errno == 0) || (errno == EAGAIN) || (errno == EINTR))); /* Set the next write frame */ this->hidden->next_frame += this->hidden->frame_ticks; diff --git a/src/audio/nto/SDL_nto_audio.c b/src/audio/nto/SDL_nto_audio.c index 4459d196c..8b3bbcf42 100644 --- a/src/audio/nto/SDL_nto_audio.c +++ b/src/audio/nto/SDL_nto_audio.c @@ -154,8 +154,7 @@ NTO_WaitDevice(_THIS) } break; } - } - while (1); + } while (1); } static void @@ -213,8 +212,7 @@ NTO_PlayDevice(_THIS) towrite -= written; pcmbuffer += written * this->spec.channels; } - } - while ((towrite > 0) && (this->enabled)); + } while ((towrite > 0) && (this->enabled)); /* If we couldn't write, assume fatal error for now */ if (towrite != 0) { diff --git a/src/audio/paudio/SDL_paudio.c b/src/audio/paudio/SDL_paudio.c index 89d385831..2b04fcca4 100644 --- a/src/audio/paudio/SDL_paudio.c +++ b/src/audio/paudio/SDL_paudio.c @@ -208,9 +208,8 @@ PAUDIO_PlayDevice(_THIS) if ((written < 0) && ((errno == 0) || (errno == EAGAIN))) { SDL_Delay(1); /* Let a little CPU time go by */ } - } - while ((written < 0) && - ((errno == 0) || (errno == EAGAIN) || (errno == EINTR))); + } while ((written < 0) && + ((errno == 0) || (errno == EAGAIN) || (errno == EINTR))); /* If timer synchronization is enabled, set the next write frame */ if (this->hidden->frame_ticks) { diff --git a/src/audio/ums/SDL_umsaudio.c b/src/audio/ums/SDL_umsaudio.c index 3bdb414b5..eee2c3cbb 100644 --- a/src/audio/ums/SDL_umsaudio.c +++ b/src/audio/ums/SDL_umsaudio.c @@ -218,8 +218,7 @@ UMS_PlayAudio(_THIS) #endif return; } - } - while (samplesToWrite > 0); + } while (samplesToWrite > 0); SDL_LockAudio(); SDL_memcpy(&swpbuf, &this->hidden->playbuf, sizeof(UMSAudioTypes_Buffer)); @@ -326,8 +325,7 @@ UMS_OpenAudio(_THIS, SDL_AudioSpec * spec) if (!success) { test_format = SDL_NextAudioFormat(); } - } - while (!success && test_format); + } while (!success && test_format); if (success == 0) { SDL_SetError("Couldn't find any hardware audio formats"); diff --git a/src/audio/windib/SDL_dibaudio.c b/src/audio/windib/SDL_dibaudio.c index 7edf563fa..ade0eb96d 100644 --- a/src/audio/windib/SDL_dibaudio.c +++ b/src/audio/windib/SDL_dibaudio.c @@ -136,8 +136,7 @@ WINWAVEOUT_WaitDone(_THIS) if (left > 0) { SDL_Delay(100); } - } - while (left > 0); + } while (left > 0); } void diff --git a/src/cdrom/aix/SDL_syscdrom.c b/src/cdrom/aix/SDL_syscdrom.c index 95994adfd..31c4422da 100644 --- a/src/cdrom/aix/SDL_syscdrom.c +++ b/src/cdrom/aix/SDL_syscdrom.c @@ -181,8 +181,7 @@ CheckMounts() #endif return; } - } - while (ret == 0); + } while (ret == 0); #ifdef DEBUG_CDROM fprintf(stderr, "Read %d vmount structures\n", ret); @@ -211,8 +210,7 @@ CheckMounts() } ptr = (struct vmount *) ((char *) ptr + ptr->vmt_length); ret--; - } - while (ret > 0); + } while (ret > 0); free(buffer); } @@ -247,8 +245,7 @@ CheckNonmounts() } } } - } - while (ret == 0); + } while (ret == 0); ret = endfsent_r(&fsFile); if (ret != 0) return -1; @@ -275,8 +272,7 @@ CheckNonmounts() } } } - } - while (entry != NULL); + } while (entry != NULL); endfsent(); #endif } @@ -326,8 +322,7 @@ SDL_SYS_CDInit(void) } else { SDLcdrom = NULL; } - } - while (SDLcdrom); + } while (SDLcdrom); SDL_stack_free(cdpath); } diff --git a/src/cdrom/beos/SDL_syscdrom.cc b/src/cdrom/beos/SDL_syscdrom.cc index 3bca020b6..cecba2170 100644 --- a/src/cdrom/beos/SDL_syscdrom.cc +++ b/src/cdrom/beos/SDL_syscdrom.cc @@ -193,8 +193,7 @@ SDL_SYS_CDInit(void) } else { SDLcdrom = NULL; } - } - while (SDLcdrom); + } while (SDLcdrom); SDL_stack_free(cdpath); } diff --git a/src/cdrom/bsdi/SDL_syscdrom.c b/src/cdrom/bsdi/SDL_syscdrom.c index 719c12d5e..4426a195a 100644 --- a/src/cdrom/bsdi/SDL_syscdrom.c +++ b/src/cdrom/bsdi/SDL_syscdrom.c @@ -286,8 +286,7 @@ SDL_SYS_CDInit(void) } else { SDLcdrom = NULL; } - } - while (SDLcdrom); + } while (SDLcdrom); SDL_stack_free(cdpath); } diff --git a/src/cdrom/freebsd/SDL_syscdrom.c b/src/cdrom/freebsd/SDL_syscdrom.c index 21e239209..b01a95fd7 100644 --- a/src/cdrom/freebsd/SDL_syscdrom.c +++ b/src/cdrom/freebsd/SDL_syscdrom.c @@ -176,8 +176,7 @@ SDL_SYS_CDInit(void) } else { SDLcdrom = NULL; } - } - while (SDLcdrom); + } while (SDLcdrom); SDL_stack_free(cdpath); } diff --git a/src/cdrom/linux/SDL_syscdrom.c b/src/cdrom/linux/SDL_syscdrom.c index 324a16141..f54117ee0 100644 --- a/src/cdrom/linux/SDL_syscdrom.c +++ b/src/cdrom/linux/SDL_syscdrom.c @@ -312,8 +312,7 @@ SDL_SYS_CDInit(void) } else { SDLcdrom = NULL; } - } - while (SDLcdrom); + } while (SDLcdrom); SDL_stack_free(cdpath); } diff --git a/src/cdrom/macosx/AudioFilePlayer.c b/src/cdrom/macosx/AudioFilePlayer.c index 569baf4ea..1817ad3b4 100644 --- a/src/cdrom/macosx/AudioFilePlayer.c +++ b/src/cdrom/macosx/AudioFilePlayer.c @@ -311,8 +311,7 @@ AudioFilePlayer_OpenFile(AudioFilePlayer * afp, const FSRef * inRef, /* Skip the chunk data */ offset = chunk.ckSize; - } - while (chunk.ckID != 'SSND'); + } while (chunk.ckID != 'SSND'); /* Read the header of the SSND chunk. After this, we are positioned right at the start of the audio data. */ diff --git a/src/cdrom/macosx/CDPlayer.c b/src/cdrom/macosx/CDPlayer.c index 25d086238..df206d379 100644 --- a/src/cdrom/macosx/CDPlayer.c +++ b/src/cdrom/macosx/CDPlayer.c @@ -400,8 +400,7 @@ ListTrackFiles(FSVolumeRefNum theVolume, FSRef * trackFiles, int numTracks) } CFRelease(name); } - } - while (noErr == result); + } while (noErr == result); FSCloseIterator(iterator); } diff --git a/src/cdrom/openbsd/SDL_syscdrom.c b/src/cdrom/openbsd/SDL_syscdrom.c index ce0deb0be..620a89283 100644 --- a/src/cdrom/openbsd/SDL_syscdrom.c +++ b/src/cdrom/openbsd/SDL_syscdrom.c @@ -184,8 +184,7 @@ SDL_SYS_CDInit(void) } else { SDLcdrom = NULL; } - } - while (SDLcdrom); + } while (SDLcdrom); SDL_stack_free(cdpath); } diff --git a/src/cdrom/osf/SDL_syscdrom.c b/src/cdrom/osf/SDL_syscdrom.c index 5ee6e202e..47e8b4847 100644 --- a/src/cdrom/osf/SDL_syscdrom.c +++ b/src/cdrom/osf/SDL_syscdrom.c @@ -199,8 +199,7 @@ SDL_SYS_CDInit(void) } else { SDLcdrom = NULL; } - } - while (SDLcdrom); + } while (SDLcdrom); SDL_stack_free(cdpath); } diff --git a/src/cdrom/qnx/SDL_syscdrom.c b/src/cdrom/qnx/SDL_syscdrom.c index e9e7f3adc..d0127b0f3 100644 --- a/src/cdrom/qnx/SDL_syscdrom.c +++ b/src/cdrom/qnx/SDL_syscdrom.c @@ -184,8 +184,7 @@ SDL_SYS_CDInit(void) } else { SDLcdrom = NULL; } - } - while (SDLcdrom); + } while (SDLcdrom); SDL_stack_free(cdpath); } @@ -357,8 +356,7 @@ SDL_SYS_CDStatus(SDL_CD * cdrom, int *position) devctlret = ENXIO; break; } - } - while ((devctlret == EAGAIN) || (devctlret == ESTALE)); + } while ((devctlret == EAGAIN) || (devctlret == ESTALE)); if (devctlret != 0) { if (devctlret == ENXIO) { diff --git a/src/main/beos/SDL_BeApp.cc b/src/main/beos/SDL_BeApp.cc index 02df93e7b..005c91d2a 100644 --- a/src/main/beos/SDL_BeApp.cc +++ b/src/main/beos/SDL_BeApp.cc @@ -78,8 +78,7 @@ SDL_InitBeApp(void) do { SDL_Delay(10); - } - while ((be_app == NULL) || be_app->IsLaunching()); + } while ((be_app == NULL) || be_app->IsLaunching()); /* Mark the application active */ SDL_BeAppActive = 0; diff --git a/src/thread/SDL_thread_c.h b/src/thread/SDL_thread_c.h index 1276e9263..0e27c2fce 100644 --- a/src/thread/SDL_thread_c.h +++ b/src/thread/SDL_thread_c.h @@ -43,6 +43,8 @@ #include "irix/SDL_systhread_c.h" #elif SDL_THREAD_WIN32 #include "win32/SDL_systhread_c.h" +#elif SDL_THREAD_NDS +#include "nds/SDL_systhread_c.h" #else #error Need thread implementation for this platform #include "generic/SDL_systhread_c.h" diff --git a/src/thread/irix/SDL_syssem.c b/src/thread/irix/SDL_syssem.c index 00ed025a7..d7992ed50 100644 --- a/src/thread/irix/SDL_syssem.c +++ b/src/thread/irix/SDL_syssem.c @@ -170,8 +170,7 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) break; } SDL_Delay(1); - } - while (SDL_GetTicks() < timeout); + } while (SDL_GetTicks() < timeout); return retval; } diff --git a/src/thread/pthread/SDL_syssem.c b/src/thread/pthread/SDL_syssem.c index ba335e3f7..b97411cfd 100644 --- a/src/thread/pthread/SDL_syssem.c +++ b/src/thread/pthread/SDL_syssem.c @@ -125,8 +125,7 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) break; } SDL_Delay(1); - } - while (SDL_GetTicks() < timeout); + } while (SDL_GetTicks() < timeout); return retval; } diff --git a/src/thread/riscos/SDL_syssem.c b/src/thread/riscos/SDL_syssem.c index 23e8fb562..e8954b0c0 100644 --- a/src/thread/riscos/SDL_syssem.c +++ b/src/thread/riscos/SDL_syssem.c @@ -177,8 +177,7 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) break; } SDL_Delay(1); - } - while (SDL_GetTicks() < timeout); + } while (SDL_GetTicks() < timeout); return retval; } diff --git a/src/timer/riscos/SDL_systimer.c b/src/timer/riscos/SDL_systimer.c index 003f616a4..ff8eee197 100644 --- a/src/timer/riscos/SDL_systimer.c +++ b/src/timer/riscos/SDL_systimer.c @@ -130,8 +130,7 @@ SDL_Delay(Uint32 ms) pthread_yield(); #endif - } - while (1); + } while (1); } #if SDL_THREADS_DISABLED diff --git a/src/timer/unix/SDL_systimer.c b/src/timer/unix/SDL_systimer.c index 89b415739..5fffe1354 100644 --- a/src/timer/unix/SDL_systimer.c +++ b/src/timer/unix/SDL_systimer.c @@ -137,8 +137,7 @@ SDL_Delay(Uint32 ms) was_error = select(0, NULL, NULL, NULL, &tv); #endif /* HAVE_NANOSLEEP */ - } - while (was_error && (errno == EINTR)); + } while (was_error && (errno == EINTR)); #endif /* SDL_THREAD_PTH */ } diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c index 0998d3f93..6b55ce87f 100644 --- a/src/video/SDL_RLEaccel.c +++ b/src/video/SDL_RLEaccel.c @@ -1154,8 +1154,7 @@ SDL_RLEAlphaBlit(SDL_Surface * src, SDL_Rect * srcrect, ofs += run; } else if (!ofs) goto done; - } - while (ofs < w); + } while (ofs < w); /* skip padding */ srcbuf += (uintptr_t) srcbuf & 2; @@ -1168,10 +1167,8 @@ SDL_RLEAlphaBlit(SDL_Surface * src, SDL_Rect * srcrect, run = ((Uint16 *) srcbuf)[1]; srcbuf += 4 * (run + 1); ofs += run; - } - while (ofs < w); - } - while (--vskip); + } while (ofs < w); + } while (--vskip); } else { /* the 32/32 interleaved format */ vskip <<= 1; /* opaque and translucent have same format */ @@ -1187,10 +1184,8 @@ SDL_RLEAlphaBlit(SDL_Surface * src, SDL_Rect * srcrect, ofs += run; } else if (!ofs) goto done; - } - while (ofs < w); - } - while (--vskip); + } while (ofs < w); + } while (--vskip); } } } @@ -1567,8 +1562,7 @@ RLEAlphaSurface(SDL_Surface * surface) runstart += len; run -= len; } - } - while (x < w); + } while (x < w); /* Make sure the next output address is 32-bit aligned */ dst += (uintptr_t) dst & 2; @@ -1604,8 +1598,7 @@ RLEAlphaSurface(SDL_Surface * surface) } if (!blankline) lastline = dst; - } - while (x < w); + } while (x < w); src += surface->pitch >> 2; } @@ -1771,8 +1764,7 @@ RLEColorkeySurface(SDL_Surface * surface) } if (!blankline) lastline = dst; - } - while (x < w); + } while (x < w); srcbuf += surface->pitch; } @@ -1911,8 +1903,7 @@ UnRLEAlpha(SDL_Surface * surface) ofs += run; } else if (!ofs) return (SDL_TRUE); - } - while (ofs < w); + } while (ofs < w); /* skip padding if needed */ if (bpp == 2) @@ -1929,8 +1920,7 @@ UnRLEAlpha(SDL_Surface * surface) srcbuf += uncopy_transl(dst + ofs, srcbuf, run, df, sf); ofs += run; } - } - while (ofs < w); + } while (ofs < w); dst += surface->pitch >> 2; } /* Make the compiler happy */ diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index dd40449c7..4adb4b548 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -370,6 +370,9 @@ extern VideoBootStrap OS2FSLib_bootstrap; #if SDL_VIDEO_DRIVER_DUMMY extern VideoBootStrap DUMMY_bootstrap; #endif +#if SDL_VIDEO_DRIVER_NDS +extern VideoBootStrap NDS_bootstrap; +#endif #define SDL_CurrentDisplay (_this->displays[_this->current_display]) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 5a52f03b7..e4b7f232a 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -103,6 +103,9 @@ static VideoBootStrap *bootstrap[] = { #if SDL_VIDEO_DRIVER_OS2FS &OS2FSLib_bootstrap, #endif +#if SDL_VIDEO_DRIVER_NDS + &NDS_bootstrap, +#endif #if SDL_VIDEO_DRIVER_DUMMY &DUMMY_bootstrap, #endif diff --git a/src/video/fbcon/SDL_fbelo.c b/src/video/fbcon/SDL_fbelo.c index d85aebdb6..9f9f56110 100644 --- a/src/video/fbcon/SDL_fbelo.c +++ b/src/video/fbcon/SDL_fbelo.c @@ -268,8 +268,7 @@ eloWaitReply(unsigned char type, unsigned char *reply, int fd) if (result == 0) { i--; } - } - while (!ok && (i > 0)); + } while (!ok && (i > 0)); return ok; } diff --git a/src/video/fbcon/SDL_fbevents.c b/src/video/fbcon/SDL_fbevents.c index 2bf6ad452..0549d9b1a 100644 --- a/src/video/fbcon/SDL_fbevents.c +++ b/src/video/fbcon/SDL_fbevents.c @@ -545,9 +545,8 @@ detect_imps2(int fd) if (select(fd + 1, &fdset, 0, 0, &tv) < 1) { break; } - } - while ((read(fd, &ch, sizeof(ch)) == sizeof(ch)) && - ((ch == 0xFA) || (ch == 0xAA))); + } while ((read(fd, &ch, sizeof(ch)) == sizeof(ch)) && + ((ch == 0xFA) || (ch == 0xAA))); /* Experimental values (Logitech wheelmouse) */ #ifdef DEBUG_MOUSE @@ -1113,8 +1112,7 @@ FB_PumpEvents(_THIS) } } } - } - while (posted); + } while (posted); } void diff --git a/src/video/fbcon/SDL_fbvideo.c b/src/video/fbcon/SDL_fbvideo.c index 50b85762d..521d9f4fc 100644 --- a/src/video/fbcon/SDL_fbvideo.c +++ b/src/video/fbcon/SDL_fbvideo.c @@ -323,15 +323,13 @@ read_fbmodes_line(FILE * f, char *line, int length) blank = 1; else blank = 0; - } - while (blank); + } while (blank); /* remove whitespace at the begining of the string */ i = 0; do { line[i] = c[i]; i++; - } - while (c[i] != 0); + } while (c[i] != 0); return 1; } @@ -347,8 +345,7 @@ read_fbmodes_mode(FILE * f, struct fb_var_screeninfo *vinfo) return 0; if (SDL_strncmp(line, "geometry", 8) == 0) break; - } - while (1); + } while (1); SDL_sscanf(line, "geometry %d %d %d %d %d", &vinfo->xres, &vinfo->yres, &vinfo->xres_virtual, &vinfo->yres_virtual, @@ -394,8 +391,7 @@ read_fbmodes_mode(FILE * f, struct fb_var_screeninfo *vinfo) if (SDL_strncmp(option, "true", 4) == 0) vinfo->vmode |= FB_VMODE_DOUBLE; } - } - while (SDL_strncmp(line, "endmode", 7) != 0); + } while (SDL_strncmp(line, "endmode", 7) != 0); return 1; } diff --git a/src/video/ipod/SDL_ipodvideo.c b/src/video/ipod/SDL_ipodvideo.c index b338e6fc0..2442a36c0 100644 --- a/src/video/ipod/SDL_ipodvideo.c +++ b/src/video/ipod/SDL_ipodvideo.c @@ -526,8 +526,7 @@ iPod_PumpEvents(_THIS) } if (dbgout) fprintf(dbgout, "\n"); - } - while (posted); + } while (posted); } // enough space for 160x128x2 @@ -570,8 +569,7 @@ M_lcd_wait_write(void) do { if ((inl(lcd_base) & (unsigned int) 0x8000) == 0) break; - } - while (M_timer_check(start, 1000) == 0); + } while (M_timer_check(start, 1000) == 0); } } @@ -681,8 +679,7 @@ C_lcd_wait_write(void) do { if ((inl(0x70008A0C) & 0x80000000) == 0) break; - } - while (C_timer_check(start, 1000) == 0); + } while (C_timer_check(start, 1000) == 0); } } static void diff --git a/src/video/photon/SDL_phyuv.c b/src/video/photon/SDL_phyuv.c index a2b9962c4..32c7f612d 100644 --- a/src/video/photon/SDL_phyuv.c +++ b/src/video/photon/SDL_phyuv.c @@ -161,8 +161,7 @@ ph_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, break; } i++; - } - while (1); + } while (1); if (vidport == -1) { diff --git a/src/video/ps2gs/SDL_gsevents.c b/src/video/ps2gs/SDL_gsevents.c index c41274977..3156163f9 100644 --- a/src/video/ps2gs/SDL_gsevents.c +++ b/src/video/ps2gs/SDL_gsevents.c @@ -479,9 +479,8 @@ detect_imps2(int fd) if (select(fd + 1, &fdset, 0, 0, &tv) < 1) { break; } - } - while ((read(fd, &ch, sizeof(ch)) == sizeof(ch)) && - ((ch == 0xFA) || (ch == 0xAA))); + } while ((read(fd, &ch, sizeof(ch)) == sizeof(ch)) && + ((ch == 0xFA) || (ch == 0xAA))); /* Experimental values (Logitech wheelmouse) */ #ifdef DEBUG_MOUSE @@ -833,8 +832,7 @@ GS_PumpEvents(_THIS) } } } - } - while (posted); + } while (posted); } void diff --git a/src/video/svga/SDL_svgaevents.c b/src/video/svga/SDL_svgaevents.c index 84e8d7017..5d5c88856 100644 --- a/src/video/svga/SDL_svgaevents.c +++ b/src/video/svga/SDL_svgaevents.c @@ -207,8 +207,7 @@ SVGA_PumpEvents(_THIS) posted = 0; mouse_update(); keyboard_update(); - } - while (posted); + } while (posted); } void diff --git a/src/video/vgl/SDL_vglevents.c b/src/video/vgl/SDL_vglevents.c index 4520c4620..8f7a7f43b 100644 --- a/src/video/vgl/SDL_vglevents.c +++ b/src/video/vgl/SDL_vglevents.c @@ -141,8 +141,7 @@ VGL_PumpEvents(_THIS) posted = 0; handle_keyboard(this); handle_mouse(this); - } - while (posted != 0); + } while (posted != 0); } void diff --git a/src/video/wscons/SDL_wsconsevents.c b/src/video/wscons/SDL_wsconsevents.c index b68608ba8..ac1d34395 100644 --- a/src/video/wscons/SDL_wsconsevents.c +++ b/src/video/wscons/SDL_wsconsevents.c @@ -145,8 +145,7 @@ WSCONS_PumpEvents(_THIS) posted = 0; updateMouse(); updateKeyboard(this); - } - while (posted); + } while (posted); } void diff --git a/test/testblitspeed.c b/test/testblitspeed.c index f3f023e20..e365f3aba 100644 --- a/test/testblitspeed.c +++ b/test/testblitspeed.c @@ -397,8 +397,7 @@ test_blit_speed(void) } now = SDL_GetTicks(); - } - while (now < end); + } while (now < end); printf("Non-blitting crap accounted for %d percent of this run.\n", percent(testms - elasped, testms)); diff --git a/test/testdyngl.c b/test/testdyngl.c index e98ae4107..5e4275e33 100644 --- a/test/testdyngl.c +++ b/test/testdyngl.c @@ -185,8 +185,7 @@ main(int argc, char *argv[]) } SDL_Delay(20); - } - while (!done); + } while (!done); SDL_Quit(); return 0; diff --git a/test/testpalette.c b/test/testpalette.c index 921e6c46f..8fd84be03 100644 --- a/test/testpalette.c +++ b/test/testpalette.c @@ -338,8 +338,7 @@ main(int argc, char **argv) /* update changed areas of the screen */ SDL_UpdateRects(screen, NBOATS, updates); frames++; - } - while (fade_level > 0); + } while (fade_level > 0); printf("%d frames, %.2f fps\n", frames, 1000.0 * frames / (SDL_GetTicks() - start));