diff --git a/src/Cedar/Connection.c b/src/Cedar/Connection.c index be0262d6..dbac5f00 100644 --- a/src/Cedar/Connection.c +++ b/src/Cedar/Connection.c @@ -2693,7 +2693,7 @@ BLOCK *NewBlock(void *data, UINT size, int compress) if (compress == 0) { // Uncompressed - b->Compressed = FALSE; + b->Compressed = false; b->Buf = data; b->Size = size; b->SizeofData = size; @@ -2703,7 +2703,7 @@ BLOCK *NewBlock(void *data, UINT size, int compress) UINT max_size; // Compressed - b->Compressed = TRUE; + b->Compressed = true; max_size = CalcCompress(size); b->Buf = MallocFast(max_size); b->Size = Compress(b->Buf, max_size, data, size); @@ -2717,7 +2717,7 @@ BLOCK *NewBlock(void *data, UINT size, int compress) // Expand UINT max_size; - b->Compressed = FALSE; + b->Compressed = false; max_size = MAX_PACKET_SIZE; b->Buf = MallocFast(max_size); b->Size = Uncompress(b->Buf, max_size, data, size); diff --git a/src/Cedar/Proto_L2TP.c b/src/Cedar/Proto_L2TP.c index edf1b94f..6994777c 100644 --- a/src/Cedar/Proto_L2TP.c +++ b/src/Cedar/Proto_L2TP.c @@ -1780,7 +1780,7 @@ void ProcL2TPPacketRecv(L2TP_SERVER *l2tp, UDPPACKET *p) Insert(t->RecvQueue, q); // Read to the end of completed part from the head of the queue - while (TRUE) + while (true) { L2TP_QUEUE *q; if (LIST_NUM(t->RecvQueue) == 0) diff --git a/src/Cedar/Radius.c b/src/Cedar/Radius.c index 39cd4e9b..58c4edbf 100644 --- a/src/Cedar/Radius.c +++ b/src/Cedar/Radius.c @@ -1972,10 +1972,10 @@ RECV_RETRY: if (recv_size == 0) { Debug("Radius recv_size 0\n"); - finish[pos] = TRUE; - for(i = 0; i < LIST_NUM(ip_list); i++) + finish[pos] = true; + for (i = 0; i < LIST_NUM(ip_list); ++i) { - if(finish[i] == FALSE) + if (finish[i] == false) { // Switch the host to refer pos++; diff --git a/src/Mayaqua/MayaType.h b/src/Mayaqua/MayaType.h index e32edc00..1d1dc97c 100644 --- a/src/Mayaqua/MayaType.h +++ b/src/Mayaqua/MayaType.h @@ -171,13 +171,6 @@ typedef int PID; typedef unsigned long PID; #endif // WINDOWS_H -// bool type -#ifndef WINDOWS_H -typedef unsigned int BOOL; -#define TRUE 1 -#define FALSE 0 -#endif // WINDOWS_H - // bool type #ifndef WIN32COM_CPP typedef unsigned int bool; diff --git a/src/Mayaqua/Mayaqua.c b/src/Mayaqua/Mayaqua.c index 38bae62f..9814f40d 100644 --- a/src/Mayaqua/Mayaqua.c +++ b/src/Mayaqua/Mayaqua.c @@ -23,7 +23,7 @@ bool g_debug; // Debug mode UINT64 kernel_status[NUM_KERNEL_STATUS]; // Kernel state UINT64 kernel_status_max[NUM_KERNEL_STATUS]; // Kernel state (maximum value) LOCK *kernel_status_lock[NUM_KERNEL_STATUS]; // Kernel state lock -BOOL kernel_status_inited = false; // Kernel state initialization flag +bool kernel_status_inited = false; // Kernel state initialization flag bool g_little_endian = true; char *cmdline = NULL; // Command line wchar_t *uni_cmdline = NULL; // Unicode command line diff --git a/src/Mayaqua/Mayaqua.h b/src/Mayaqua/Mayaqua.h index 509b151e..ad5ac514 100644 --- a/src/Mayaqua/Mayaqua.h +++ b/src/Mayaqua/Mayaqua.h @@ -302,7 +302,7 @@ extern bool g_foreground; extern UINT64 kernel_status[NUM_KERNEL_STATUS]; extern UINT64 kernel_status_max[NUM_KERNEL_STATUS]; extern LOCK *kernel_status_lock[NUM_KERNEL_STATUS]; -extern BOOL kernel_status_inited; +extern bool kernel_status_inited; // Kernel state operation macro #define KS_LOCK(id) LockKernelStatus(id) diff --git a/src/Mayaqua/Memory.c b/src/Mayaqua/Memory.c index 506103de..b19e3722 100644 --- a/src/Mayaqua/Memory.c +++ b/src/Mayaqua/Memory.c @@ -3438,7 +3438,7 @@ int B64_Encode(char *set, char *source, int len) { return 0; } - while (TRUE) + while (true) { if (i >= len) { @@ -3491,7 +3491,7 @@ int B64_Decode(char *set, char *source, int len) src = source; i = 0; j = 0; - while (TRUE) + while (true) { f1 = f2 = f3 = f4 = 0; if (i >= len) diff --git a/src/Mayaqua/Object.h b/src/Mayaqua/Object.h index 1215c954..4e63c3dd 100644 --- a/src/Mayaqua/Object.h +++ b/src/Mayaqua/Object.h @@ -17,7 +17,7 @@ struct LOCK { void *pData; - BOOL Ready; + bool Ready; #ifdef OS_UNIX UINT thread_id; UINT locked_count; diff --git a/src/Mayaqua/Str.c b/src/Mayaqua/Str.c index d45bfb71..f44efa67 100644 --- a/src/Mayaqua/Str.c +++ b/src/Mayaqua/Str.c @@ -2478,7 +2478,6 @@ void TrimRight(char *str) { char *buf, *tmp; UINT len, i, wp, wp2; - BOOL flag; // Validate arguments if (str == NULL) { @@ -2496,10 +2495,9 @@ void TrimRight(char *str) buf = Malloc(len + 1); tmp = Malloc(len + 1); - flag = FALSE; wp = 0; wp2 = 0; - for (i = 0;i < len;i++) + for (i = 0; i < len; ++i) { if (str[i] != ' ' && str[i] != '\t') { @@ -2524,7 +2522,7 @@ void TrimLeft(char *str) { char *buf; UINT len, i, wp; - BOOL flag; + bool flag; // Validate arguments if (str == NULL) { @@ -2541,13 +2539,13 @@ void TrimLeft(char *str) } buf = Malloc(len + 1); - flag = FALSE; + flag = false; wp = 0; for (i = 0;i < len;i++) { if (str[i] != ' ' && str[i] != '\t') { - flag = TRUE; + flag = true; } if (flag) {