[Scummvm-cvs-logs] SF.net SVN: scummvm: [29379] scummvm/trunk/backends/midi/timidity.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Fri Nov 2 17:55:10 CET 2007


Revision: 29379
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29379&view=rev
Author:   eriktorbjorn
Date:     2007-11-02 09:55:09 -0700 (Fri, 02 Nov 2007)

Log Message:
-----------
Changed "if( ... )" to "if ( ... )" and "while( ... )" to "while ( ... )", and
removed an unnecessary \n.

Modified Paths:
--------------
    scummvm/trunk/backends/midi/timidity.cpp

Modified: scummvm/trunk/backends/midi/timidity.cpp
===================================================================
--- scummvm/trunk/backends/midi/timidity.cpp	2007-11-02 16:10:53 UTC (rev 29378)
+++ scummvm/trunk/backends/midi/timidity.cpp	2007-11-02 16:55:09 UTC (rev 29379)
@@ -252,7 +252,7 @@
 		 * messages till we reach something like "200 Bye" */
 		do {
 			res = timidity_ctl_command("QUIT");
-		} while(*res && atoi(res) && atoi(res) != 302);
+		} while (*res && atoi(res) && atoi(res) != 302);
 	}
 
 	/* now close and nullify both filedescs */
@@ -269,7 +269,7 @@
 
 	/* if not, try to resolve a hostname */
 	if ((hp = gethostbyname(address)) == NULL) {
-		warning("TiMidity: unknown hostname: %s\n", address);
+		warning("TiMidity: unknown hostname: %s", address);
 		return INADDR_NONE;
 	}
 
@@ -317,14 +317,14 @@
 		va_end(ap);
 
 		/* add newline if needed */
-		if(len > 0 && buff[len - 1] != '\n')
+		if (len > 0 && buff[len - 1] != '\n')
 			buff[len++] = '\n';
 
 		/* write command to control socket */
 		write(_control_fd, buff, len);
 	}
 
-	while(1) {
+	while (1) {
 		/* read reply */
 		if (fdgets(buff, sizeof(buff)) <= 0) {
 			strcpy(buff, "Read error\n");
@@ -372,17 +372,17 @@
 		res = timidity_ctl_command(NULL);
 		status = atoi(res);
 
-		if(status != 301)
+		if (status != 301)
 			warning("TiMidity: error: SYNC: %s", res);
 
-	} while(status && status != 301);
+	} while (status && status != 301);
 
-	if(status != 301)
+	if (status != 301)
 		return -1; /* error */
 
 	sleep_usec = (unsigned long)(atof(res + 4) * 1000000);
 
-	if(sleep_usec > 0)
+	if (sleep_usec > 0)
 		usleep(sleep_usec);
 
 	return 0;
@@ -429,7 +429,7 @@
 			size = _controlbuffer_size = n;
 		}
 		*buff++ = pbuff[count++];
-	} while(*(buff - 1) != '\n' && buff != buff_endp);
+	} while (*(buff - 1) != '\n' && buff != buff_endp);
 
 	*buff = '\0';
 	_controlbuffer_count = count;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list