1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-25 10:59:53 +03:00

[src/Mayaqua/Memory.c:1972]: (style) The function 'DelAllInt' is never used.

[src/Mayaqua/Memory.c:2068]: (style) The function 'DelInt64' is never used.
[src/Mayaqua/Memory.c:2920]: (style) The function 'DumpData' is never used.
[src/Mayaqua/Memory.c:835]: (style) The function 'FillBytes' is never used.
[src/Mayaqua/Memory.c:2745]: (style) The function 'GetFifoCurrentReallocMemSize' is never used.
[src/Mayaqua/Memory.c:1475]: (style) The function 'InsertDistinct' is never used.
[src/Mayaqua/Memory.c:2274]: (style) The function 'InsertInt64Distinct' is never used.
[src/Mayaqua/Memory.c:1612]: (style) The function 'IsInListUniStr' is never used.
[src/Mayaqua/Memory.c:2633]: (style) The function 'LockFifo' is never used.
[src/Mayaqua/Memory.c:1120]: (style) The function 'PeekQueue' is never used.
[src/Mayaqua/Memory.c:2158]: (style) The function 'RandomizeList' is never used.
[src/Mayaqua/Memory.c:1364]: (style) The function 'SetCmp' is never used.
[src/Mayaqua/Memory.c:1570]: (style) The function 'SetSortFlag' is never used.
[src/Mayaqua/Memory.c:1596]: (style) The function 'SortEx' is never used.
[src/Mayaqua/Memory.c:3704]: (style) The function 'Swap' is never used.
[src/Mayaqua/Memory.c:2645]: (style) The function 'UnlockFifo' is never used.
[src/Mayaqua/Memory.c:2532]: (style) The function 'WriteFifoFront' is never used.
This commit is contained in:
Ilya Shipitsin 2018-02-09 18:07:27 +05:00
parent 343c8261e8
commit c1dce327c5
4 changed files with 0 additions and 417 deletions

View File

