virtual_oss(8): Fix GCC errors and warnings
Reported by: CI
Fixes: 9cab9fde5e ("virtual_oss: Port to base")
Sponsored by: The FreeBSD Foundation
MFC after: 4 days
This commit is contained in:
@@ -147,8 +147,9 @@ voss_httpd_bind_rtp(vclient_t *pvc, const char *ifname, int *pfd)
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
voss_ipv4_csum(const uint16_t *ptr, size_t count)
|
||||
voss_ipv4_csum(const void *vptr, size_t count)
|
||||
{
|
||||
const uint16_t *ptr = vptr;
|
||||
uint32_t sum = 0;
|
||||
|
||||
while (count--)
|
||||
@@ -161,9 +162,11 @@ voss_ipv4_csum(const uint16_t *ptr, size_t count)
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
voss_udp_csum(uint32_t sum, const uint16_t *hdr, size_t count,
|
||||
voss_udp_csum(uint32_t sum, const void *vhdr, size_t count,
|
||||
const uint16_t *ptr, size_t length)
|
||||
{
|
||||
const uint16_t *hdr = vhdr;
|
||||
|
||||
while (count--)
|
||||
sum += *hdr++;
|
||||
|
||||
@@ -233,8 +236,7 @@ voss_httpd_send_rtp_sub(vclient_t *pvc, int fd, void *ptr, size_t len, uint32_t
|
||||
pvc->profile->http.rtp_seqnum++;
|
||||
pvc->profile->http.rtp_ts += len / (2 * pvc->channels);
|
||||
|
||||
if (writev(fd, iov, 2) < 0)
|
||||
;
|
||||
(void)writev(fd, iov, 2);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -54,7 +54,11 @@ extern pthread_cond_t atomic_cv;
|
||||
(AFMT_U8 | AFMT_S8)
|
||||
|
||||
#define VMAX_CHAN 64
|
||||
#define VMAX_STRING 64 /* characters */
|
||||
/*
|
||||
* XXX 32 - strlen("/dev") to not exceed OSS_DEVNODE_SIZE in soundcard.h. Also
|
||||
* silences GCC warnings.
|
||||
*/
|
||||
#define VMAX_STRING 27
|
||||
|
||||
#define VTYPE_OSS_DAT 0
|
||||
#define VTYPE_WAV_HDR 1
|
||||
|
||||
@@ -1185,7 +1185,7 @@ vclient_ioctl_oss(struct cuse_dev *pdev, int fflags __unused,
|
||||
strlcpy(data.audioinfo.name, pvc->profile->oss_name,
|
||||
sizeof(data.audioinfo.name));
|
||||
snprintf(data.audioinfo.devnode, sizeof(data.audioinfo.devnode),
|
||||
_PATH_DEV "%s", pvc->profile->oss_name);
|
||||
"/dev/%s", pvc->profile->oss_name);
|
||||
data.audioinfo.caps = DSP_CAP_INPUT | DSP_CAP_OUTPUT;
|
||||
data.audioinfo.iformats = VSUPPORTED_AFMT;
|
||||
data.audioinfo.oformats = VSUPPORTED_AFMT;
|
||||
@@ -2275,7 +2275,7 @@ parse_options(int narg, char **pparg, int is_main)
|
||||
if (voss_ctl_device[0])
|
||||
return ("-t parameter may only be used once");
|
||||
|
||||
strncpy(voss_ctl_device, optarg, sizeof(voss_ctl_device));
|
||||
strlcpy(voss_ctl_device, optarg, sizeof(voss_ctl_device));
|
||||
break;
|
||||
case 'm':
|
||||
ptr = optarg;
|
||||
@@ -2529,7 +2529,7 @@ main(int argc, char **argv)
|
||||
{
|
||||
const char *ptrerr;
|
||||
struct sigaction sa;
|
||||
struct cuse_dev *pdev;
|
||||
struct cuse_dev *pdev = NULL;
|
||||
|
||||
TAILQ_INIT(&virtual_profile_client_head);
|
||||
TAILQ_INIT(&virtual_profile_loopback_head);
|
||||
|
||||
Reference in New Issue
Block a user