Browse Source

Fixes for compliance with both toolchains gcc and clang

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>
Álvaro Jurado 6 years ago
parent
commit
1016132d94

+ 1 - 1
sys/src/cmd/build.json

@@ -43,7 +43,7 @@
 			"grep/grep.json",
 			"gzip/build.json",
 			"hoc/hoc.json",
-			"htmlroff/build.json"
+			"htmlroff/build.json",
 			"iostats/build.json",
 			"iozone/fileop.json",
 			"ip/ip.json",

+ 5 - 1
sys/src/cmd/cifs/trans2.c

@@ -449,10 +449,14 @@ T2fssizeinfo(Session *s, Share *sp, uint64_t *total, uint64_t *unused)
 	n = gl32(p);		/* sectors per block */
 	b = gl32(p);		/* bytes per sector */
 
-	/* I just can't figure out why this is here
+	/* I just can't figure out why this is here.
+	 * free is always true and I don't know how
+	 * to deal with this. Marked f as used for
+	 * compiler warning.
 	if(free)
 		*unused = f * n * b;
 	*/
+	USED(f);
 	if(total)
 		*total = t * n * b;
 

+ 1 - 2
sys/src/cmd/ext2srv/ext2subs.c

@@ -1080,8 +1080,7 @@ new_inode(Xfile *f, int mode)
 			ed = getext2(xf, EXT2_DESC, i);
 			if( ed.u.gd->bg_free_inodes_count &&
 					ed.u.gd->bg_free_inodes_count >= ave ){
-				if( group<0 || ed.u.gd->bg_free_inodes_count >
-								ed.u.gd->bg_free_inodes_count )
+				if( group<0 )
 					group = i;
 			}
 			putext2(ed);

+ 1 - 1
sys/src/cmd/htmlroff/t8.c

@@ -349,7 +349,7 @@ getname(void)
 	cc = getnext();
 	if(c < 0 || cc < 0)
 		return L("");
-	if(c == '\n' | cc == '\n'){
+	if((c == '\n') | (cc == '\n')){
 		warn("newline in \\n");
 		ungetnext(cc);
 		if(c == '\n')

+ 1 - 1
sys/src/cmd/tbl/t8.c

@@ -238,7 +238,7 @@ putline(int i, int nl)
 			if (vspen(table[ip][c].col)) {
 				exvspen = (c + 1 < ncol) && vspen(table[ip][c+1].col) &&
 				    (topat[c] == topat[c+1]) &&
-				    ((cmidx == (flags[c+1] [stynum[nl]] & (CTOP | CDOWN))== 0))
+				    ((cmidx == ((flags[c+1] [stynum[nl]] & (CTOP | CDOWN))== 0)))
 				     && (left(i, c + 1, &lwid) < 0);
 				if (exvspen == 0) {
 					Bprint(&tabout, "\\v'(\\n(\\*(#du-\\n(^%cu", c + 'a');