Fix compiler warnings for user land.
This commit is contained in:
parent
e3f94e5133
commit
99e3ae6839
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=307704
@ -83,12 +83,13 @@ emit_code(bpf_bin_stream *stream, u_int value, u_int len)
|
||||
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_int nins, size_t *size)
|
||||
}
|
||||
#endif
|
||||
|
||||
return ((bpf_filter_func)stream.ibuf);
|
||||
return ((bpf_filter_func)(void *)stream.ibuf);
|
||||
}
|
||||
|
@ -83,12 +83,13 @@ emit_code(bpf_bin_stream *stream, u_int value, u_int len)
|
||||
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_int nins, size_t *size)
|
||||
}
|
||||
#endif
|
||||
|
||||
return ((bpf_filter_func)stream.ibuf);
|
||||
return ((bpf_filter_func)(void *)stream.ibuf);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user