fixed a bunch of compiler warnings

This commit is contained in:
Christian Kroll 2010-04-22 21:49:26 +00:00
parent 750c09734f
commit 9a26e44e68
9 changed files with 35 additions and 32 deletions

View File

@ -127,7 +127,7 @@ void stonefly(void)
stone_t stones[MAX_STONES]; stone_t stones[MAX_STONES];
uint8_t stoneCount = 0; uint8_t stoneCount = 0;
uint16_t counter = 622; /* run 622 cycles */ uint16_t counter = 622; /* run 622 cycles */
uint8_t invax, invay, invasion = 0; uint8_t invax = 0, invay = 0, invasion = 0;
uint8_t draw; uint8_t draw;
//init all stones to zero //init all stones to zero

View File

@ -53,7 +53,7 @@ void display_loop(){
#ifdef RANDOM_SUPPORT #ifdef RANDOM_SUPPORT
{ char a[28]; { char a[28];
sprintf(a,"</# counter == %lu ", percnt_get()); sprintf(a,"</# counter == %lu ", (unsigned long) percnt_get());
scrolltext(a); scrolltext(a);
} }
#endif #endif

View File

@ -37,7 +37,7 @@ uint16_t tetris_highscore_inputName(void)
case 1: case 1:
nOffset = 19; nOffset = 19;
break; break;
case 2: default:
nOffset = 23; nOffset = 23;
break; break;
} }

View File

@ -335,7 +335,7 @@ tetris_piece_t* tetris_bastet_choosePiece(void *pVariantData)
tetris_piece_construct(pBastet->nPieceScores[6].shape, tetris_piece_construct(pBastet->nPieceScores[6].shape,
TETRIS_PC_ANGLE_0); TETRIS_PC_ANGLE_0);
tetris_piece_t *pPiece; tetris_piece_t *pPiece = NULL;
const uint8_t nPercent[4] = {75, 92, 98, 100}; const uint8_t nPercent[4] = {75, 92, 98, 100};
uint8_t nRnd = rand() % 100; uint8_t nRnd = rand() % 100;
for (uint8_t i = 0; i < 4; ++i) for (uint8_t i = 0; i < 4; ++i)

View File

@ -21,7 +21,7 @@ extern game_descriptor_t _game_descriptors_start__[];
extern game_descriptor_t _game_descriptors_end__[]; extern game_descriptor_t _game_descriptors_end__[];
// defines // defines
#define MENU_ITEM_MAX (((unsigned int)_game_descriptors_end__ - (unsigned int)_game_descriptors_start__)/sizeof(game_descriptor_t)) #define MENU_ITEM_MAX ((uint8_t)(((size_t)_game_descriptors_end__ - (size_t)_game_descriptors_start__) / sizeof(game_descriptor_t)))
#define MENU_WIDTH_ICON 8 #define MENU_WIDTH_ICON 8
#define MENU_HEIGHT_ICON 8 #define MENU_HEIGHT_ICON 8
@ -71,7 +71,6 @@ void menu()
wait(MENU_WAIT_CHATTER); wait(MENU_WAIT_CHATTER);
// call corresponding function // call corresponding function
_game_descriptors_start__[miSelection].run(); _game_descriptors_start__[miSelection].run();
break; break;
@ -214,7 +213,7 @@ void menu_animate(uint8_t miInitial, menu_direction_t direction)
// wait between the frames so that the animation can be seen // wait between the frames so that the animation can be seen
wait(nWait); wait(nWait);
// animation speed can be throtteled // animation speed can be throttled
nWait += MENU_WAIT_INCREMENT; nWait += MENU_WAIT_INCREMENT;
} }
} }

View File

@ -1,5 +1,7 @@
#define SCROLLTEXT_C #define SCROLLTEXT_C
#define _XOPEN_SOURCE 600
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <setjmp.h> #include <setjmp.h>
@ -316,7 +318,7 @@ blob_t * setupBlob(char * str){
blob->commands = lastcommands; blob->commands = lastcommands;
} }
blob->str = strtok_r (0, delim, &last); blob->str = strtok_r (NULL, delim, &last);
if ( blob->str == 0) goto fail; if ( blob->str == 0) goto fail;

View File

@ -35,9 +35,9 @@ static void init(){
extern uint8_t _eeprom_start__[]; extern uint8_t _eeprom_start__[];
uint16_t conv_addr(uint8_t * p){ uint16_t conv_addr(void * p){
uint16_t addr; uint16_t addr;
addr = (unsigned int)p - (unsigned int)_eeprom_start__; addr = (unsigned long)p - (unsigned long)_eeprom_start__;
if(addr >= EEPROM_SIZE){ if(addr >= EEPROM_SIZE){
printf ("warning: eeprom write to %X\n",addr); printf ("warning: eeprom write to %X\n",addr);
} }

View File

@ -1,25 +1,25 @@
#ifdef _WIN32
#include <GL/glut.h>
#include <windows.h>
#include <process.h>
#define pthread_t int
#else
#define _XOPEN_SOURCE 500
#ifdef OSX_
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
#include <pthread.h> // for threads in linux
#include <stdlib.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <setjmp.h> #include <setjmp.h>
#ifdef _WIN32
# include <GL/glut.h>
# include <windows.h>
# include <process.h>
# define pthread_t int
#else
# ifdef OSX_
# include <GLUT/glut.h>
# else
# include <GL/glut.h>
# endif
# include <pthread.h> // for threads in linux
# include <stdlib.h>
# include <sys/time.h>
# include <sys/types.h>
# include <unistd.h>
#endif
#include "../config.h" #include "../config.h"
#include "../display_loop.h" #include "../display_loop.h"
#include "../pixel.h" #include "../pixel.h"

View File

@ -1,3 +1,9 @@
#ifdef _WIN32
#include <windows.h>
#else
#define _XOPEN_SOURCE 500
#endif
#include <stdlib.h> #include <stdlib.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
@ -5,10 +11,6 @@
#include <setjmp.h> #include <setjmp.h>
#include "joystick.h" #include "joystick.h"
#ifdef _WIN32
# include <windows.h>
#endif
extern jmp_buf newmode_jmpbuf; extern jmp_buf newmode_jmpbuf;
void wait(unsigned int ms) { void wait(unsigned int ms) {