Fixed possible uninitialised variable uses

This commit is contained in:
Rob Pearce 2008-10-23 06:30:48 +00:00
parent 889c437374
commit 000d521676
2 changed files with 6 additions and 4 deletions

8
rc.c
View File

@ -4433,6 +4433,9 @@ void dogravity(sprite_t *s) {
int macex,macey; int macex,macey;
int numcaught = 0; int numcaught = 0;
// initialise just in case
macex = s->x ; macey = s->y;
s->slamming = 0; s->slamming = 0;
/* reset fruit type counter */ /* reset fruit type counter */
@ -4452,8 +4455,7 @@ void dogravity(sprite_t *s) {
if (!s2) { if (!s2) {
// should never happen // should never happen
macex = 0; macex = s->x ; macey = s->y;
macey = 0;
} else { } else {
int xx,yy; int xx,yy;
macex = s2->x; macex = s2->x;
@ -6004,7 +6006,7 @@ void initsdl(void) {
void getfruit(sprite_t *giveto, sprite_t *fruit, int multiplier) { void getfruit(sprite_t *giveto, sprite_t *fruit, int multiplier) {
char tempm[MIDBUFLEN]; char tempm[MIDBUFLEN];
int gotscore = fruit->score; int gotscore = fruit->score;
int modscore; int modscore = gotscore; // default
int i; int i;
/* kill the fruit */ /* kill the fruit */

View File

@ -30,7 +30,7 @@ int loadlevel(int wnum, int lnum, int wantmonsters) {
char tempfile[BUFLEN]; char tempfile[BUFLEN];
char *help[MAXHELP]; char *help[MAXHELP];
int numhelp = 0; int numhelp = 0;
int curhelp; int curhelp = 0;
char *p; char *p;
int tileid; int tileid;
int i; int i;