mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-12-25 17:49:52 +03:00
Merge PR #607: resolve several trivial issues found by Coverity
This commit is contained in:
commit
564a3df4fc
@ -343,13 +343,8 @@ void OvsProceccRecvPacket(OPENVPN_SERVER *s, UDPPACKET *p, UINT protocol)
|
||||
data += sizeof(UINT);
|
||||
size -= sizeof(UINT);
|
||||
|
||||
if (size >= sizeof(ping_signature) &&
|
||||
Cmp(data, ping_signature, sizeof(ping_signature)) == 0)
|
||||
{
|
||||
// Ignore since a ping packet has been received
|
||||
DoNothing();
|
||||
}
|
||||
else
|
||||
if (size < sizeof(ping_signature) ||
|
||||
Cmp(data, ping_signature, sizeof(ping_signature)) != 0)
|
||||
{
|
||||
// Receive a packet!!
|
||||
if (se->Ipc != NULL)
|
||||
|
@ -171,7 +171,6 @@ L"- - $ : : $ Sun Mon Tue Wed Thu Fri Sat : : : $ (None)";
|
||||
|
||||
static LOCALE current_locale;
|
||||
LOCK *tick_manual_lock = NULL;
|
||||
UINT g_zero = 0;
|
||||
|
||||
#define MONSPERYEAR 12
|
||||
#define DAYSPERNYEAR 365
|
||||
@ -1166,12 +1165,6 @@ void SetThreadName(UINT thread_id, char *name, void *param)
|
||||
#endif // OS_WIN32
|
||||
}
|
||||
|
||||
// Do Nothing
|
||||
UINT DoNothing()
|
||||
{
|
||||
return g_zero;
|
||||
}
|
||||
|
||||
// Thread creation (pool)
|
||||
THREAD *NewThreadNamed(THREAD_PROC *thread_proc, void *param, char *name)
|
||||
{
|
||||
@ -1185,11 +1178,6 @@ THREAD *NewThreadNamed(THREAD_PROC *thread_proc, void *param, char *name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (IsTrackingEnabled() == false)
|
||||
{
|
||||
DoNothing();
|
||||
}
|
||||
|
||||
Inc(thread_count);
|
||||
|
||||
LockSk(thread_pool);
|
||||
|
@ -270,7 +270,6 @@ void GetHomeDirW(wchar_t *path, UINT size);
|
||||
void AbortExit();
|
||||
void AbortExitEx(char *msg);
|
||||
void YieldCpu();
|
||||
UINT DoNothing();
|
||||
LIST *NewThreadList();
|
||||
void AddThreadToThreadList(LIST *o, THREAD *t);
|
||||
void DelThreadFromThreadList(LIST *o, THREAD *t);
|
||||
|
@ -9206,8 +9206,6 @@ void Win32NetworkTest()
|
||||
for (i = 0;i < (int)(LIST_NUM(o));i++)
|
||||
{
|
||||
IP_ADAPTER_INDEX_MAP *a = LIST_DATA(o, i);
|
||||
|
||||
DoNothing();
|
||||
}
|
||||
|
||||
ReleaseList(o);
|
||||
@ -14327,9 +14325,8 @@ void ConnectThreadForTcp(THREAD *thread, void *param)
|
||||
{
|
||||
ReleaseSock(p->CancelDisconnectSock);
|
||||
p->CancelDisconnectSock = NULL;
|
||||
LABEL_CANCEL:
|
||||
DoNothing();
|
||||
}
|
||||
LABEL_CANCEL:
|
||||
Unlock(p->CancelLock);
|
||||
|
||||
if (ssl_ret == false)
|
||||
|
@ -875,7 +875,7 @@ void GetCallStackStr(char *str, UINT size, CALLSTACK_DATA *s)
|
||||
|
||||
if (s->name == NULL)
|
||||
{
|
||||
Format(tmp, sizeof(tmp), "0x%p ---", UINT64_TO_POINTER(s->offset));
|
||||
Format(tmp, sizeof(tmp), "0x%02x ---", UINT64_TO_POINTER(s->offset));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1111,27 +1111,20 @@ void UnixGetOsInfo(OS_INFO *info)
|
||||
}
|
||||
|
||||
Zero(info, sizeof(OS_INFO));
|
||||
info->OsType = OSTYPE_UNIX_UNKNOWN;
|
||||
|
||||
#ifdef UNIX_SOLARIS
|
||||
info->OsType = OSTYPE_SOLARIS;
|
||||
#endif // UNIX_SOLARIS
|
||||
|
||||
#ifdef UNIX_CYGWIN
|
||||
#elif UNIX_CYGWIN
|
||||
info->OsType = OSTYPE_CYGWIN;
|
||||
#endif // UNIX_CYGWIN
|
||||
|
||||
#ifdef UNIX_MACOS
|
||||
#elif UNIX_MACOS
|
||||
info->OsType = OSTYPE_MACOS_X;
|
||||
#endif // UNIX_MACOS
|
||||
|
||||
#ifdef UNIX_BSD
|
||||
#elif UNIX_BSD
|
||||
info->OsType = OSTYPE_BSD;
|
||||
#endif // UNIX_BSD
|
||||
|
||||
#ifdef UNIX_LINUX
|
||||
#elif UNIX_LINUX
|
||||
info->OsType = OSTYPE_LINUX;
|
||||
#endif // UNIX_LINUX
|
||||
#else
|
||||
info->OsType = OSTYPE_UNIX_UNKNOWN;
|
||||
#endif
|
||||
|
||||
info->OsServicePack = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user