svn commit: r307704 - in head/sys: amd64/amd64 i386/i386

Jung-uk Kim jkim at FreeBSD.org
Fri Oct 21 06:06:55 UTC 2016


Author: jkim
Date: Fri Oct 21 06:06:54 2016
New Revision: 307704
URL: https://svnweb.freebsd.org/changeset/base/307704

Log:
  Fix compiler warnings for user land.

Modified:
  head/sys/amd64/amd64/bpf_jit_machdep.c
  head/sys/i386/i386/bpf_jit_machdep.c

Modified: head/sys/amd64/amd64/bpf_jit_machdep.c
==============================================================================
--- head/sys/amd64/amd64/bpf_jit_machdep.c	Fri Oct 21 06:05:16 2016	(r307703)
+++ head/sys/amd64/amd64/bpf_jit_machdep.c	Fri Oct 21 06:06:54 2016	(r307704)
@@ -83,12 +83,13 @@ emit_code(bpf_bin_stream *stream, u_int 
 		break;
 
 	case 2:
-		*((u_short *)(stream->ibuf + stream->cur_ip)) = (u_short)value;
+		*((u_short *)(void *)(stream->ibuf + stream->cur_ip)) =
+		    (u_short)value;
 		stream->cur_ip += 2;
 		break;
 
 	case 4:
-		*((u_int *)(stream->ibuf + stream->cur_ip)) = value;
+		*((u_int *)(void *)(stream->ibuf + stream->cur_ip)) = value;
 		stream->cur_ip += 4;
 		break;
 	}
@@ -650,5 +651,5 @@ bpf_jit_compile(struct bpf_insn *prog, u
 	}
 #endif
 
-	return ((bpf_filter_func)stream.ibuf);
+	return ((bpf_filter_func)(void *)stream.ibuf);
 }

Modified: head/sys/i386/i386/bpf_jit_machdep.c
==============================================================================
--- head/sys/i386/i386/bpf_jit_machdep.c	Fri Oct 21 06:05:16 2016	(r307703)
+++ head/sys/i386/i386/bpf_jit_machdep.c	Fri Oct 21 06:06:54 2016	(r307704)
@@ -83,12 +83,13 @@ emit_code(bpf_bin_stream *stream, u_int 
 		break;
 
 	case 2:
-		*((u_short *)(stream->ibuf + stream->cur_ip)) = (u_short)value;
+		*((u_short *)(void *)(stream->ibuf + stream->cur_ip)) =
+		    (u_short)value;
 		stream->cur_ip += 2;
 		break;
 
 	case 4:
-		*((u_int *)(stream->ibuf + stream->cur_ip)) = value;
+		*((u_int *)(void *)(stream->ibuf + stream->cur_ip)) = value;
 		stream->cur_ip += 4;
 		break;
 	}
@@ -679,5 +680,5 @@ bpf_jit_compile(struct bpf_insn *prog, u
 	}
 #endif
 
-	return ((bpf_filter_func)stream.ibuf);
+	return ((bpf_filter_func)(void *)stream.ibuf);
 }


More information about the svn-src-head mailing list