mirror of
https://github.com/Silicondust/libhdhomerun
synced 2025-08-21 05:53:29 -07:00
fix 64/32-bit conversion warnings
This commit is contained in:
parent
8d861a8f0b
commit
769c964bfc
3 changed files with 11 additions and 11 deletions
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* hdhomerun_config.c
|
* hdhomerun_config.c
|
||||||
*
|
*
|
||||||
* Copyright © 2006-2015 Silicondust USA Inc. <www.silicondust.com>.
|
* Copyright © 2006-206 Silicondust USA Inc. <www.silicondust.com>.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -560,7 +560,7 @@ static int main_cmd(int argc, char *argv[])
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
return help();
|
return help();
|
||||||
}
|
}
|
||||||
uint32_t lockkey = strtoul(argv[0], NULL, 0);
|
uint32_t lockkey = (uint32_t)strtoul(argv[0], NULL, 0);
|
||||||
hdhomerun_device_tuner_lockkey_use_value(hd, lockkey);
|
hdhomerun_device_tuner_lockkey_use_value(hd, lockkey);
|
||||||
|
|
||||||
cmd = argv[1];
|
cmd = argv[1];
|
||||||
|
|
|
@ -98,15 +98,15 @@ uint64_t getcurrenttime(void)
|
||||||
|
|
||||||
void msleep_approx(uint64_t ms)
|
void msleep_approx(uint64_t ms)
|
||||||
{
|
{
|
||||||
unsigned int delay_s = ms / 1000;
|
uint64_t delay_s = ms / 1000;
|
||||||
if (delay_s > 0) {
|
if (delay_s > 0) {
|
||||||
sleep(delay_s);
|
sleep((unsigned int)delay_s);
|
||||||
ms -= delay_s * 1000;
|
ms -= delay_s * 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int delay_us = ms * 1000;
|
uint64_t delay_us = ms * 1000;
|
||||||
if (delay_us > 0) {
|
if (delay_us > 0) {
|
||||||
usleep(delay_us);
|
usleep((useconds_t)delay_us);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ int hdhomerun_local_ip_info(struct hdhomerun_local_ip_info_t ip_info_list[], int
|
||||||
size_t ifreq_buffer_size = 1024;
|
size_t ifreq_buffer_size = 1024;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
ifc.ifc_len = ifreq_buffer_size;
|
ifc.ifc_len = (int)ifreq_buffer_size;
|
||||||
ifc.ifc_buf = (char *)malloc(ifreq_buffer_size);
|
ifc.ifc_buf = (char *)malloc(ifreq_buffer_size);
|
||||||
if (!ifc.ifc_buf) {
|
if (!ifc.ifc_buf) {
|
||||||
close(sock);
|
close(sock);
|
||||||
|
@ -346,7 +346,7 @@ bool_t hdhomerun_sock_connect(struct hdhomerun_sock_t *sock, uint32_t remote_add
|
||||||
bool_t hdhomerun_sock_send(struct hdhomerun_sock_t *sock, const void *data, size_t length, uint64_t timeout)
|
bool_t hdhomerun_sock_send(struct hdhomerun_sock_t *sock, const void *data, size_t length, uint64_t timeout)
|
||||||
{
|
{
|
||||||
const uint8_t *ptr = (const uint8_t *)data;
|
const uint8_t *ptr = (const uint8_t *)data;
|
||||||
int ret = send(sock->sock, ptr, length, MSG_NOSIGNAL);
|
ssize_t ret = send(sock->sock, ptr, length, MSG_NOSIGNAL);
|
||||||
if (ret >= length) {
|
if (ret >= length) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -408,7 +408,7 @@ bool_t hdhomerun_sock_sendto(struct hdhomerun_sock_t *sock, uint32_t remote_addr
|
||||||
sock_addr.sin_port = htons(remote_port);
|
sock_addr.sin_port = htons(remote_port);
|
||||||
|
|
||||||
const uint8_t *ptr = (const uint8_t *)data;
|
const uint8_t *ptr = (const uint8_t *)data;
|
||||||
int ret = sendto(sock->sock, ptr, length, 0, (struct sockaddr *)&sock_addr, sizeof(sock_addr));
|
ssize_t ret = sendto(sock->sock, ptr, length, 0, (struct sockaddr *)&sock_addr, sizeof(sock_addr));
|
||||||
if (ret >= length) {
|
if (ret >= length) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -463,7 +463,7 @@ bool_t hdhomerun_sock_sendto(struct hdhomerun_sock_t *sock, uint32_t remote_addr
|
||||||
|
|
||||||
bool_t hdhomerun_sock_recv(struct hdhomerun_sock_t *sock, void *data, size_t *length, uint64_t timeout)
|
bool_t hdhomerun_sock_recv(struct hdhomerun_sock_t *sock, void *data, size_t *length, uint64_t timeout)
|
||||||
{
|
{
|
||||||
int ret = recv(sock->sock, data, *length, 0);
|
ssize_t ret = recv(sock->sock, data, *length, 0);
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
*length = ret;
|
*length = ret;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -504,7 +504,7 @@ bool_t hdhomerun_sock_recvfrom(struct hdhomerun_sock_t *sock, uint32_t *remote_a
|
||||||
memset(&sock_addr, 0, sizeof(sock_addr));
|
memset(&sock_addr, 0, sizeof(sock_addr));
|
||||||
socklen_t sockaddr_size = sizeof(sock_addr);
|
socklen_t sockaddr_size = sizeof(sock_addr);
|
||||||
|
|
||||||
int ret = recvfrom(sock->sock, data, *length, 0, (struct sockaddr *)&sock_addr, &sockaddr_size);
|
ssize_t ret = recvfrom(sock->sock, data, *length, 0, (struct sockaddr *)&sock_addr, &sockaddr_size);
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
*remote_addr = ntohl(sock_addr.sin_addr.s_addr);
|
*remote_addr = ntohl(sock_addr.sin_addr.s_addr);
|
||||||
*remote_port = ntohs(sock_addr.sin_port);
|
*remote_port = ntohs(sock_addr.sin_port);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue