Skip to content

Commit fda2a42

Browse files
committed
Nothing
1 parent 6a08d7d commit fda2a42

27 files changed

+590
-418
lines changed

bst.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ int32_t Bst_Delete_ByNumber(Bst *t, int32_t NodeNumber)
319319

320320
int Bst_Reset(Bst *t)
321321
{
322-
if( t -> PrivateNodes == FALSE )
322+
if( !(t->PrivateNodes) )
323323
{
324324
return -1;
325325
}
@@ -330,3 +330,12 @@ int Bst_Reset(Bst *t)
330330

331331
return 0;
332332
}
333+
334+
void Bst_Free(Bst *t)
335+
{
336+
if( t->PrivateNodes )
337+
{
338+
Array_Free(t->Nodes);
339+
SafeFree(t->Nodes);
340+
}
341+
}

bst.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,6 @@ int32_t Bst_Delete_ByNumber(Bst *t, int32_t NodeNumber);
4444

4545
int Bst_Reset(Bst *t);
4646

47+
void Bst_Free(Bst *t);
48+
4749
#endif // BST_H_INCLUDED

cachettlcrtl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <stdio.h>
22
#include <string.h>
33
#include "cachettlcrtl.h"
4-
#include "debug.h"
4+
#include "logs.h"
55

66
int CacheTtlCrtl_Init(CacheTtlCtrl *c)
77
{

codeblocks/dnsforwarder.cbp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@
7070
</Unit>
7171
<Unit filename="../cachettlcrtl.h" />
7272
<Unit filename="../common.h" />
73-
<Unit filename="../debug.c">
74-
<Option compilerVar="CC" />
75-
</Unit>
76-
<Unit filename="../debug.h" />
7773
<Unit filename="../default.config" />
7874
<Unit filename="../dnscache.c">
7975
<Option compilerVar="CC" />
@@ -131,9 +127,14 @@
131127
<Option compilerVar="CC" />
132128
</Unit>
133129
<Unit filename="../linkedqueue.h" />
130+
<Unit filename="../logs.c">
131+
<Option compilerVar="CC" />
132+
</Unit>
133+
<Unit filename="../logs.h" />
134134
<Unit filename="../main.c">
135135
<Option compilerVar="CC" />
136136
</Unit>
137+
<Unit filename="../oo.h" />
137138
<Unit filename="../pipes.c">
138139
<Option compilerVar="CC" />
139140
</Unit>
@@ -175,6 +176,10 @@
175176
<Option compilerVar="CC" />
176177
</Unit>
177178
<Unit filename="../socketpool.h" />
179+
<Unit filename="../socketpuller.c">
180+
<Option compilerVar="CC" />
181+
</Unit>
182+
<Unit filename="../socketpuller.h" />
178183
<Unit filename="../sockets.c">
179184
<Option compilerVar="CC" />
180185
</Unit>

common.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
/* CRITICAL_SECTION */
6464
#define CRITICAL_SECTION_INIT(c, spin_count) (InitializeCriticalSectionAndSpinCount(&(c), (spin_count)))
6565
#define ENTER_CRITICAL_SECTION(c) (EnterCriticalSection(&(c)))
66-
#define ENTER_CRITICAL_SECTION_TRY(c) (TryEnterCriticalSection(&(c)))
66+
#define ENTER_CRITICAL_SECTION_TRY(c) (TryEnterCriticalSection(&(c)))
67+
#define CRITICAL_SECTION_TRY_SUCCEED(ret) ((ret) != 0)
6768
#define LEAVE_CRITICAL_SECTION(c) (LeaveCriticalSection(&(c)))
6869
#define DELETE_CRITICAL_SECTION(c) (DeleteCriticalSection(&(c)))
6970

@@ -188,13 +189,15 @@
188189
#ifdef HAVE_PTHREAD_SPIN_INIT
189190
#define CREATE_SPIN(s) (pthread_spin_init(&(s), PTHREAD_PROCESS_PRIVATE))
190191
#define LOCK_SPIN(s) (pthread_spin_lock(&(s)))
191-
#define LOCK_SPIN_TRY(s) (pthread_spin_trylock(&(s)))
192+
#define LOCK_SPIN_TRY(s) (pthread_spin_trylock(&(s)))
193+
#define SPIN_TRY_SUCCEED(ret) ((ret) == 0)
192194
#define UNLOCK_SPIN(s) (pthread_spin_unlock(&(s)))
193195
#define DESTROY_SPIN(s) (pthread_spin_destroy(&(s)))
194196
#else /*HAVE_PTHREAD_SPIN_INIT */
195197
#define CREATE_SPIN(s) (pthread_mutex_init(&(s), NULL))
196198
#define LOCK_SPIN(s) (pthread_mutex_lock(&(s)))
197-
#define LOCK_SPIN_TRY(s) (pthread_mutex_trylock(&(s)))
199+
#define LOCK_SPIN_TRY(s) (pthread_mutex_trylock(&(s)))
200+
#define SPIN_TRY_SUCCEED(ret) ((ret) == 0)
198201
#define UNLOCK_SPIN(s) (pthread_mutex_unlock(&(s)))
199202
#define DESTROY_SPIN(s) (pthread_mutex_destroy(&(s)))
200203
#endif /*HAVE_PTHREAD_SPIN_INIT */
@@ -247,13 +250,15 @@
247250
#define EFFECTIVE_LOCK_INIT(l) CRITICAL_SECTION_INIT((l), 1024)
248251
#define EFFECTIVE_LOCK_GET(l) ENTER_CRITICAL_SECTION(l)
249252
#define EFFECTIVE_LOCK_TRY_GET(l) ENTER_CRITICAL_SECTION_TRY(l)
253+
#define EFFECTIVE_LOCK_TRY_SUCCEED(ret) CRITICAL_SECTION_TRY_SUCCEED(ret)
250254
#define EFFECTIVE_LOCK_RELEASE(l) LEAVE_CRITICAL_SECTION(l)
251255
#define EFFECTIVE_LOCK_DESTROY(l) DELETE_CRITICAL_SECTION(l)
252256
#else /* WIN32 */
253257
typedef SpinHandle EFFECTIVE_LOCK;
254258
#define EFFECTIVE_LOCK_INIT(l) CREATE_SPIN(l)
255259
#define EFFECTIVE_LOCK_GET(l) LOCK_SPIN(l)
256260
#define EFFECTIVE_LOCK_TRY_GET(l) LOCK_SPIN_TRY(l)
261+
#define EFFECTIVE_LOCK_TRY_SUCCEED(ret) SPIN_TRY_SUCCEED(ret)
257262
#define EFFECTIVE_LOCK_RELEASE(l) UNLOCK_SPIN(l)
258263
#define EFFECTIVE_LOCK_DESTROY(l) DESTROY_SPIN(l)
259264
#endif /* WIN32 */

debug.c

Lines changed: 0 additions & 93 deletions
This file was deleted.

debug.h

Lines changed: 0 additions & 31 deletions
This file was deleted.

downloader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#endif /* NODOWNLOAD */
3030

3131
#include "downloader.h"
32-
#include "debug.h"
32+
#include "logs.h"
3333

3434
int GetFromInternet_MultiFiles(const char **URLs,
3535
const char *File,

filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "stringlist.h"
55
#include "bst.h"
66
#include "common.h"
7-
#include "debug.h"
7+
#include "logs.h"
88

99
static Bst *DisabledTypes = NULL;
1010

goodiplist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "goodiplist.h"
55
#include "request_response.h"
66
#include "utils.h"
7-
#include "debug.h"
7+
#include "logs.h"
88

99
typedef struct _CountDownMeta{
1010
int TimeLeft;

0 commit comments

Comments
 (0)