variables: Remove size changing warnings when using Visual Studio

Change some of the types of variables, and cast change sizes where known to
be safe.

There still are some C4116 warning and a couple of C4090 warning which are OK,
so disabled by a #pragma.
This commit is contained in:
Jon Shallow committed 2021-03-03 12:23:25 +00:00
1 parent 0044c61fab
commit 640bb4e667
17 files changed
+65 -54

No files matched your search

+1
View File
@@ -18,6 +18,7 @@
#ifdef _WIN32
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#define fileno _fileno
#include "getopt.c"
#if !defined(S_ISDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+4 -1
View File
@@ -631,7 +631,7 @@ resolve_address(const coap_str_const_t *server, struct sockaddr *dst) {
switch (ainfo->ai_family) {
case AF_INET6:
case AF_INET:
len = ainfo->ai_addrlen;
len = (int)ainfo->ai_addrlen;
memcpy(dst, ainfo->ai_addr, len);
goto finish;
default:
@@ -2898,6 +2898,9 @@ main(int argc, char **argv) {
free(proxy_list);
proxy_list = NULL;
proxy_list_count = 0;
#ifdef _WIN32
#pragma warning( disable : 4090 )
#endif
coap_free(proxy_host_name_list);
#endif /* SERVER_CAN_PROXY */