Parcourir la source

Fixed compiler warnings.

Brucey il y a 4 ans
Parent
commit
d643502cbc

+ 5 - 6
freeaudio.mod/dsounddevice.cpp

@@ -141,17 +141,16 @@ struct dsounddevice:audiodevice{
 	}
 	
 	void freedevice(){
-		int res;
 		if (primarybuffer){
-			res=primarybuffer->Release();
+			primarybuffer->Release();
 			primarybuffer=0;
 		}		
 		if (soundbuffer){
-			res=soundbuffer->Release();
+			soundbuffer->Release();
 			soundbuffer=0;
 		}		
 		if(directsound) {
-			res=directsound->Release();
+			directsound->Release();
 			directsound=0;
 		}	
 	}
@@ -159,8 +158,8 @@ struct dsounddevice:audiodevice{
 //thread entry point
 
 	DWORD run(){	
-		DWORD read,write;
-		int lastread,loopcount;
+		DWORD read,write,lastread;
+		int loopcount;
 		void *mem1,*mem2;
 		DWORD size1,size2;
 		int readpos,writepos;

+ 4 - 4
freeaudio.mod/freeaudio.cpp

@@ -374,7 +374,7 @@ void mixer::releaseall()
 {
 	sound	*s;
 	
-	while (s=playlist)
+	while ((s=playlist))
 	{
 		playlist=s->next;
 		releasesound(s);
@@ -392,7 +392,7 @@ void mixer::mix(int count)
 {
 	sound	*sptr,*tptr,**lptr;
 	
-	while (sptr=startlist.pull())
+	while ((sptr=startlist.pull()))
 	{
 		sptr->next=playlist;
 		playlist=sptr;
@@ -508,7 +508,7 @@ int sample::init(int n,int f,int c,int b,void *_data)
 	buffer=data;
 	writepos=0;
 	return 0;
-};
+}
 
 
 void sample::setloop(int l)
@@ -569,7 +569,7 @@ int sample::buffersize(int readpos)
 
 int sample::peek(int t)
 {
-	int 	s;
+	int s = 0;
 
 	if (t<0||t>=samples) return 0;
 

+ 1 - 1
freeaudio.mod/freeaudio.h

@@ -213,7 +213,7 @@ struct audiodevice
 	sound *play(sample *sam,output *out,int paused)
 	{
 		sound	*snd;
-		int		freq,vol,state;
+		int		state;
 
 		if (mix==0) return 0; 
 		state=sound::SINGLESHOT;

+ 5 - 5
freeprocess.mod/freeprocess.c

@@ -220,7 +220,7 @@ int fdClose(size_t fd)
 BBLONG fdRead(size_t fd,char *buffer,BBLONG bytes)
 {
 	int		res;
-	long	count;
+	DWORD count;
 	res=ReadFile((HANDLE)fd,buffer,bytes,&count,0);
 	if (res) return count;
 	return 0;
@@ -229,7 +229,7 @@ BBLONG fdRead(size_t fd,char *buffer,BBLONG bytes)
 BBLONG fdWrite(size_t fd,char *buffer,BBLONG bytes)
 {
 	int		res;
-	long	count;
+	DWORD count;
 	res=WriteFile((HANDLE)fd,buffer,bytes,&count,0);
 	if (res) return count;
 	return 0;
@@ -245,7 +245,7 @@ int fdFlush(size_t fd)
 int fdAvail(size_t fd)
 {
 	int		res;
-	long	avail;
+	DWORD avail;
 	res=PeekNamedPipe((HANDLE)fd,0,0,0,&avail,0);
 	if (res) return avail;
 	return 0;
@@ -256,7 +256,7 @@ int fdProcessStatus( size_t pid ){
 
 	PROCESS_INFORMATION *pi=(PROCESS_INFORMATION *)pid;
 
-	long exitcode;
+	DWORD exitcode;
 
 	if( GetExitCodeProcess( pi->hProcess,&exitcode ) ){
 
@@ -359,7 +359,7 @@ size_t fdProcess( BBString *cmd,size_t *procin,size_t *procout,size_t *procerr,i
 		else {
 			pflags|=DETACHED_PROCESS;
 		}
-		char *c=bbStringToCString( cmd );
+		char *c=(char *)bbStringToCString( cmd );
 		res=CreateProcess( 0,c,0,0,-1,pflags,0,0,&si,pi );
 		bbMemFree(c);
 	}