diff --git a/src/Heap.c b/src/Heap.c index f8a9ee9c..2298ad61 100644 --- a/src/Heap.c +++ b/src/Heap.c @@ -3,11 +3,11 @@ * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 - * and Eclipse Distribution License v1.0 which accompany this distribution. + * and Eclipse Distribution License v1.0 which accompany this distribution. * - * The Eclipse Public License is available at + * The Eclipse Public License is available at * http://www.eclipse.org/legal/epl-v10.html - * and the Eclipse Distribution License is available at + * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: @@ -74,7 +74,7 @@ static const char *errmsg = "Memory allocation error"; static size_t Heap_roundup(size_t size); static int ptrCompare(void* a, void* b, int value); -static void Heap_check(char* string, void* ptr); +/*static void Heap_check(char* string, void* ptr);*/ static void checkEyecatchers(char* file, int line, void* p, size_t size); static int Internal_heap_unlink(char* file, int line, void* p); static void HeapScan(enum LOG_LEVELS log_level); @@ -112,11 +112,10 @@ static int ptrCompare(void* a, void* b, int value) return (a > b) ? -1 : (a == b) ? 0 : 1; } - +/* static void Heap_check(char* string, void* ptr) { - return; - /*Node* curnode = NULL; + Node* curnode = NULL; storageElement* prev, *s = NULL; printf("Heap_check start %p\n", ptr); @@ -135,8 +134,8 @@ static void Heap_check(char* string, void* ptr) else printf("%s: heap order good %d %p %p\n", string, ptrCompare(s, prev, 1), prev->ptr, s->ptr); } - }*/ -} + } +}*/ /** @@ -187,7 +186,7 @@ void* mymalloc(char* file, int line, size_t size) state.current_size += size; if (state.current_size > state.max_size) state.max_size = state.current_size; - Thread_unlock_mutex(heap_mutex); + Thread_unlock_mutex(heap_mutex); return ((int*)(s->ptr)) + 1; /* skip start eyecatcher */ } @@ -287,7 +286,7 @@ void *myrealloc(char* file, int line, void* p, size_t size) { void* rc = NULL; storageElement* s = NULL; - + Thread_lock_mutex(heap_mutex); s = TreeRemoveKey(&heap, ((int*)p)-1); if (s == NULL) @@ -348,7 +347,7 @@ void* Heap_findItem(void* p) static void HeapScan(enum LOG_LEVELS log_level) { Node* current = NULL; - + Thread_lock_mutex(heap_mutex); Log(log_level, -1, "Heap scan start, total %d bytes", state.current_size); while ((current = TreeNextElement(&heap, current)) != NULL) diff --git a/src/MQTTAsync.c b/src/MQTTAsync.c index 3d37e9ba..688b8bb9 100644 --- a/src/MQTTAsync.c +++ b/src/MQTTAsync.c @@ -345,7 +345,7 @@ static void MQTTAsync_terminate(void); static int MQTTAsync_unpersistCommand(MQTTAsync_queuedCommand* qcmd); static int MQTTAsync_persistCommand(MQTTAsync_queuedCommand* qcmd); static MQTTAsync_queuedCommand* MQTTAsync_restoreCommand(char* buffer, int buflen); -static void MQTTAsync_insertInOrder(List* list, void* content, int size); +/*static void MQTTAsync_insertInOrder(List* list, void* content, int size);*/ static int MQTTAsync_restoreCommands(MQTTAsyncs* client); #endif static int MQTTAsync_addCommand(MQTTAsync_queuedCommand* command, int command_size); @@ -377,7 +377,7 @@ static int MQTTAsync_countBufferedMessages(MQTTAsyncs* m); static void MQTTAsync_retry(void); static int MQTTAsync_connecting(MQTTAsyncs* m); static MQTTPacket* MQTTAsync_cycle(int* sock, unsigned long timeout, int* rc); -static int pubCompare(void* a, void* b); +/*static int pubCompare(void* a, void* b);*/ void MQTTAsync_sleep(long milliseconds) @@ -771,7 +771,7 @@ static MQTTAsync_queuedCommand* MQTTAsync_restoreCommand(char* buffer, int bufle return qcommand; } - +/* static void MQTTAsync_insertInOrder(List* list, void* content, int size) { ListElement* index = NULL; @@ -786,7 +786,7 @@ static void MQTTAsync_insertInOrder(List* list, void* content, int size) ListInsert(list, content, size, index); FUNC_EXIT; -} +}*/ static int MQTTAsync_restoreCommands(MQTTAsyncs* client) @@ -2996,12 +2996,12 @@ static MQTTPacket* MQTTAsync_cycle(int* sock, unsigned long timeout, int* rc) return pack; } - +/* static int pubCompare(void* a, void* b) { Messages* msg = (Messages*)a; return msg->publish == (Publications*)b; -} +}*/ int MQTTAsync_getPendingTokens(MQTTAsync handle, MQTTAsync_token **tokens)