Browse Source

fixed a bunch of compiler warnings

feature/2015
Christian Kroll 15 years ago
parent
commit
9a26e44e68
  1. 2
      animations/stonefly.c
  2. 2
      display_loop.c
  3. 2
      games/tetris/highscore.c
  4. 2
      games/tetris/variant_bastet.c
  5. 5
      menu/menu.c
  6. 4
      scrolltext/scrolltext3.c
  7. 4
      simulator/eeprom.c
  8. 36
      simulator/main.c
  9. 10
      simulator/util.c

2
animations/stonefly.c

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

2
display_loop.c

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

2
games/tetris/highscore.c

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

2
games/tetris/variant_bastet.c

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

5
menu/menu.c

@ -21,7 +21,7 @@ extern game_descriptor_t _game_descriptors_start__[];
extern game_descriptor_t _game_descriptors_end__[];
// 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_HEIGHT_ICON 8
@ -71,7 +71,6 @@ void menu()
wait(MENU_WAIT_CHATTER);
// call corresponding function
_game_descriptors_start__[miSelection].run();
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(nWait);
// animation speed can be throtteled
// animation speed can be throttled
nWait += MENU_WAIT_INCREMENT;
}
}

4
scrolltext/scrolltext3.c

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

4
simulator/eeprom.c

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

36
simulator/main.c

@ -1,25 +1,25 @@
#include <stdio.h>
#include <setjmp.h>
#ifdef _WIN32
# include <GL/glut.h>
# include <windows.h>
# include <process.h>
# define pthread_t int
#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>
#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 <setjmp.h>
#include "../config.h"
#include "../display_loop.h"
#include "../pixel.h"

10
simulator/util.c

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

Loading…
Cancel
Save