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. 8
      simulator/main.c
  9. 10
      simulator/util.c

2
animations/stonefly.c

@ -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

2
display_loop.c

@ -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

2
games/tetris/highscore.c

@ -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;
} }

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_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)

5
menu/menu.c

@ -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;
} }
} }

4
scrolltext/scrolltext3.c

@ -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;

4
simulator/eeprom.c

@ -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);
} }

8
simulator/main.c

@ -1,13 +1,10 @@
#include <stdio.h>
#include <setjmp.h>
#ifdef _WIN32 #ifdef _WIN32
#include <GL/glut.h> #include <GL/glut.h>
#include <windows.h> #include <windows.h>
#include <process.h> #include <process.h>
#define pthread_t int #define pthread_t int
#else #else
#define _XOPEN_SOURCE 500
#ifdef OSX_ #ifdef OSX_
#include <GLUT/glut.h> #include <GLUT/glut.h>
#else #else
@ -20,6 +17,9 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <stdio.h>
#include <setjmp.h>
#include "../config.h" #include "../config.h"
#include "../display_loop.h" #include "../display_loop.h"
#include "../pixel.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 <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) {

Loading…
Cancel
Save