[windows] fix warnings (#3435)

This commit is contained in:
Yakun Xu
2019-01-07 09:04:50 -08:00
committed by Jonathan Hui
parent dfd2b9b032
commit 3018886993
8 changed files with 21 additions and 12 deletions
+5 -1
View File
@@ -151,7 +151,11 @@ void platformAlarmUpdateTimeout(struct timeval *aTimeout)
remaining = 1;
}
aTimeout->tv_sec = (time_t)remaining / US_PER_S;
#ifndef _WIN32
aTimeout->tv_sec = (time_t)remaining / US_PER_S;
#else
aTimeout->tv_sec = (long)remaining / US_PER_S;
#endif
aTimeout->tv_usec = remaining % US_PER_S;
}
}
+1 -1
View File
@@ -49,7 +49,7 @@
#include <WinSock2.h>
#include <windows.h>
#define POLL WSAPoll
#define ssize_t int
#define ssize_t long
#include <time.h>
#define localtime _localtime32
// In user mode, define some Linux functions
+6 -2
View File
@@ -446,7 +446,11 @@ void platformRadioInit(void)
void platformRadioDeinit(void)
{
#ifndef _WIN32
close(sSockFd);
#else
closesocket(sSockFd);
#endif
}
bool otPlatRadioIsEnabled(otInstance *aInstance)
@@ -841,7 +845,7 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
sSrcMatchEnabled = aEnable;
}
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, uint16_t aShortAddress)
{
OT_UNUSED_VARIABLE(aInstance);
@@ -881,7 +885,7 @@ exit:
return error;
}
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, uint16_t aShortAddress)
{
OT_UNUSED_VARIABLE(aInstance);
+2 -2
View File
@@ -671,7 +671,7 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
sSrcMatchEnabled = aEnable;
}
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, uint16_t aShortAddress)
{
OT_UNUSED_VARIABLE(aInstance);
@@ -711,7 +711,7 @@ exit:
return error;
}
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, uint16_t aShortAddress)
{
OT_UNUSED_VARIABLE(aInstance);