[quake3-commits] r1708 - trunk/code/tools/lcc/cpp

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Oct 25 19:44:20 EDT 2009


Author: tma
Date: 2009-10-25 19:44:20 -0400 (Sun, 25 Oct 2009)
New Revision: 1708

Modified:
   trunk/code/tools/lcc/cpp/include.c
   trunk/code/tools/lcc/cpp/tokens.c
Log:
* Fix some warnings in lcc compile

Modified: trunk/code/tools/lcc/cpp/include.c
===================================================================
--- trunk/code/tools/lcc/cpp/include.c	2009-10-25 23:07:11 UTC (rev 1707)
+++ trunk/code/tools/lcc/cpp/include.c	2009-10-25 23:44:20 UTC (rev 1708)
@@ -40,7 +40,7 @@
 {
 	char fname[256], iname[256];
 	Includelist *ip;
-	int angled, len, fd, i;
+	int angled, len, wlen, fd, i;
 
 	trp->tp += 1;
 	if (trp->tp>=trp->lp)
@@ -92,9 +92,9 @@
 			break;
 	}
 	if ( Mflag>1 || (!angled&&Mflag==1) ) {
-		write(1,objname,strlen(objname));
-		write(1,iname,strlen(iname));
-		write(1,"\n",1);
+		wlen = write(1,objname,strlen(objname));
+		wlen = write(1,iname,strlen(iname));
+		wlen = write(1,"\n",1);
 	}
 	if (fd >= 0) {
 		if (++incdepth > 10)

Modified: trunk/code/tools/lcc/cpp/tokens.c
===================================================================
--- trunk/code/tools/lcc/cpp/tokens.c	2009-10-25 23:07:11 UTC (rev 1707)
+++ trunk/code/tools/lcc/cpp/tokens.c	2009-10-25 23:44:20 UTC (rev 1708)
@@ -290,7 +290,7 @@
 puttokens(Tokenrow *trp)
 {
 	Token *tp;
-	int len;
+	int len, wlen;
 	uchar *p;
 
 	if (verbose)
@@ -305,15 +305,15 @@
 		}
 		if (len>OBS/2) {		/* handle giant token */
 			if (wbp > wbuf)
-				write(1, wbuf, wbp-wbuf);
-			write(1, (char *)p, len);
+				wlen = write(1, wbuf, wbp-wbuf);
+			wlen = write(1, (char *)p, len);
 			wbp = wbuf;
 		} else {	
 			memcpy(wbp, p, len);
 			wbp += len;
 		}
 		if (wbp >= &wbuf[OBS]) {
-			write(1, wbuf, OBS);
+			wlen = write(1, wbuf, OBS);
 			if (wbp > &wbuf[OBS])
 				memcpy(wbuf, wbuf+OBS, wbp - &wbuf[OBS]);
 			wbp -= OBS;
@@ -327,8 +327,9 @@
 void
 flushout(void)
 {
+	int wlen;
 	if (wbp>wbuf) {
-		write(1, wbuf, wbp-wbuf);
+		wlen = write(1, wbuf, wbp-wbuf);
 		wbp = wbuf;
 	}
 }



More information about the quake3-commits mailing list