diff --git a/src/conio/cterm.c b/src/conio/cterm.c index 21ee8169f7339080a136f0ceae2ec958c4302de5..6766788de6cef6c7e2f792d0a895e16efaa174fd 100644 --- a/src/conio/cterm.c +++ b/src/conio/cterm.c @@ -179,11 +179,11 @@ void play_music(void) int i; char *p; char *out; - int offset=0; + int offset; char note; int notelen; char numbuf[10]; - int dotted=0; + int dotted; int notenum; p=cterm.musicbuf; @@ -193,6 +193,7 @@ void play_music(void) } for(;*p;p++) { notenum=0; + offset=0; switch(toupper(*p)) { case 'M': p++; @@ -226,7 +227,6 @@ void play_music(void) cterm.tempo=255; if(cterm.tempo<32) cterm.tempo=32; - i=1; break; case 'O': /* Octave */ out=numbuf; @@ -236,7 +236,6 @@ void play_music(void) cterm.octave=atoi(numbuf); if(cterm.octave>6) cterm.octave=6; - i=1; break; case 'N': /* Note by number */ if(isdigit(*(p+1))) { @@ -247,7 +246,6 @@ void play_music(void) } *out=0; notenum=atoi(numbuf); - i=1; } if(notenum==0) { notenum=-1; @@ -264,7 +262,6 @@ void play_music(void) case 'P': note=toupper(*p); notelen=cterm.notelen; - offset=0; dotted=0; i=1; while(i) { @@ -475,7 +472,7 @@ void do_ansi(char *retbuf, int retsize) case 'H': row=1; col=1; - *(p--)=0; + *p=0; if(strlen(cterm.escbuf)>1) { if((p=strtok(cterm.escbuf+1,";"))!=NULL) { row=atoi(p); @@ -560,7 +557,6 @@ void do_ansi(char *retbuf, int retsize) p2=(char *)malloc((cterm.height-wherey()-i)*cterm.width*2); gettext(cterm.x+1,cterm.y+wherey(),cterm.x+cterm.width,wherey()+(cterm.height-wherey()-i),p2); puttext(cterm.x+1,cterm.y+wherey()+i,cterm.x+cterm.width,wherey()+(cterm.height-wherey()),p2); - j=0; free(p2); } p2=(char *)malloc(cterm.width*2); @@ -821,7 +817,6 @@ void ctputs(char *buf) int cy; int i; - p=buf; outp=buf; oldscroll=_wscroll; _wscroll=0; diff --git a/src/conio/mouse.c b/src/conio/mouse.c index 5187875f52797c9c2994d0d4e3e5bdab4eb28460..f0fc0f4818b7e8c20292d756d8592d4a8a412dd2 100644 --- a/src/conio/mouse.c +++ b/src/conio/mouse.c @@ -160,7 +160,7 @@ void ciomouse_gotevent(int event, int x, int y) void add_outevent(int event, int x, int y) { struct out_mouse_event *ome; - int but=0; + int but; if(!(mouse_events & 1<<event)) return; @@ -456,12 +456,10 @@ int ciolib_getmouse(struct mouse_event *mevent) int ciolib_ungetmouse(struct mouse_event *mevent) { - int retval=0; struct mouse_event *me; if((me=(struct mouse_event *)malloc(sizeof(struct mouse_event)))==NULL) return(-1); memcpy(me,mevent,sizeof(struct mouse_event)); - listAddNode(&state.output,me,FIRST_NODE); - return(0); + return(listAddNode(&state.output,me,FIRST_NODE)==NULL); }