@ -2004,52 +2004,6 @@ void RegistToDontShowFreeEditionDialog(char *server_name)
MsRegWriteInt(REG_LOCAL_MACHINE, FREE_REGKEY, server_name, 1); MsRegWriteInt(REG_LOCAL_MACHINE, FREE_REGKEY, server_name, 1);
} }
// Free Edition dialog procedure
UINT FreeInfoDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param)
{
FREEINFO *info = (FREEINFO *)param;
// Validate arguments
if (hWnd == NULL)
{
return 0;
}
switch (msg)
{
case WM_INITDIALOG:
SetIcon(hWnd, 0, ICO_HUB);
Top(hWnd);
info->hWnd = hWnd;
Set(info->Event);
FormatText(hWnd, S_INFO_2, info->ServerName);
DlgFont(hWnd, S_INFO_1, 13, true);
DlgFont(hWnd, S_INFO_3, 13, false);
DlgFont(hWnd, B_HIDE, 10, true);
break;
case WM_COMMAND:
switch (wParam)
{
case IDOK:
case IDCANCEL:
if (IsChecked(hWnd, B_HIDE))
{
RegistToDontShowFreeEditionDialog(info->ServerName);
}
Close(hWnd);
break;
}
break;
case WM_CLOSE:
EndDialog(hWnd, 0);
break;
}
return 0;
}
// Show the Easter Egg // Show the Easter Egg
void ShowEasterEgg(HWND hWnd) void ShowEasterEgg(HWND hWnd)
{ {
@ -6521,18 +6475,6 @@ void LbReset(HWND hWnd, UINT id)
SendMsg(hWnd, id, LB_RESETCONTENT, 0, 0); SendMsg(hWnd, id, LB_RESETCONTENT, 0, 0);
} }
// Select by specifying the index
void LbSelectIndex(HWND hWnd, UINT id, UINT index)
{
// Validate arguments
if (hWnd == NULL)
{
return;
}
SendMsg(hWnd, id, LB_SETCURSEL, index, 0);
}
// Get the data // Get the data
UINT LbGetData(HWND hWnd, UINT id, UINT index) UINT LbGetData(HWND hWnd, UINT id, UINT index)
{ {
@ -6545,33 +6487,6 @@ UINT LbGetData(HWND hWnd, UINT id, UINT index)
return SendMsg(hWnd, id, LB_GETITEMDATA, index, 0); return SendMsg(hWnd, id, LB_GETITEMDATA, index, 0);
} }
// Search for the data
UINT LbFindData(HWND hWnd, UINT id, UINT data)
{
UINT i, num;
// Validate arguments
if (hWnd == NULL)
{
return INFINITE;
}
num = LbNum(hWnd, id);
if (num == INFINITE)
{
return INFINITE;
}
for (i = 0;i < num;i++)
{
if (LbGetData(hWnd, id, i) == data)
{
return i;
}
}
return INFINITE;
}
// Password input dialog state change // Password input dialog state change
void PasswordDlgProcChange(HWND hWnd, UI_PASSWORD_DLG *p) void PasswordDlgProcChange(HWND hWnd, UI_PASSWORD_DLG *p)
{ {

View File

@ -697,9 +697,7 @@ UINT CbGetSelectIndex(HWND hWnd, UINT id);
UINT CbGetSelect(HWND hWnd, UINT id); UINT CbGetSelect(HWND hWnd, UINT id);
void SetRange(HWND hWnd, UINT id, UINT start, UINT end); void SetRange(HWND hWnd, UINT id, UINT start, UINT end);
void SetPos(HWND hWnd, UINT id, UINT pos); void SetPos(HWND hWnd, UINT id, UINT pos);
void LbSelectIndex(HWND hWnd, UINT id, UINT index);
UINT LbNum(HWND hWnd, UINT id); UINT LbNum(HWND hWnd, UINT id);
UINT LbFindData(HWND hWnd, UINT id, UINT data);
UINT LbGetData(HWND hWnd, UINT id, UINT index); UINT LbGetData(HWND hWnd, UINT id, UINT index);
void LbReset(HWND hWnd, UINT id); void LbReset(HWND hWnd, UINT id);
STATUS_WINDOW *StatusPrinterWindowStart(SOCK *s, wchar_t *account_name); STATUS_WINDOW *StatusPrinterWindowStart(SOCK *s, wchar_t *account_name);
@ -826,7 +824,6 @@ KAKUSHI *InitKakushi();
void FreeKakushi(KAKUSHI *k); void FreeKakushi(KAKUSHI *k);
void ShowEasterEgg(HWND hWnd); void ShowEasterEgg(HWND hWnd);
void RegistToDontShowFreeEditionDialog(char *server_name); void RegistToDontShowFreeEditionDialog(char *server_name);
UINT FreeInfoDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param);
bool Win32CnCheckAlreadyExists(bool lock); bool Win32CnCheckAlreadyExists(bool lock);
void RegistWindowsFirewallAll(); void RegistWindowsFirewallAll();
void RegistWindowsFirewallAllEx(char *dir); void RegistWindowsFirewallAllEx(char *dir);

View File

@ -831,18 +831,6 @@ LIST *NewCandidateList()
return NewList(ComapreCandidate); return NewList(ComapreCandidate);
} }
// Fill a range of memory
void FillBytes(void *data, UINT size, UCHAR c)
{
UCHAR *buf = (UCHAR *)data;
UINT i;
for (i = 0;i < size;i++)
{
buf[i] = c;
}
}
// Examine whether the specified address points all-zero area // Examine whether the specified address points all-zero area
bool IsZero(void *data, UINT size) bool IsZero(void *data, UINT size)
{ {
@ -1116,28 +1104,6 @@ void *Pop(SK *s)
return ret; return ret;
} }
// Peep
void *PeekQueue(QUEUE *q)
{
void *p = NULL;
// Validate arguments
if (q == NULL)
{
return NULL;
}
if (q->num_item == 0)
{
// No items
return NULL;
}
// Read from the FIFO
PeekFifo(q->fifo, &p, sizeof(void *));
return p;
}
// Get the number of queued items // Get the number of queued items
UINT GetQueueNum(QUEUE *q) UINT GetQueueNum(QUEUE *q)
{ {
@ -1360,22 +1326,6 @@ QUEUE *NewQueueFast()
return q; return q;
} }
// Set the comparison function to list
void SetCmp(LIST *o, COMPARE *cmp)
{
// Validate arguments
if (o == NULL || cmp == NULL)
{
return;
}
if (o->cmp != cmp)
{
o->cmp = cmp;
o->sorted = false;
}
}
// Clone the list // Clone the list
LIST *CloneList(LIST *o) LIST *CloneList(LIST *o)
{ {
@ -1471,23 +1421,6 @@ void *Search(LIST *o, void *target)
} }
} }
// Insert an item to the list (Do not insert if it already exists)
void InsertDistinct(LIST *o, void *p)
{
// Validate arguments
if (o == NULL || p == NULL)
{
return;
}
if (IsInList(o, p))
{
return;
}
Insert(o, p);
}
// Insert an item to the list // Insert an item to the list
void Insert(LIST *o, void *p) void Insert(LIST *o, void *p)
{ {
@ -1566,18 +1499,6 @@ void Insert(LIST *o, void *p)
KS_INC(KS_INSERT_COUNT); KS_INC(KS_INSERT_COUNT);
} }
// Setting the sort flag
void SetSortFlag(LIST *o, bool sorted)
{
// Validate arguments
if (o == NULL)
{
return;
}
o->sorted = sorted;
}
// Sort the list // Sort the list
void Sort(LIST *o) void Sort(LIST *o)
{ {
@ -1593,43 +1514,6 @@ void Sort(LIST *o)
// KS // KS
KS_INC(KS_SORT_COUNT); KS_INC(KS_SORT_COUNT);
} }
void SortEx(LIST *o, COMPARE *cmp)
{
// Validate arguments
if (o == NULL)
{
return;
}
qsort(o->p, o->num_item, sizeof(void *), (int(*)(const void *, const void *))cmp);
o->sorted = false;
// KS
KS_INC(KS_SORT_COUNT);
}
// Examine whether a certain string items are present in the list (Unicode version)
bool IsInListUniStr(LIST *o, wchar_t *str)
{
UINT i;
// Validate arguments
if (o == NULL || str == NULL)
{
return false;
}
for (i = 0;i < LIST_NUM(o);i++)
{
wchar_t *s = LIST_DATA(o, i);
if (UniStrCmpi(s, str) == 0)
{
return true;
}
}
return false;
}
// Replace the pointer in the list // Replace the pointer in the list
bool ReplaceListPointer(LIST *o, void *oldptr, void *newptr) bool ReplaceListPointer(LIST *o, void *oldptr, void *newptr)
@ -1968,26 +1852,6 @@ bool IsInt64InList(LIST *o, UINT64 i)
return false; return false;
} }
// Remove all int from the interger list
void DelAllInt(LIST *o)
{
UINT i;
// Validate arguments
if (o == NULL)
{
return;
}
for (i = 0;i < LIST_NUM(o);i++)
{
UINT *p = LIST_DATA(o, i);
Free(p);
}
DeleteAll(o);
}
// Release the integer list // Release the integer list
void ReleaseIntList(LIST *o) void ReleaseIntList(LIST *o)
{ {
@ -2065,44 +1929,6 @@ void DelInt(LIST *o, UINT i)
ReleaseList(o2); ReleaseList(o2);
} }
} }
void DelInt64(LIST *o, UINT64 i)
{
LIST *o2 = NULL;
UINT j;
// Validate arguments
if (o == NULL)
{
return;
}
for (j = 0;j < LIST_NUM(o);j++)
{
UINT64 *p = LIST_DATA(o, j);
if (*p == i)
{
if (o2 == NULL)
{
o2 = NewListFast(NULL);
}
Add(o2, p);
}
}
for (j = 0;j < LIST_NUM(o2);j++)
{
UINT64 *p = LIST_DATA(o2, j);
Delete(o, p);
Free(p);
}
if (o2 != NULL)
{
ReleaseList(o2);
}
}
// Create a new list of integers // Create a new list of integers
LIST *NewIntList(bool sorted) LIST *NewIntList(bool sorted)
@ -2154,41 +1980,6 @@ int CompareInt64(void *p1, void *p2)
return COMPARE_RET(*v1, *v2); return COMPARE_RET(*v1, *v2);
} }
// Randomize the contents of the list
void RandomizeList(LIST *o)
{
LIST *o2;
UINT i;
// Validate arguments
if (o == NULL)
{
return;
}
o2 = NewListFast(NULL);
while (LIST_NUM(o) != 0)
{
UINT num = LIST_NUM(o);
UINT i = Rand32() % num;
void *p = LIST_DATA(o, i);
Add(o2, p);
Delete(o, p);
}
DeleteAll(o);
for (i = 0;i < LIST_NUM(o2);i++)
{
void *p = LIST_DATA(o2, i);
Add(o, p);
}
ReleaseList(o2);
}
// Add an integer to the list // Add an integer to the list
void AddInt(LIST *o, UINT i) void AddInt(LIST *o, UINT i)
{ {
@ -2271,19 +2062,6 @@ void InsertIntDistinct(LIST *o, UINT i)
InsertInt(o, i); InsertInt(o, i);
} }
} }
void InsertInt64Distinct(LIST *o, UINT64 i)
{
// Validate arguments
if (o == NULL)
{
return;
}
if (IsInt64InList(o, i) == false)
{
InsertInt64(o, i);
}
}
// String comparison function (Unicode) // String comparison function (Unicode)
int CompareUniStr(void *p1, void *p2) int CompareUniStr(void *p1, void *p2)
@ -2528,25 +2306,6 @@ void ShrinkFifoMemory(FIFO *f)
} }
} }
// Write data to the front of FIFO
void WriteFifoFront(FIFO *f, void *p, UINT size)
{
// Validate arguments
if (f == NULL || size == 0)
{
return;
}
if (f->pos < size)
{
PadFifoFront(f, size - f->pos);
}
Copy(((UCHAR *)f->p) + (f->pos - size), p, size);
f->pos -= size;
f->size += size;
}
// Write to the FIFO // Write to the FIFO
void WriteFifo(FIFO *f, void *p, UINT size) void WriteFifo(FIFO *f, void *p, UINT size)
{ {
@ -2629,30 +2388,6 @@ UINT FifoSize(FIFO *f)
return f->size; return f->size;
} }
// Lock the FIFO
void LockFifo(FIFO *f)
{
// Validate arguments
if (f == NULL)
{
return;
}
Lock(f->lock);
}
// Unlock the FIFO
void UnlockFifo(FIFO *f)
{
// Validate arguments
if (f == NULL)
{
return;
}
Unlock(f->lock);
}
// Release the FIFO // Release the FIFO
void ReleaseFifo(FIFO *f) void ReleaseFifo(FIFO *f)
{ {
@ -2741,12 +2476,6 @@ FIFO *NewFifoEx2(bool fast, bool fixed)
return f; return f;
} }
// Get the default memory reclaiming size of the FIFO
UINT GetFifoCurrentReallocMemSize()
{
return fifo_current_realloc_mem_size;
}
// Set the default memory reclaiming size of the FIFO // Set the default memory reclaiming size of the FIFO
void SetFifoCurrentReallocMemSize(UINT size) void SetFifoCurrentReallocMemSize(UINT size)
{ {
@ -2917,25 +2646,6 @@ bool DumpDataW(void *data, UINT size, wchar_t *filename)
return true; return true;
} }
bool DumpData(void *data, UINT size, char *filename)
{
IO *o;
// Validate arguments
if (filename == NULL || (size != 0 && data == NULL))
{
return false;
}
o = FileCreate(filename);
if (o == NULL)
{
return false;
}
FileWrite(o, data, size);
FileClose(o);
return true;
}
// Dump the contents of the buffer to the file // Dump the contents of the buffer to the file
bool DumpBuf(BUF *b, char *filename) bool DumpBuf(BUF *b, char *filename)
@ -3700,28 +3410,6 @@ UINT64 Endian64(UINT64 src)
} }
} }
// Swap data of any
void Swap(void *buf, UINT size)
{
UCHAR *tmp, *src;
UINT i;
// Validate arguments
if (buf == NULL || size == 0)
{
return;
}
src = (UCHAR *)buf;
tmp = Malloc(size);
for (i = 0;i < size;i++)
{
tmp[size - i - 1] = src[i];
}
Copy(buf, tmp, size);
Free(buf);
}
// 16bit swap // 16bit swap
USHORT Swap16(USHORT value) USHORT Swap16(USHORT value)
{ {

View File

@ -299,7 +299,6 @@ int B64_Decode(char *set, char *source, int len);
UINT Encode64(char *dst, char *src); UINT Encode64(char *dst, char *src);
UINT Decode64(char *dst, char *src); UINT Decode64(char *dst, char *src);
void Swap(void *buf, UINT size);
USHORT Swap16(USHORT value); USHORT Swap16(USHORT value);
UINT Swap32(UINT value); UINT Swap32(UINT value);
UINT64 Swap64(UINT64 value); UINT64 Swap64(UINT64 value);
@ -337,7 +336,6 @@ void AddBufStr(BUF *b, char *str);
bool DumpBuf(BUF *b, char *filename); bool DumpBuf(BUF *b, char *filename);
bool DumpBufW(BUF *b, wchar_t *filename); bool DumpBufW(BUF *b, wchar_t *filename);
bool DumpBufWIfNecessary(BUF *b, wchar_t *filename); bool DumpBufWIfNecessary(BUF *b, wchar_t *filename);
bool DumpData(void *data, UINT size, char *filename);
bool DumpDataW(void *data, UINT size, wchar_t *filename); bool DumpDataW(void *data, UINT size, wchar_t *filename);
BUF *ReadDump(char *filename); BUF *ReadDump(char *filename);
BUF *ReadDumpWithMaxSize(char *filename, UINT max_size); BUF *ReadDumpWithMaxSize(char *filename, UINT max_size);
@ -357,11 +355,8 @@ void ShrinkFifoMemory(FIFO *f);
UCHAR *GetFifoPointer(FIFO *f); UCHAR *GetFifoPointer(FIFO *f);
UCHAR *FifoPtr(FIFO *f); UCHAR *FifoPtr(FIFO *f);
void WriteFifo(FIFO *f, void *p, UINT size); void WriteFifo(FIFO *f, void *p, UINT size);
void WriteFifoFront(FIFO *f, void *p, UINT size);
void PadFifoFront(FIFO *f, UINT size); void PadFifoFront(FIFO *f, UINT size);
UINT FifoSize(FIFO *f); UINT FifoSize(FIFO *f);
void LockFifo(FIFO *f);
void UnlockFifo(FIFO *f);
void ReleaseFifo(FIFO *f); void ReleaseFifo(FIFO *f);
void CleanupFifo(FIFO *f); void CleanupFifo(FIFO *f);
FIFO *NewFifo(); FIFO *NewFifo();
@ -369,16 +364,13 @@ FIFO *NewFifoFast();
FIFO *NewFifoEx(bool fast); FIFO *NewFifoEx(bool fast);
FIFO *NewFifoEx2(bool fast, bool fixed); FIFO *NewFifoEx2(bool fast, bool fixed);
void InitFifo(); void InitFifo();
UINT GetFifoCurrentReallocMemSize();
void SetFifoCurrentReallocMemSize(UINT size); void SetFifoCurrentReallocMemSize(UINT size);
void *Search(LIST *o, void *target); void *Search(LIST *o, void *target);
void Sort(LIST *o); void Sort(LIST *o);
void SortEx(LIST *o, COMPARE *cmp);
void Add(LIST *o, void *p); void Add(LIST *o, void *p);
void AddDistinct(LIST *o, void *p); void AddDistinct(LIST *o, void *p);
void Insert(LIST *o, void *p); void Insert(LIST *o, void *p);
void InsertDistinct(LIST *o, void *p);
bool Delete(LIST *o, void *p); bool Delete(LIST *o, void *p);
bool DeleteKey(LIST *o, UINT key); bool DeleteKey(LIST *o, UINT key);
void DeleteAll(LIST *o); void DeleteAll(LIST *o);
@ -395,8 +387,6 @@ void CopyToArray(LIST *o, void *p);
void *ToArray(LIST *o); void *ToArray(LIST *o);
void *ToArrayEx(LIST *o, bool fast); void *ToArrayEx(LIST *o, bool fast);
LIST *CloneList(LIST *o); LIST *CloneList(LIST *o);
void SetCmp(LIST *o, COMPARE *cmp);
void SetSortFlag(LIST *o, bool sorted);
int CompareStr(void *p1, void *p2); int CompareStr(void *p1, void *p2);
bool InsertStr(LIST *o, char *str); bool InsertStr(LIST *o, char *str);
int CompareUniStr(void *p1, void *p2); int CompareUniStr(void *p1, void *p2);
@ -404,17 +394,14 @@ bool IsInList(LIST *o, void *p);
bool IsInListKey(LIST *o, UINT key); bool IsInListKey(LIST *o, UINT key);
void *ListKeyToPointer(LIST *o, UINT key); void *ListKeyToPointer(LIST *o, UINT key);
bool IsInListStr(LIST *o, char *str); bool IsInListStr(LIST *o, char *str);
bool IsInListUniStr(LIST *o, wchar_t *str);
bool ReplaceListPointer(LIST *o, void *oldptr, void *newptr); bool ReplaceListPointer(LIST *o, void *oldptr, void *newptr);
void AddInt(LIST *o, UINT i); void AddInt(LIST *o, UINT i);
void AddInt64(LIST *o, UINT64 i); void AddInt64(LIST *o, UINT64 i);
void AddIntDistinct(LIST *o, UINT i); void AddIntDistinct(LIST *o, UINT i);
void AddInt64Distinct(LIST *o, UINT64 i); void AddInt64Distinct(LIST *o, UINT64 i);
void DelInt(LIST *o, UINT i); void DelInt(LIST *o, UINT i);
void DelInt64(LIST *o, UINT64 i);
void ReleaseIntList(LIST *o); void ReleaseIntList(LIST *o);
void ReleaseInt64List(LIST *o); void ReleaseInt64List(LIST *o);
void DelAllInt(LIST *o);
bool IsIntInList(LIST *o, UINT i); bool IsIntInList(LIST *o, UINT i);
bool IsInt64InList(LIST *o, UINT64 i); bool IsInt64InList(LIST *o, UINT64 i);
LIST *NewIntList(bool sorted); LIST *NewIntList(bool sorted);
@ -424,12 +411,9 @@ int CompareInt64(void *p1, void *p2);
void InsertInt(LIST *o, UINT i); void InsertInt(LIST *o, UINT i);
void InsertInt64(LIST *o, UINT64 i); void InsertInt64(LIST *o, UINT64 i);
void InsertIntDistinct(LIST *o, UINT i); void InsertIntDistinct(LIST *o, UINT i);
void InsertInt64Distinct(LIST *o, UINT64 i);
void RandomizeList(LIST *o);
void *GetNext(QUEUE *q); void *GetNext(QUEUE *q);
void *GetNextWithLock(QUEUE *q); void *GetNextWithLock(QUEUE *q);
void *PeekQueue(QUEUE *q);
void InsertQueue(QUEUE *q, void *p); void InsertQueue(QUEUE *q, void *p);
void InsertQueueWithLock(QUEUE *q, void *p); void InsertQueueWithLock(QUEUE *q, void *p);
void InsertQueueInt(QUEUE *q, UINT value); void InsertQueueInt(QUEUE *q, UINT value);
@ -458,7 +442,6 @@ BUF *CompressBuf(BUF *src_buf);
BUF *UncompressBuf(BUF *src_buf); BUF *UncompressBuf(BUF *src_buf);
bool IsZero(void *data, UINT size); bool IsZero(void *data, UINT size);
void FillBytes(void *data, UINT size, UCHAR c);
LIST *NewStrMap(); LIST *NewStrMap();
void *StrMapSearch(LIST *map, char *key); void *StrMapSearch(LIST *map, char *key);