Fixed compiler warnings in Watcom C.
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401157
This commit is contained in:
parent
a2c23b6984
commit
197396555b
5 changed files with 22 additions and 6 deletions
|
@ -2,8 +2,9 @@
|
||||||
/* Test the SDL CD-ROM audio functions */
|
/* Test the SDL CD-ROM audio functions */
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,20 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include "SDL_main.h"
|
#include "SDL_main.h"
|
||||||
#include "SDL_types.h"
|
#include "SDL_types.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Watcom C flags these as Warning 201: "Unreachable code" if you just
|
||||||
|
* compare them directly, so we push it through a function to keep the
|
||||||
|
* compiler quiet. --ryan.
|
||||||
|
*/
|
||||||
|
static int badsize(size_t sizeoftype, size_t hardcodetype)
|
||||||
|
{
|
||||||
|
return sizeoftype != hardcodetype;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
@ -11,26 +23,26 @@ int main(int argc, char *argv[])
|
||||||
if ( argv[1] && (strcmp(argv[1], "-q") == 0) )
|
if ( argv[1] && (strcmp(argv[1], "-q") == 0) )
|
||||||
verbose = 0;
|
verbose = 0;
|
||||||
|
|
||||||
if ( sizeof(Uint8) != 1 ) {
|
if ( badsize(sizeof(Uint8), 1) ) {
|
||||||
if ( verbose )
|
if ( verbose )
|
||||||
printf("sizeof(Uint8) != 1, instead = %d\n",
|
printf("sizeof(Uint8) != 1, instead = %d\n",
|
||||||
sizeof(Uint8));
|
sizeof(Uint8));
|
||||||
++error;
|
++error;
|
||||||
}
|
}
|
||||||
if ( sizeof(Uint16) != 2 ) {
|
if ( badsize(sizeof(Uint16), 2) ) {
|
||||||
if ( verbose )
|
if ( verbose )
|
||||||
printf("sizeof(Uint16) != 2, instead = %d\n",
|
printf("sizeof(Uint16) != 2, instead = %d\n",
|
||||||
sizeof(Uint16));
|
sizeof(Uint16));
|
||||||
++error;
|
++error;
|
||||||
}
|
}
|
||||||
if ( sizeof(Uint32) != 4 ) {
|
if ( badsize(sizeof(Uint32), 4) ) {
|
||||||
if ( verbose )
|
if ( verbose )
|
||||||
printf("sizeof(Uint32) != 4, instead = %d\n",
|
printf("sizeof(Uint32) != 4, instead = %d\n",
|
||||||
sizeof(Uint32));
|
sizeof(Uint32));
|
||||||
++error;
|
++error;
|
||||||
}
|
}
|
||||||
#ifdef SDL_HAS_64BIT_TYPE
|
#ifdef SDL_HAS_64BIT_TYPE
|
||||||
if ( sizeof(Uint64) != 8 ) {
|
if ( badsize(sizeof(Uint64), 8) ) {
|
||||||
if ( verbose )
|
if ( verbose )
|
||||||
printf("sizeof(Uint64) != 8, instead = %d\n",
|
printf("sizeof(Uint64) != 8, instead = %d\n",
|
||||||
sizeof(Uint64));
|
sizeof(Uint64));
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ static void quit(int rc)
|
||||||
|
|
||||||
int SubThreadFunc(void *data) {
|
int SubThreadFunc(void *data) {
|
||||||
while(! *(int volatile *)data) {
|
while(! *(int volatile *)data) {
|
||||||
; /*SDL_Delay(10); /* do nothing */
|
; /*SDL_Delay(10);*/ /* do nothing */
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue