shithub: riscv

Download patch

ref: bfbb68a71290a31d373756dc5ca8da54094875bd
parent: 94282847ec07472e4f50966fdc40695d38b87931
author: cinap_lenrek <[email protected]>
date: Mon Feb 3 15:14:19 EST 2014

ipmux: fix 6c complaints

--- a/sys/src/9/ip/ipmux.c
+++ b/sys/src/9/ip/ipmux.c
@@ -128,13 +128,13 @@
 	p = skipwhite(p);
 	if(strncmp(p, "dst", 3) == 0){
 		type = Tdst;
-		off = (ulong)(ipoff->dst);
+		off = (int)(uintptr)(ipoff->dst);
 		len = IPv4addrlen;
 		p += 3;
 	}
 	else if(strncmp(p, "src", 3) == 0){
 		type = Tsrc;
-		off = (ulong)(ipoff->src);
+		off = (int)(uintptr)(ipoff->src);
 		len = IPv4addrlen;
 		p += 3;
 	}
@@ -146,7 +146,7 @@
 	}
 	else if(strncmp(p, "proto", 5) == 0){
 		type = Tproto;
-		off = (ulong)&(ipoff->proto);
+		off = (int)(uintptr)&(ipoff->proto);
 		len = 1;
 		p += 5;
 	}
@@ -346,8 +346,8 @@
 		return n;
 
 	/* compare offsets, call earlier ones more specific */
-	n = (a->off+((int)a->skiphdr)*(ulong)ipoff->data) - 
-		(b->off+((int)b->skiphdr)*(ulong)ipoff->data);
+	n = (a->off+((int)a->skiphdr)*(int)(uintptr)ipoff->data) - 
+		(b->off+((int)b->skiphdr)*(int)(uintptr)ipoff->data);
 	if(n != 0)
 		return n;
 
@@ -782,8 +782,8 @@
 		return n;
 	}
 	n += snprint(buf+n, len-n, "h[%d:%d]&", 
-               mux->off+((int)mux->skiphdr)*((int)ipoff->data), 
-               mux->off+(((int)mux->skiphdr)*((int)ipoff->data))+mux->len-1);
+               mux->off+((int)mux->skiphdr)*((int)(uintptr)ipoff->data), 
+               mux->off+(((int)mux->skiphdr)*((int)(uintptr)ipoff->data))+mux->len-1);
 	for(i = 0; i < mux->len; i++)
 		n += snprint(buf+n, len - n, "%2.2ux", mux->mask[i]);
 	n += snprint(buf+n, len-n, "=");