First commit. Added header configs for DS as well as a Makefile. Initial work on framebuffer video driver, currently not functioning as desired. gsoc2008_nds
authorDarren Alton <dalton@stevens.edu>
Tue, 10 Jun 2008 06:45:39 +0000
branchgsoc2008_nds
changeset 2669e27bdcc80744
parent 2668 bb3241de289e
child 2670 6e4669f4db49
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
include/SDL_platform.h
include/SDL_stdinc.h
src/audio/SDL_wave.c
src/audio/bsd/SDL_bsdaudio.c
src/audio/dma/SDL_dmaaudio.c
src/audio/esd/SDL_esdaudio.c
src/audio/nto/SDL_nto_audio.c
src/audio/paudio/SDL_paudio.c
src/audio/ums/SDL_umsaudio.c
src/audio/windib/SDL_dibaudio.c
src/cdrom/aix/SDL_syscdrom.c
src/cdrom/beos/SDL_syscdrom.cc
src/cdrom/bsdi/SDL_syscdrom.c
src/cdrom/freebsd/SDL_syscdrom.c
src/cdrom/linux/SDL_syscdrom.c
src/cdrom/macosx/AudioFilePlayer.c
src/cdrom/macosx/CDPlayer.c
src/cdrom/openbsd/SDL_syscdrom.c
src/cdrom/osf/SDL_syscdrom.c
src/cdrom/qnx/SDL_syscdrom.c
src/main/beos/SDL_BeApp.cc
src/thread/SDL_thread_c.h
src/thread/irix/SDL_syssem.c
src/thread/pthread/SDL_syssem.c
src/thread/riscos/SDL_syssem.c
src/timer/riscos/SDL_systimer.c
src/timer/unix/SDL_systimer.c
src/video/SDL_RLEaccel.c
src/video/SDL_sysvideo.h
src/video/SDL_video.c
src/video/fbcon/SDL_fbelo.c
src/video/fbcon/SDL_fbevents.c
src/video/fbcon/SDL_fbvideo.c
src/video/ipod/SDL_ipodvideo.c
src/video/photon/SDL_phyuv.c
src/video/ps2gs/SDL_gsevents.c
src/video/svga/SDL_svgaevents.c
src/video/vgl/SDL_vglevents.c
src/video/wscons/SDL_wsconsevents.c
test/testblitspeed.c
test/testdyngl.c
test/testpalette.c
     1.1 --- a/include/SDL_config.h.default	Wed Apr 23 06:27:10 2008 +0000
     1.2 +++ b/include/SDL_config.h.default	Tue Jun 10 06:45:39 2008 +0000
     1.3 @@ -26,7 +26,9 @@
     1.4  #include "SDL_platform.h"
     1.5  
     1.6  /* Add any platform that doesn't build using the configure system */
     1.7 -#if defined(__DREAMCAST__)
     1.8 +#if defined(__NINTENDODS__)
     1.9 +#include "SDL_config_nintendods.h"
    1.10 +#elif defined(__DREAMCAST__)
    1.11  #include "SDL_config_dreamcast.h"
    1.12  #elif defined(__MACOSX__)
    1.13  #include "SDL_config_macosx.h"
     2.1 --- a/include/SDL_platform.h	Wed Apr 23 06:27:10 2008 +0000
     2.2 +++ b/include/SDL_platform.h	Tue Jun 10 06:45:39 2008 +0000
     2.3 @@ -97,4 +97,9 @@
     2.4  #define __WIN32__	1
     2.5  #endif
     2.6  
     2.7 +#if defined(__NDS__)
     2.8 +#undef __NINTENDODS__
     2.9 +#define __NINTENDODS__	1
    2.10 +#endif
    2.11 +
    2.12  #endif /* _SDL_platform_h */
     3.1 --- a/include/SDL_stdinc.h	Wed Apr 23 06:27:10 2008 +0000
     3.2 +++ b/include/SDL_stdinc.h	Tue Jun 10 06:45:39 2008 +0000
     3.3 @@ -147,8 +147,12 @@
     3.4  SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
     3.5  SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
     3.6  SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
     3.7 +#ifndef __NINTENDODS__ /* TODO: figure out why the following happens:
     3.8 +include/SDL_stdinc.h:150: error: size of array 'SDL_dummy_uint64' is negative
     3.9 +include/SDL_stdinc.h:151: error: size of array 'SDL_dummy_sint64' is negative */
    3.10  SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
    3.11  SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
    3.12 +#endif
    3.13  #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
    3.14  
    3.15  /* Check to make sure enums are the size of ints, for structure packing.
    3.16 @@ -162,12 +166,14 @@
    3.17  #endif
    3.18  
    3.19  #ifndef DOXYGEN_SHOULD_IGNORE_THIS
    3.20 +#ifndef __NINTENDODS__  /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
    3.21  typedef enum
    3.22  {
    3.23      DUMMY_ENUM_VALUE
    3.24  } SDL_DUMMY_ENUM;
    3.25  
    3.26  SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
    3.27 +#endif
    3.28  #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
    3.29  
    3.30  #include "begin_code.h"
    3.31 @@ -425,6 +431,9 @@
    3.32  #ifdef HAVE_WCSLEN
    3.33  #define SDL_wcslen      wcslen
    3.34  #else
    3.35 +#if !defined(wchar_t) && defined(__NINTENDODS__)
    3.36 +#define wchar_t short /* TODO: figure out why libnds doesn't have this */
    3.37 +#endif
    3.38  extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t * string);
    3.39  #endif
    3.40  
     4.1 --- a/src/audio/SDL_wave.c	Wed Apr 23 06:27:10 2008 +0000
     4.2 +++ b/src/audio/SDL_wave.c	Tue Jun 10 06:45:39 2008 +0000
     4.3 @@ -462,8 +462,7 @@
     4.4          }
     4.5          /* 2 Uint32's for chunk header+len, plus the lenread */
     4.6          headerDiff += lenread + 2 * sizeof(Uint32);
     4.7 -    }
     4.8 -    while ((chunk.magic == FACT) || (chunk.magic == LIST));
     4.9 +    } while ((chunk.magic == FACT) || (chunk.magic == LIST));
    4.10  
    4.11      /* Decode the audio data format */
    4.12      format = (WaveFMT *) chunk.data;
    4.13 @@ -564,8 +563,7 @@
    4.14          *audio_buf = chunk.data;
    4.15          if (chunk.magic != DATA)
    4.16              headerDiff += lenread + 2 * sizeof(Uint32);
    4.17 -    }
    4.18 -    while (chunk.magic != DATA);
    4.19 +    } while (chunk.magic != DATA);
    4.20      headerDiff += 2 * sizeof(Uint32);   /* for the data chunk and len */
    4.21  
    4.22      if (MS_ADPCM_encoded) {
     5.1 --- a/src/audio/bsd/SDL_bsdaudio.c	Wed Apr 23 06:27:10 2008 +0000
     5.2 +++ b/src/audio/bsd/SDL_bsdaudio.c	Tue Jun 10 06:45:39 2008 +0000
     5.3 @@ -270,8 +270,7 @@
     5.4              || ((written < 0) && ((errno == 0) || (errno == EAGAIN)))) {
     5.5              SDL_Delay(1);       /* Let a little CPU time go by */
     5.6          }
     5.7 -    }
     5.8 -    while (p < written);
     5.9 +    } while (p < written);
    5.10  
    5.11      /* If timer synchronization is enabled, set the next write frame */
    5.12      if (this->hidden->frame_ticks) {
     6.1 --- a/src/audio/dma/SDL_dmaaudio.c	Wed Apr 23 06:27:10 2008 +0000
     6.2 +++ b/src/audio/dma/SDL_dmaaudio.c	Tue Jun 10 06:45:39 2008 +0000
     6.3 @@ -498,8 +498,7 @@
     6.4              this->enabled = 0;
     6.5              return (NULL);
     6.6          }
     6.7 -    }
     6.8 -    while (frame_ticks && (info.blocks < 1));
     6.9 +    } while (frame_ticks && (info.blocks < 1));
    6.10  #ifdef DEBUG_AUDIO
    6.11      if (info.blocks > 1) {
    6.12          printf("Warning: audio underflow (%d frags)\n", info.blocks - 1);
     7.1 --- a/src/audio/esd/SDL_esdaudio.c	Wed Apr 23 06:27:10 2008 +0000
     7.2 +++ b/src/audio/esd/SDL_esdaudio.c	Tue Jun 10 06:45:39 2008 +0000
     7.3 @@ -154,9 +154,8 @@
     7.4          if ((written < 0) && ((errno == 0) || (errno == EAGAIN))) {
     7.5              SDL_Delay(1);       /* Let a little CPU time go by */
     7.6          }
     7.7 -    }
     7.8 -    while ((written < 0) &&
     7.9 -           ((errno == 0) || (errno == EAGAIN) || (errno == EINTR)));
    7.10 +    } while ((written < 0) &&
    7.11 +             ((errno == 0) || (errno == EAGAIN) || (errno == EINTR)));
    7.12  
    7.13      /* Set the next write frame */
    7.14      this->hidden->next_frame += this->hidden->frame_ticks;
     8.1 --- a/src/audio/nto/SDL_nto_audio.c	Wed Apr 23 06:27:10 2008 +0000
     8.2 +++ b/src/audio/nto/SDL_nto_audio.c	Tue Jun 10 06:45:39 2008 +0000
     8.3 @@ -154,8 +154,7 @@
     8.4              }
     8.5              break;
     8.6          }
     8.7 -    }
     8.8 -    while (1);
     8.9 +    } while (1);
    8.10  }
    8.11  
    8.12  static void
    8.13 @@ -213,8 +212,7 @@
    8.14              towrite -= written;
    8.15              pcmbuffer += written * this->spec.channels;
    8.16          }
    8.17 -    }
    8.18 -    while ((towrite > 0) && (this->enabled));
    8.19 +    } while ((towrite > 0) && (this->enabled));
    8.20  
    8.21      /* If we couldn't write, assume fatal error for now */
    8.22      if (towrite != 0) {
     9.1 --- a/src/audio/paudio/SDL_paudio.c	Wed Apr 23 06:27:10 2008 +0000
     9.2 +++ b/src/audio/paudio/SDL_paudio.c	Tue Jun 10 06:45:39 2008 +0000
     9.3 @@ -208,9 +208,8 @@
     9.4          if ((written < 0) && ((errno == 0) || (errno == EAGAIN))) {
     9.5              SDL_Delay(1);       /* Let a little CPU time go by */
     9.6          }
     9.7 -    }
     9.8 -    while ((written < 0) &&
     9.9 -           ((errno == 0) || (errno == EAGAIN) || (errno == EINTR)));
    9.10 +    } while ((written < 0) &&
    9.11 +             ((errno == 0) || (errno == EAGAIN) || (errno == EINTR)));
    9.12  
    9.13      /* If timer synchronization is enabled, set the next write frame */
    9.14      if (this->hidden->frame_ticks) {
    10.1 --- a/src/audio/ums/SDL_umsaudio.c	Wed Apr 23 06:27:10 2008 +0000
    10.2 +++ b/src/audio/ums/SDL_umsaudio.c	Tue Jun 10 06:45:39 2008 +0000
    10.3 @@ -218,8 +218,7 @@
    10.4  #endif
    10.5              return;
    10.6          }
    10.7 -    }
    10.8 -    while (samplesToWrite > 0);
    10.9 +    } while (samplesToWrite > 0);
   10.10  
   10.11      SDL_LockAudio();
   10.12      SDL_memcpy(&swpbuf, &this->hidden->playbuf, sizeof(UMSAudioTypes_Buffer));
   10.13 @@ -326,8 +325,7 @@
   10.14          if (!success) {
   10.15              test_format = SDL_NextAudioFormat();
   10.16          }
   10.17 -    }
   10.18 -    while (!success && test_format);
   10.19 +    } while (!success && test_format);
   10.20  
   10.21      if (success == 0) {
   10.22          SDL_SetError("Couldn't find any hardware audio formats");
    11.1 --- a/src/audio/windib/SDL_dibaudio.c	Wed Apr 23 06:27:10 2008 +0000
    11.2 +++ b/src/audio/windib/SDL_dibaudio.c	Tue Jun 10 06:45:39 2008 +0000
    11.3 @@ -136,8 +136,7 @@
    11.4          if (left > 0) {
    11.5              SDL_Delay(100);
    11.6          }
    11.7 -    }
    11.8 -    while (left > 0);
    11.9 +    } while (left > 0);
   11.10  }
   11.11  
   11.12  void
    12.1 --- a/src/cdrom/aix/SDL_syscdrom.c	Wed Apr 23 06:27:10 2008 +0000
    12.2 +++ b/src/cdrom/aix/SDL_syscdrom.c	Tue Jun 10 06:45:39 2008 +0000
    12.3 @@ -181,8 +181,7 @@
    12.4  #endif
    12.5              return;
    12.6          }
    12.7 -    }
    12.8 -    while (ret == 0);
    12.9 +    } while (ret == 0);
   12.10  
   12.11  #ifdef DEBUG_CDROM
   12.12      fprintf(stderr, "Read %d vmount structures\n", ret);
   12.13 @@ -211,8 +210,7 @@
   12.14          }
   12.15          ptr = (struct vmount *) ((char *) ptr + ptr->vmt_length);
   12.16          ret--;
   12.17 -    }
   12.18 -    while (ret > 0);
   12.19 +    } while (ret > 0);
   12.20  
   12.21      free(buffer);
   12.22  }
   12.23 @@ -247,8 +245,7 @@
   12.24                  }
   12.25              }
   12.26          }
   12.27 -    }
   12.28 -    while (ret == 0);
   12.29 +    } while (ret == 0);
   12.30      ret = endfsent_r(&fsFile);
   12.31      if (ret != 0)
   12.32          return -1;
   12.33 @@ -275,8 +272,7 @@
   12.34                  }
   12.35              }
   12.36          }
   12.37 -    }
   12.38 -    while (entry != NULL);
   12.39 +    } while (entry != NULL);
   12.40      endfsent();
   12.41  #endif
   12.42  }
   12.43 @@ -326,8 +322,7 @@
   12.44                  } else {
   12.45                      SDLcdrom = NULL;
   12.46                  }
   12.47 -            }
   12.48 -            while (SDLcdrom);
   12.49 +            } while (SDLcdrom);
   12.50              SDL_stack_free(cdpath);
   12.51          }
   12.52  
    13.1 --- a/src/cdrom/beos/SDL_syscdrom.cc	Wed Apr 23 06:27:10 2008 +0000
    13.2 +++ b/src/cdrom/beos/SDL_syscdrom.cc	Tue Jun 10 06:45:39 2008 +0000
    13.3 @@ -193,8 +193,7 @@
    13.4                  } else {
    13.5                      SDLcdrom = NULL;
    13.6                  }
    13.7 -            }
    13.8 -            while (SDLcdrom);
    13.9 +            } while (SDLcdrom);
   13.10              SDL_stack_free(cdpath);
   13.11          }
   13.12  
    14.1 --- a/src/cdrom/bsdi/SDL_syscdrom.c	Wed Apr 23 06:27:10 2008 +0000
    14.2 +++ b/src/cdrom/bsdi/SDL_syscdrom.c	Tue Jun 10 06:45:39 2008 +0000
    14.3 @@ -286,8 +286,7 @@
    14.4                  } else {
    14.5                      SDLcdrom = NULL;
    14.6                  }
    14.7 -            }
    14.8 -            while (SDLcdrom);
    14.9 +            } while (SDLcdrom);
   14.10              SDL_stack_free(cdpath);
   14.11          }
   14.12  
    15.1 --- a/src/cdrom/freebsd/SDL_syscdrom.c	Wed Apr 23 06:27:10 2008 +0000
    15.2 +++ b/src/cdrom/freebsd/SDL_syscdrom.c	Tue Jun 10 06:45:39 2008 +0000
    15.3 @@ -176,8 +176,7 @@
    15.4                  } else {
    15.5                      SDLcdrom = NULL;
    15.6                  }
    15.7 -            }
    15.8 -            while (SDLcdrom);
    15.9 +            } while (SDLcdrom);
   15.10              SDL_stack_free(cdpath);
   15.11          }
   15.12  
    16.1 --- a/src/cdrom/linux/SDL_syscdrom.c	Wed Apr 23 06:27:10 2008 +0000
    16.2 +++ b/src/cdrom/linux/SDL_syscdrom.c	Tue Jun 10 06:45:39 2008 +0000
    16.3 @@ -312,8 +312,7 @@
    16.4                  } else {
    16.5                      SDLcdrom = NULL;
    16.6                  }
    16.7 -            }
    16.8 -            while (SDLcdrom);
    16.9 +            } while (SDLcdrom);
   16.10              SDL_stack_free(cdpath);
   16.11          }
   16.12  
    17.1 --- a/src/cdrom/macosx/AudioFilePlayer.c	Wed Apr 23 06:27:10 2008 +0000
    17.2 +++ b/src/cdrom/macosx/AudioFilePlayer.c	Tue Jun 10 06:45:39 2008 +0000
    17.3 @@ -311,8 +311,7 @@
    17.4  
    17.5          /* Skip the chunk data */
    17.6          offset = chunk.ckSize;
    17.7 -    }
    17.8 -    while (chunk.ckID != 'SSND');
    17.9 +    } while (chunk.ckID != 'SSND');
   17.10  
   17.11      /* Read the header of the SSND chunk. After this, we are positioned right
   17.12         at the start of the audio data. */
    18.1 --- a/src/cdrom/macosx/CDPlayer.c	Wed Apr 23 06:27:10 2008 +0000
    18.2 +++ b/src/cdrom/macosx/CDPlayer.c	Tue Jun 10 06:45:39 2008 +0000
    18.3 @@ -400,8 +400,7 @@
    18.4                  }
    18.5                  CFRelease(name);
    18.6              }
    18.7 -        }
    18.8 -        while (noErr == result);
    18.9 +        } while (noErr == result);
   18.10          FSCloseIterator(iterator);
   18.11      }
   18.12  
    19.1 --- a/src/cdrom/openbsd/SDL_syscdrom.c	Wed Apr 23 06:27:10 2008 +0000
    19.2 +++ b/src/cdrom/openbsd/SDL_syscdrom.c	Tue Jun 10 06:45:39 2008 +0000
    19.3 @@ -184,8 +184,7 @@
    19.4                  } else {
    19.5                      SDLcdrom = NULL;
    19.6                  }
    19.7 -            }
    19.8 -            while (SDLcdrom);
    19.9 +            } while (SDLcdrom);
   19.10              SDL_stack_free(cdpath);
   19.11          }
   19.12  
    20.1 --- a/src/cdrom/osf/SDL_syscdrom.c	Wed Apr 23 06:27:10 2008 +0000
    20.2 +++ b/src/cdrom/osf/SDL_syscdrom.c	Tue Jun 10 06:45:39 2008 +0000
    20.3 @@ -199,8 +199,7 @@
    20.4                  } else {
    20.5                      SDLcdrom = NULL;
    20.6                  }
    20.7 -            }
    20.8 -            while (SDLcdrom);
    20.9 +            } while (SDLcdrom);
   20.10              SDL_stack_free(cdpath);
   20.11          }
   20.12  
    21.1 --- a/src/cdrom/qnx/SDL_syscdrom.c	Wed Apr 23 06:27:10 2008 +0000
    21.2 +++ b/src/cdrom/qnx/SDL_syscdrom.c	Tue Jun 10 06:45:39 2008 +0000
    21.3 @@ -184,8 +184,7 @@
    21.4                  } else {
    21.5                      SDLcdrom = NULL;
    21.6                  }
    21.7 -            }
    21.8 -            while (SDLcdrom);
    21.9 +            } while (SDLcdrom);
   21.10              SDL_stack_free(cdpath);
   21.11          }
   21.12  
   21.13 @@ -357,8 +356,7 @@
   21.14              devctlret = ENXIO;
   21.15              break;
   21.16          }
   21.17 -    }
   21.18 -    while ((devctlret == EAGAIN) || (devctlret == ESTALE));
   21.19 +    } while ((devctlret == EAGAIN) || (devctlret == ESTALE));
   21.20  
   21.21      if (devctlret != 0) {
   21.22          if (devctlret == ENXIO) {
    22.1 --- a/src/main/beos/SDL_BeApp.cc	Wed Apr 23 06:27:10 2008 +0000
    22.2 +++ b/src/main/beos/SDL_BeApp.cc	Tue Jun 10 06:45:39 2008 +0000
    22.3 @@ -78,8 +78,7 @@
    22.4  
    22.5          do {
    22.6              SDL_Delay(10);
    22.7 -        }
    22.8 -        while ((be_app == NULL) || be_app->IsLaunching());
    22.9 +        } while ((be_app == NULL) || be_app->IsLaunching());
   22.10  
   22.11          /* Mark the application active */
   22.12          SDL_BeAppActive = 0;
    23.1 --- a/src/thread/SDL_thread_c.h	Wed Apr 23 06:27:10 2008 +0000
    23.2 +++ b/src/thread/SDL_thread_c.h	Tue Jun 10 06:45:39 2008 +0000
    23.3 @@ -43,6 +43,8 @@
    23.4  #include "irix/SDL_systhread_c.h"
    23.5  #elif SDL_THREAD_WIN32
    23.6  #include "win32/SDL_systhread_c.h"
    23.7 +#elif SDL_THREAD_NDS
    23.8 +#include "nds/SDL_systhread_c.h"
    23.9  #else
   23.10  #error Need thread implementation for this platform
   23.11  #include "generic/SDL_systhread_c.h"
    24.1 --- a/src/thread/irix/SDL_syssem.c	Wed Apr 23 06:27:10 2008 +0000
    24.2 +++ b/src/thread/irix/SDL_syssem.c	Tue Jun 10 06:45:39 2008 +0000
    24.3 @@ -170,8 +170,7 @@
    24.4              break;
    24.5          }
    24.6          SDL_Delay(1);
    24.7 -    }
    24.8 -    while (SDL_GetTicks() < timeout);
    24.9 +    } while (SDL_GetTicks() < timeout);
   24.10  
   24.11      return retval;
   24.12  }
    25.1 --- a/src/thread/pthread/SDL_syssem.c	Wed Apr 23 06:27:10 2008 +0000
    25.2 +++ b/src/thread/pthread/SDL_syssem.c	Tue Jun 10 06:45:39 2008 +0000
    25.3 @@ -125,8 +125,7 @@
    25.4              break;
    25.5          }
    25.6          SDL_Delay(1);
    25.7 -    }
    25.8 -    while (SDL_GetTicks() < timeout);
    25.9 +    } while (SDL_GetTicks() < timeout);
   25.10  
   25.11      return retval;
   25.12  }
    26.1 --- a/src/thread/riscos/SDL_syssem.c	Wed Apr 23 06:27:10 2008 +0000
    26.2 +++ b/src/thread/riscos/SDL_syssem.c	Tue Jun 10 06:45:39 2008 +0000
    26.3 @@ -177,8 +177,7 @@
    26.4              break;
    26.5          }
    26.6          SDL_Delay(1);
    26.7 -    }
    26.8 -    while (SDL_GetTicks() < timeout);
    26.9 +    } while (SDL_GetTicks() < timeout);
   26.10  
   26.11      return retval;
   26.12  }
    27.1 --- a/src/timer/riscos/SDL_systimer.c	Wed Apr 23 06:27:10 2008 +0000
    27.2 +++ b/src/timer/riscos/SDL_systimer.c	Tue Jun 10 06:45:39 2008 +0000
    27.3 @@ -130,8 +130,7 @@
    27.4              pthread_yield();
    27.5  #endif
    27.6  
    27.7 -    }
    27.8 -    while (1);
    27.9 +    } while (1);
   27.10  }
   27.11  
   27.12  #if SDL_THREADS_DISABLED
    28.1 --- a/src/timer/unix/SDL_systimer.c	Wed Apr 23 06:27:10 2008 +0000
    28.2 +++ b/src/timer/unix/SDL_systimer.c	Tue Jun 10 06:45:39 2008 +0000
    28.3 @@ -137,8 +137,7 @@
    28.4  
    28.5          was_error = select(0, NULL, NULL, NULL, &tv);
    28.6  #endif /* HAVE_NANOSLEEP */
    28.7 -    }
    28.8 -    while (was_error && (errno == EINTR));
    28.9 +    } while (was_error && (errno == EINTR));
   28.10  #endif /* SDL_THREAD_PTH */
   28.11  }
   28.12  
    29.1 --- a/src/video/SDL_RLEaccel.c	Wed Apr 23 06:27:10 2008 +0000
    29.2 +++ b/src/video/SDL_RLEaccel.c	Tue Jun 10 06:45:39 2008 +0000
    29.3 @@ -1154,8 +1154,7 @@
    29.4                              ofs += run;
    29.5                          } else if (!ofs)
    29.6                              goto done;
    29.7 -                    }
    29.8 -                    while (ofs < w);
    29.9 +                    } while (ofs < w);
   29.10  
   29.11                      /* skip padding */
   29.12                      srcbuf += (uintptr_t) srcbuf & 2;
   29.13 @@ -1168,10 +1167,8 @@
   29.14                          run = ((Uint16 *) srcbuf)[1];
   29.15                          srcbuf += 4 * (run + 1);
   29.16                          ofs += run;
   29.17 -                    }
   29.18 -                    while (ofs < w);
   29.19 -                }
   29.20 -                while (--vskip);
   29.21 +                    } while (ofs < w);
   29.22 +                } while (--vskip);
   29.23              } else {
   29.24                  /* the 32/32 interleaved format */
   29.25                  vskip <<= 1;    /* opaque and translucent have same format */
   29.26 @@ -1187,10 +1184,8 @@
   29.27                              ofs += run;
   29.28                          } else if (!ofs)
   29.29                              goto done;
   29.30 -                    }
   29.31 -                    while (ofs < w);
   29.32 -                }
   29.33 -                while (--vskip);
   29.34 +                    } while (ofs < w);
   29.35 +                } while (--vskip);
   29.36              }
   29.37          }
   29.38      }
   29.39 @@ -1567,8 +1562,7 @@
   29.40                      runstart += len;
   29.41                      run -= len;
   29.42                  }
   29.43 -            }
   29.44 -            while (x < w);
   29.45 +            } while (x < w);
   29.46  
   29.47              /* Make sure the next output address is 32-bit aligned */
   29.48              dst += (uintptr_t) dst & 2;
   29.49 @@ -1604,8 +1598,7 @@
   29.50                  }
   29.51                  if (!blankline)
   29.52                      lastline = dst;
   29.53 -            }
   29.54 -            while (x < w);
   29.55 +            } while (x < w);
   29.56  
   29.57              src += surface->pitch >> 2;
   29.58          }
   29.59 @@ -1771,8 +1764,7 @@
   29.60              }
   29.61              if (!blankline)
   29.62                  lastline = dst;
   29.63 -        }
   29.64 -        while (x < w);
   29.65 +        } while (x < w);
   29.66  
   29.67          srcbuf += surface->pitch;
   29.68      }
   29.69 @@ -1911,8 +1903,7 @@
   29.70                  ofs += run;
   29.71              } else if (!ofs)
   29.72                  return (SDL_TRUE);
   29.73 -        }
   29.74 -        while (ofs < w);
   29.75 +        } while (ofs < w);
   29.76  
   29.77          /* skip padding if needed */
   29.78          if (bpp == 2)
   29.79 @@ -1929,8 +1920,7 @@
   29.80                  srcbuf += uncopy_transl(dst + ofs, srcbuf, run, df, sf);
   29.81                  ofs += run;
   29.82              }
   29.83 -        }
   29.84 -        while (ofs < w);
   29.85 +        } while (ofs < w);
   29.86          dst += surface->pitch >> 2;
   29.87      }
   29.88      /* Make the compiler happy */
    30.1 --- a/src/video/SDL_sysvideo.h	Wed Apr 23 06:27:10 2008 +0000
    30.2 +++ b/src/video/SDL_sysvideo.h	Tue Jun 10 06:45:39 2008 +0000
    30.3 @@ -370,6 +370,9 @@
    30.4  #if SDL_VIDEO_DRIVER_DUMMY
    30.5  extern VideoBootStrap DUMMY_bootstrap;
    30.6  #endif
    30.7 +#if SDL_VIDEO_DRIVER_NDS
    30.8 +extern VideoBootStrap NDS_bootstrap;
    30.9 +#endif
   30.10  
   30.11  #define SDL_CurrentDisplay	(_this->displays[_this->current_display])
   30.12  
    31.1 --- a/src/video/SDL_video.c	Wed Apr 23 06:27:10 2008 +0000
    31.2 +++ b/src/video/SDL_video.c	Tue Jun 10 06:45:39 2008 +0000
    31.3 @@ -103,6 +103,9 @@
    31.4  #if SDL_VIDEO_DRIVER_OS2FS
    31.5      &OS2FSLib_bootstrap,
    31.6  #endif
    31.7 +#if SDL_VIDEO_DRIVER_NDS
    31.8 +    &NDS_bootstrap,
    31.9 +#endif
   31.10  #if SDL_VIDEO_DRIVER_DUMMY
   31.11      &DUMMY_bootstrap,
   31.12  #endif
    32.1 --- a/src/video/fbcon/SDL_fbelo.c	Wed Apr 23 06:27:10 2008 +0000
    32.2 +++ b/src/video/fbcon/SDL_fbelo.c	Tue Jun 10 06:45:39 2008 +0000
    32.3 @@ -268,8 +268,7 @@
    32.4          if (result == 0) {
    32.5              i--;
    32.6          }
    32.7 -    }
    32.8 -    while (!ok && (i > 0));
    32.9 +    } while (!ok && (i > 0));
   32.10  
   32.11      return ok;
   32.12  }
    33.1 --- a/src/video/fbcon/SDL_fbevents.c	Wed Apr 23 06:27:10 2008 +0000
    33.2 +++ b/src/video/fbcon/SDL_fbevents.c	Tue Jun 10 06:45:39 2008 +0000
    33.3 @@ -545,9 +545,8 @@
    33.4                  if (select(fd + 1, &fdset, 0, 0, &tv) < 1) {
    33.5                      break;
    33.6                  }
    33.7 -            }
    33.8 -            while ((read(fd, &ch, sizeof(ch)) == sizeof(ch)) &&
    33.9 -                   ((ch == 0xFA) || (ch == 0xAA)));
   33.10 +            } while ((read(fd, &ch, sizeof(ch)) == sizeof(ch)) &&
   33.11 +                     ((ch == 0xFA) || (ch == 0xAA)));
   33.12  
   33.13              /* Experimental values (Logitech wheelmouse) */
   33.14  #ifdef DEBUG_MOUSE
   33.15 @@ -1113,8 +1112,7 @@
   33.16                  }
   33.17              }
   33.18          }
   33.19 -    }
   33.20 -    while (posted);
   33.21 +    } while (posted);
   33.22  }
   33.23  
   33.24  void
    34.1 --- a/src/video/fbcon/SDL_fbvideo.c	Wed Apr 23 06:27:10 2008 +0000
    34.2 +++ b/src/video/fbcon/SDL_fbvideo.c	Tue Jun 10 06:45:39 2008 +0000
    34.3 @@ -323,15 +323,13 @@
    34.4              blank = 1;
    34.5          else
    34.6              blank = 0;
    34.7 -    }
    34.8 -    while (blank);
    34.9 +    } while (blank);
   34.10      /* remove whitespace at the begining of the string */
   34.11      i = 0;
   34.12      do {
   34.13          line[i] = c[i];
   34.14          i++;
   34.15 -    }
   34.16 -    while (c[i] != 0);
   34.17 +    } while (c[i] != 0);
   34.18      return 1;
   34.19  }
   34.20  
   34.21 @@ -347,8 +345,7 @@
   34.22              return 0;
   34.23          if (SDL_strncmp(line, "geometry", 8) == 0)
   34.24              break;
   34.25 -    }
   34.26 -    while (1);
   34.27 +    } while (1);
   34.28  
   34.29      SDL_sscanf(line, "geometry %d %d %d %d %d", &vinfo->xres, &vinfo->yres,
   34.30                 &vinfo->xres_virtual, &vinfo->yres_virtual,
   34.31 @@ -394,8 +391,7 @@
   34.32              if (SDL_strncmp(option, "true", 4) == 0)
   34.33                  vinfo->vmode |= FB_VMODE_DOUBLE;
   34.34          }
   34.35 -    }
   34.36 -    while (SDL_strncmp(line, "endmode", 7) != 0);
   34.37 +    } while (SDL_strncmp(line, "endmode", 7) != 0);
   34.38  
   34.39      return 1;
   34.40  }
    35.1 --- a/src/video/ipod/SDL_ipodvideo.c	Wed Apr 23 06:27:10 2008 +0000
    35.2 +++ b/src/video/ipod/SDL_ipodvideo.c	Tue Jun 10 06:45:39 2008 +0000
    35.3 @@ -526,8 +526,7 @@
    35.4          }
    35.5          if (dbgout)
    35.6              fprintf(dbgout, "\n");
    35.7 -    }
    35.8 -    while (posted);
    35.9 +    } while (posted);
   35.10  }
   35.11  
   35.12  // enough space for 160x128x2
   35.13 @@ -570,8 +569,7 @@
   35.14          do {
   35.15              if ((inl(lcd_base) & (unsigned int) 0x8000) == 0)
   35.16                  break;
   35.17 -        }
   35.18 -        while (M_timer_check(start, 1000) == 0);
   35.19 +        } while (M_timer_check(start, 1000) == 0);
   35.20      }
   35.21  }
   35.22  
   35.23 @@ -681,8 +679,7 @@
   35.24          do {
   35.25              if ((inl(0x70008A0C) & 0x80000000) == 0)
   35.26                  break;
   35.27 -        }
   35.28 -        while (C_timer_check(start, 1000) == 0);
   35.29 +        } while (C_timer_check(start, 1000) == 0);
   35.30      }
   35.31  }
   35.32  static void
    36.1 --- a/src/video/photon/SDL_phyuv.c	Wed Apr 23 06:27:10 2008 +0000
    36.2 +++ b/src/video/photon/SDL_phyuv.c	Tue Jun 10 06:45:39 2008 +0000
    36.3 @@ -161,8 +161,7 @@
    36.4              break;
    36.5          }
    36.6          i++;
    36.7 -    }
    36.8 -    while (1);
    36.9 +    } while (1);
   36.10  
   36.11  
   36.12      if (vidport == -1) {
    37.1 --- a/src/video/ps2gs/SDL_gsevents.c	Wed Apr 23 06:27:10 2008 +0000
    37.2 +++ b/src/video/ps2gs/SDL_gsevents.c	Tue Jun 10 06:45:39 2008 +0000
    37.3 @@ -479,9 +479,8 @@
    37.4                  if (select(fd + 1, &fdset, 0, 0, &tv) < 1) {
    37.5                      break;
    37.6                  }
    37.7 -            }
    37.8 -            while ((read(fd, &ch, sizeof(ch)) == sizeof(ch)) &&
    37.9 -                   ((ch == 0xFA) || (ch == 0xAA)));
   37.10 +            } while ((read(fd, &ch, sizeof(ch)) == sizeof(ch)) &&
   37.11 +                     ((ch == 0xFA) || (ch == 0xAA)));
   37.12  
   37.13              /* Experimental values (Logitech wheelmouse) */
   37.14  #ifdef DEBUG_MOUSE
   37.15 @@ -833,8 +832,7 @@
   37.16                  }
   37.17              }
   37.18          }
   37.19 -    }
   37.20 -    while (posted);
   37.21 +    } while (posted);
   37.22  }
   37.23  
   37.24  void
    38.1 --- a/src/video/svga/SDL_svgaevents.c	Wed Apr 23 06:27:10 2008 +0000
    38.2 +++ b/src/video/svga/SDL_svgaevents.c	Tue Jun 10 06:45:39 2008 +0000
    38.3 @@ -207,8 +207,7 @@
    38.4          posted = 0;
    38.5          mouse_update();
    38.6          keyboard_update();
    38.7 -    }
    38.8 -    while (posted);
    38.9 +    } while (posted);
   38.10  }
   38.11  
   38.12  void
    39.1 --- a/src/video/vgl/SDL_vglevents.c	Wed Apr 23 06:27:10 2008 +0000
    39.2 +++ b/src/video/vgl/SDL_vglevents.c	Tue Jun 10 06:45:39 2008 +0000
    39.3 @@ -141,8 +141,7 @@
    39.4          posted = 0;
    39.5          handle_keyboard(this);
    39.6          handle_mouse(this);
    39.7 -    }
    39.8 -    while (posted != 0);
    39.9 +    } while (posted != 0);
   39.10  }
   39.11  
   39.12  void
    40.1 --- a/src/video/wscons/SDL_wsconsevents.c	Wed Apr 23 06:27:10 2008 +0000
    40.2 +++ b/src/video/wscons/SDL_wsconsevents.c	Tue Jun 10 06:45:39 2008 +0000
    40.3 @@ -145,8 +145,7 @@
    40.4          posted = 0;
    40.5          updateMouse();
    40.6          updateKeyboard(this);
    40.7 -    }
    40.8 -    while (posted);
    40.9 +    } while (posted);
   40.10  }
   40.11  
   40.12  void
    41.1 --- a/test/testblitspeed.c	Wed Apr 23 06:27:10 2008 +0000
    41.2 +++ b/test/testblitspeed.c	Tue Jun 10 06:45:39 2008 +0000
    41.3 @@ -397,8 +397,7 @@
    41.4          }
    41.5  
    41.6          now = SDL_GetTicks();
    41.7 -    }
    41.8 -    while (now < end);
    41.9 +    } while (now < end);
   41.10  
   41.11      printf("Non-blitting crap accounted for %d percent of this run.\n",
   41.12             percent(testms - elasped, testms));
    42.1 --- a/test/testdyngl.c	Wed Apr 23 06:27:10 2008 +0000
    42.2 +++ b/test/testdyngl.c	Tue Jun 10 06:45:39 2008 +0000
    42.3 @@ -185,8 +185,7 @@
    42.4          }
    42.5  
    42.6          SDL_Delay(20);
    42.7 -    }
    42.8 -    while (!done);
    42.9 +    } while (!done);
   42.10  
   42.11      SDL_Quit();
   42.12      return 0;
    43.1 --- a/test/testpalette.c	Wed Apr 23 06:27:10 2008 +0000
    43.2 +++ b/test/testpalette.c	Tue Jun 10 06:45:39 2008 +0000
    43.3 @@ -338,8 +338,7 @@
    43.4          /* update changed areas of the screen */
    43.5          SDL_UpdateRects(screen, NBOATS, updates);
    43.6          frames++;
    43.7 -    }
    43.8 -    while (fade_level > 0);
    43.9 +    } while (fade_level > 0);
   43.10  
   43.11      printf("%d frames, %.2f fps\n",
   43.12             frames, 1000.0 * frames / (SDL_GetTicks() - start));