Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2019-04-09 14:37:15 +0000
committerHenrik Rentz-Reichert2019-06-07 09:23:37 +0000
commit209b20087c67f90cc513a4ae1935de81dc90dc8e (patch)
treec0a72a5171eac6cdf15a2e2f6978270d3004530d /runtime/org.eclipse.etrice.runtime.c/src/common
parent8fea4bc9cc0c8220ee6d2de18dbceac669551a17 (diff)
downloadorg.eclipse.etrice-209b20087c67f90cc513a4ae1935de81dc90dc8e.tar.gz
org.eclipse.etrice-209b20087c67f90cc513a4ae1935de81dc90dc8e.tar.xz
org.eclipse.etrice-209b20087c67f90cc513a4ae1935de81dc90dc8e.zip
Bug 546346: logger interface shall be separated from concrete output
* new sender interface for sending buffers * simple and flexible logger based on this sender Change-Id: I4ebb31662d7b44a80f7bd0a7e2d95da7d8fbc84c
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.c/src/common')
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/base/etMemory_FreeList.c2
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/base/etMemory_VariableSize.c2
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etBufferSender.h45
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etConsoleLogger.c54
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etConsoleLogger.h42
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.c150
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h87
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c18
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/runtime/etRuntime.c24
9 files changed, 401 insertions, 23 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/base/etMemory_FreeList.c b/runtime/org.eclipse.etrice.runtime.c/src/common/base/etMemory_FreeList.c
index 724059bac..205b1ba84 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/base/etMemory_FreeList.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/base/etMemory_FreeList.c
@@ -202,7 +202,7 @@ etMemory* etMemory_FreeList_init(void* heap, etUInt32 size, etUInt16 nslots) {
etUInt32 actual_size = size - data_size;
etMemory* result = NULL;
- if (heap!=NULL & size > data_size) {
+ if (heap!=NULL && size > data_size) {
result = &self->base;
etMemory_init(result, actual_size, etMemory_FreeList_alloc, etMemory_FreeList_free);
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/base/etMemory_VariableSize.c b/runtime/org.eclipse.etrice.runtime.c/src/common/base/etMemory_VariableSize.c
index dba017d79..889e0f1de 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/base/etMemory_VariableSize.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/base/etMemory_VariableSize.c
@@ -76,7 +76,7 @@ etMemory* etMemory_VariableSize_init(void* heap, etUInt32 size) {
ET_MSC_LOGGER_SYNC_ENTRY("etMemory", "init")
- if (heap!=NULL & size > data_size) {
+ if (heap!=NULL && size > data_size) {
result = &self->base;
etMemory_init(result, actual_size, etMemory_VariableSize_alloc, etMemory_VariableSize_free);
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etBufferSender.h b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etBufferSender.h
new file mode 100644
index 000000000..cb4fd5f95
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etBufferSender.h
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2019 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+/**
+ * \file etSender.h
+ *
+ * an interface for sending a buffer contents
+ *
+ * \author: hrentzreichert
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _ETBUFFERSENDER_H_
+#define _ETBUFFERSENDER_H_
+
+#include <stddef.h>
+#include "etDatatypes.h"
+
+struct etBufferSender;
+
+typedef void* etBufferSender_getBuffer(struct etBufferSender* self, size_t size);
+typedef void etBufferSender_sendBuffer(struct etBufferSender* self, void* buffer, size_t size);
+
+typedef struct etBufferSender {
+ etBufferSender_getBuffer* getBuffer;
+ etBufferSender_sendBuffer* sendBuffer;
+}
+etBufferSender;
+
+#endif /* _ETBUFFERSENDER_H_ */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etConsoleLogger.c b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etConsoleLogger.c
new file mode 100644
index 000000000..87d173e99
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etConsoleLogger.c
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2019 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+#include <stdio.h>
+#include "debugging/etConsoleLogger.h"
+
+#define BUFFER_SIZE 1024
+static char buffer[BUFFER_SIZE];
+
+etLogger theConsoleLogger;
+static etBufferSender theConsoleSender;
+
+/*
+ * console sender with fixed buffer (may need synchronization)
+ */
+
+static void* etConsoleSender_getBuffer(etBufferSender* self, size_t size) {
+ if (size<BUFFER_SIZE) {
+ return buffer;
+ }
+ else {
+ return NULL;
+ }
+}
+
+void etConsoleSender_sendBuffer(etBufferSender* self, void* buffer, size_t size) {
+ fprintf(stdout, buffer);
+ fflush(stdout);
+}
+
+
+void etConsoleLogger_init() {
+ static etBool initialized = ET_FALSE;
+ if (!initialized) {
+ initialized = ET_TRUE;
+
+ theConsoleSender.getBuffer = etConsoleSender_getBuffer;
+ theConsoleSender.sendBuffer = etConsoleSender_sendBuffer;
+
+ etLogger_init(&theConsoleLogger, &theConsoleSender);
+
+ etLogger_setAppendNewline(&theConsoleLogger, ET_TRUE);
+ etLogger_setUsePrefix(&theConsoleLogger, ET_TRUE);
+ }
+}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etConsoleLogger.h b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etConsoleLogger.h
new file mode 100644
index 000000000..f7aec5e74
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etConsoleLogger.h
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2019 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+/**
+ * \file etConsoleLogger.h
+ *
+ * an interface for writing a buffer contents to stdout. This implementation is a singleton.
+ *
+ * \author: hrentzreichert
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _ETCONSOLELOGGER_H_
+#define _ETCONSOLELOGGER_H_
+
+#include <debugging/etBufferSender.h>
+#include "etLogger.h"
+
+extern etLogger theConsoleLogger;
+
+/**
+ * initializes the console logger. This function may be called several times but initializes only once.
+ * If used in a multi-threaded environment, synchronization is needed (supply a lock).
+ */
+void etConsoleLogger_init();
+
+#endif /* _ETCONSOLELOGGER_H_ */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.c b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.c
new file mode 100644
index 000000000..bb3f5030f
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.c
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * Copyright (c) 2011 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Thomas Schuetz (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "debugging/etLogger.h"
+#include "osal/etTime.h"
+
+#include <stdarg.h>
+
+static char* prefixes[] = {
+ "E: ",
+ "W: ",
+ "I: "
+ };
+
+static const char* TIMESTAMP_FORMAT = "#%011d.%09d# ";
+static const int TIMESTAMP_LENGTH = 24;
+
+static const int PREFIX_LEN = 3;
+static const int N_PREFIXES = sizeof(prefixes)/sizeof(*prefixes);
+
+#define DO_LOCK \
+ if (self->lock!=NULL) { \
+ self->lock->lockFct(self->lock->lockData); \
+ }
+
+#define DO_UNLOCK \
+ if (self->lock!=NULL) { \
+ self->lock->unlockFct(self->lock->lockData); \
+ }
+
+void etLogger_init(etLogger* logger, etBufferSender* sender) {
+ logger->sender = sender;
+ logger->lock = NULL;
+ logger->nDropped = 0;
+ logger->logLevel = LOG_ERROR;
+ logger->usePrefix = ET_TRUE;
+ logger->appendNewline = ET_FALSE;
+ logger->useTimestamp = ET_FALSE;
+}
+
+void etLogger_setAppendNewline(etLogger* logger, etBool appendNewline) {
+ logger->appendNewline = appendNewline;
+}
+
+void etLogger_setUsePrefix(etLogger* logger, etBool usePrefix) {
+ logger->usePrefix = usePrefix;
+}
+
+void etLogger_setUseTimestamp(etLogger* logger, etBool useTimestamp) {
+ logger->useTimestamp = useTimestamp;
+}
+
+void etLogger_log(etLogger* self, LogSeverity severity, const char* msg) {
+ if (severity <= self->logLevel) {
+ DO_LOCK
+ {
+ size_t msgLen = strlen(msg);
+ size_t size = msgLen
+ + (self->appendNewline ? 1:0)
+ + (self->useTimestamp ? TIMESTAMP_LENGTH : 0)
+ + (self->usePrefix ? PREFIX_LEN:0) + 1;
+ void* buffer = self->sender->getBuffer(self->sender, size);
+ char* pos = (char*) buffer;
+
+ if (buffer!=NULL) {
+
+ if (severity<0) {
+ severity = 0;
+ }
+ else if (severity>=N_PREFIXES) {
+ severity = N_PREFIXES-1;
+ }
+
+ if (self->useTimestamp) {
+ etTime time;
+ getTimeFromTarget(&time);
+ pos += sprintf(pos, TIMESTAMP_FORMAT, time.sec, time.nSec);
+ }
+ if (self->usePrefix) {
+ strcpy(pos, prefixes[severity]);
+ pos += PREFIX_LEN;
+ }
+ strcpy(pos, msg);
+ if (self->appendNewline) {
+ pos += msgLen;
+ strcpy(pos, "\n");
+ }
+
+ self->sender->sendBuffer(self->sender, buffer, size);
+ }
+ else {
+ ++self->nDropped;
+ }
+ }
+ DO_UNLOCK
+ }
+}
+
+void etLogger_logF(etLogger* self, LogSeverity severity, const char* format, ... ) {
+ if (severity <= self->logLevel) {
+ DO_LOCK
+ {
+ va_list arglist;
+ va_start(arglist, format);
+ {
+ int msgLen = vsnprintf(NULL, 0, format, arglist);
+ size_t size = msgLen
+ + (self->appendNewline ? 1:0)
+ + (self->useTimestamp ? TIMESTAMP_LENGTH : 0)
+ + (self->usePrefix ? PREFIX_LEN:0) + 1;
+ void* buffer = self->sender->getBuffer(self->sender, size);
+ char* pos = (char*) buffer;
+
+ if (severity<0) {
+ severity = 0;
+ }
+ else if (severity>=N_PREFIXES) {
+ severity = N_PREFIXES-1;
+ }
+
+ if (self->useTimestamp) {
+ etTime time;
+ getTimeFromTarget(&time);
+ pos += sprintf(pos, TIMESTAMP_FORMAT, time.sec, time.nSec);
+ }
+ if (self->usePrefix) {
+ strcpy(pos, prefixes[severity]);
+ pos += PREFIX_LEN;
+ }
+ pos += vsnprintf(pos, size, format, arglist);
+ if (self->appendNewline) {
+ strcpy(pos, "\n");
+ }
+
+ self->sender->sendBuffer(self->sender, buffer, size);
+ }
+ va_end(arglist);
+ }
+ DO_UNLOCK
+ }
+}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h
index a4bb8c0c2..a95cce0fb 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h
@@ -95,6 +95,93 @@ void etLogger_logInfoF(const char* format, ... );
*/
void etLogger_fprintf(etFileHandle file, const char* format, ... );
+/***************************************************************************************************/
+/*
+ * new interface
+ */
+/***************************************************************************************************/
+
+#include <debugging/etBufferSender.h>
+#include "osal/etLock.h"
+
+typedef enum LogSeverity {
+ LOG_ERROR,
+ LOG_WARNING,
+ LOG_INFO
+}
+LogSeverity;
+
+typedef struct etLogger {
+ etBufferSender* sender; /**< the configured sender */
+ etLock* lock; /**< an optional lock for synchronization */
+ uint16 nDropped; /**< number of unsent messages */
+ LogSeverity logLevel; /**< filter away messages with larger level, default is LOG_ERROR */
+ etBool appendNewline; /**< append a new line character to each message, default is false */
+ etBool usePrefix; /**< prefix each message with the severity, default is true */
+ etBool useTimestamp; /**< prefix each message with a timestamp, default is false */
+}
+etLogger;
+
+/**
+ * initializes the logger object with default values
+ *
+ * \param logger the logger object
+ * \param the sender to be used
+ */
+void etLogger_init(etLogger* logger, etBufferSender* sender);
+
+/**
+ * sets the value of the appendNewline flag
+ *
+ * \param logger the logger object
+ * \param appendNewline the flag
+ */
+void etLogger_setAppendNewline(etLogger* logger, etBool appendNewline);
+
+/**
+ * sets the value of the usePrefix flag
+ *
+ * \param logger the logger object
+ * \param usePrefix the flag
+ */
+void etLogger_setUsePrefix(etLogger* logger, etBool usePrefix);
+
+/**
+ * sets the value of the useTimestamp flag
+ *
+ * \param logger the logger object
+ * \param useTimestamp the flag
+ */
+void etLogger_setUseTimestamp(etLogger* logger, etBool useTimestamp);
+
+/**
+ * supply optional user lock/unlock functions for usage in a multi-threaded environment.
+ *
+ * \param mem pointer to the memory management struct
+ * \lock pointer to a user supplied locking struct
+ */
+void etLogger_setUserLock(etLogger* logger, etLock* lock);
+
+/**
+ * logs a message with a given severity level
+ *
+ * \param self the logger
+ * \param severity the severity level
+ * \param msg the message string
+ */
+void etLogger_log(etLogger* self, LogSeverity severity, const char* msg);
+
+/**
+ * logs a formatted message (like the printf family) with a given severity level
+ *
+ * \param self the logger
+ * \param severity the severity level
+ * \param format the format string
+ * \param ... parameters for the fields
+ */
+void etLogger_logF(etLogger* self, LogSeverity severity, const char* format, ... );
+
+
#endif /* _ETLOGGER_H_ */
#ifdef __cplusplus
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c
index e8ee2e176..b00ab0935 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c
@@ -252,9 +252,9 @@ void expect_equal_void_ptr(etInt16 id, const char* message, const void* expected
if (expected != actual) {
char testresult[ETUNIT_FAILURE_TEXT_LEN];
char exp[16], act[16];
- snprintf(testresult, sizeof(testresult), "%s: expected=%ld, actual=%ld", message, (etUInt32) expected, (etUInt32) actual);
- sprintf(exp, "%ld", (etUInt32) expected);
- sprintf(act, "%ld", (etUInt32) actual);
+ snprintf(testresult, sizeof(testresult), "%s: expected=%p, actual=%p", message, expected, actual);
+ sprintf(exp, "%p", expected);
+ sprintf(act, "%p", actual);
etUnit_handleExpect(id, ET_FALSE, testresult, exp, act, file, line);
} else {
etUnit_handleExpect(id, ET_TRUE, "", NULL, NULL, file, line);
@@ -348,9 +348,9 @@ static void expect_equal_int(etInt16 id, const char* message, etInt32 expected,
if (expected != actual) {
char testresult[ETUNIT_FAILURE_TEXT_LEN];
char exp[16], act[16];
- snprintf(testresult, sizeof(testresult), "%s: expected=%ld, actual=%ld", message, expected, actual);
- sprintf(exp, "%ld", expected);
- sprintf(act, "%ld", actual);
+ snprintf(testresult, sizeof(testresult), "%s: expected=%d, actual=%d", message, expected, actual);
+ sprintf(exp, "%d", expected);
+ sprintf(act, "%d", actual);
etUnit_handleExpect(id, ET_FALSE, testresult, exp, act, file, line);
} else {
etUnit_handleExpect(id, ET_TRUE, "", NULL, NULL, file, line);
@@ -381,9 +381,9 @@ static void expect_equal_uint(etInt16 id, const char* message, etUInt32 expected
if (expected != actual) {
char testresult[ETUNIT_FAILURE_TEXT_LEN];
char exp[16], act[16];
- snprintf(testresult, sizeof(testresult), "%s: expected=%lu, actual=%lu", message, expected, actual);
- sprintf(exp, "%lu", expected);
- sprintf(act, "%lu", actual);
+ snprintf(testresult, sizeof(testresult), "%s: expected=%u, actual=%u", message, expected, actual);
+ sprintf(exp, "%u", expected);
+ sprintf(act, "%u", actual);
etUnit_handleExpect(id, ET_FALSE, testresult, exp, act, file, line);
} else {
etUnit_handleExpect(id, ET_TRUE, "", NULL, NULL, file, line);
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/runtime/etRuntime.c b/runtime/org.eclipse.etrice.runtime.c/src/common/runtime/etRuntime.c
index 7b1ac14fe..7ef3c23c8 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/runtime/etRuntime.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/runtime/etRuntime.c
@@ -50,7 +50,7 @@ int etRuntime_getMessageServiceCount() {
etRuntime_initInternal();
{
etMessageService* p = etRuntime_msgsvc_head;
- while (p!=null) {
+ while (p!=NULL) {
++count;
p = p->next;
}
@@ -67,7 +67,7 @@ int etRuntime_getMessageServiceByName(const char* name) {
{
etMessageService* p = etRuntime_msgsvc_head;
int idx = 0;
- while (p!=null) {
+ while (p!=NULL) {
if (strcmp(p->name, name)==0) {
ET_MSC_LOGGER_SYNC_EXIT
return idx;
@@ -88,7 +88,7 @@ const etMessageServiceStatistics* etRuntime_getMessageServiceStatistics(unsigned
{
etMessageService* p = etRuntime_msgsvc_head;
int count = 0;
- while (p!=null) {
+ while (p!=NULL) {
if (count==i) {
ET_MSC_LOGGER_SYNC_EXIT
return &p->statistics;
@@ -109,7 +109,7 @@ const char* etRuntime_getMessageServiceName(unsigned int i) {
{
etMessageService* p = etRuntime_msgsvc_head;
int count = 0;
- while (p!=null) {
+ while (p!=NULL) {
if (count==i) {
ET_MSC_LOGGER_SYNC_EXIT
return p->name;
@@ -129,7 +129,7 @@ void etRuntime_resetAllMessageServiceStatistics() {
{
etMessageService* p = etRuntime_msgsvc_head;
- while (p!=null) {
+ while (p!=NULL) {
p->resetStatistics = ET_TRUE;
p = p->next;
}
@@ -162,7 +162,7 @@ void etRuntime_unregisterMessageService(etMessageService* msgService) {
{
etMessageService* p = etRuntime_msgsvc_head;
etMessageService* last = NULL;
- while (p!=null) {
+ while (p!=NULL) {
if (p==msgService) {
if (last==NULL) {
/* remove the first one */
@@ -205,7 +205,7 @@ void etRuntime_unregisterMemoryManagement(etMemory* mem) {
{
etMemory* p = etRuntime_memmgmt_head;
etMemory* last = NULL;
- while (p!=null) {
+ while (p!=NULL) {
if (p==mem) {
if (last==NULL) {
/* remove the first one */
@@ -231,7 +231,7 @@ int etRuntime_getMemoryManagementCount() {
{
etMemory* p = etRuntime_memmgmt_head;
- while (p!=null) {
+ while (p!=NULL) {
++count;
p = p->next;
}
@@ -248,7 +248,7 @@ int etRuntime_getMemoryManagementByName(const char* name) {
{
etMemory* p = etRuntime_memmgmt_head;
int idx = 0;
- while (p!=null) {
+ while (p!=NULL) {
if (strcmp(p->name, name)==0) {
ET_MSC_LOGGER_SYNC_EXIT
return idx;
@@ -269,7 +269,7 @@ const etMemoryStatistics* etRuntime_getMemoryManagementStatistics(unsigned int i
{
etMemory* p = etRuntime_memmgmt_head;
int count = 0;
- while (p!=null) {
+ while (p!=NULL) {
if (count==i) {
ET_MSC_LOGGER_SYNC_EXIT
return &p->statistics;
@@ -290,7 +290,7 @@ const char* etRuntime_getMemoryManagementName(unsigned int i) {
{
etMemory* p = etRuntime_memmgmt_head;
int count = 0;
- while (p!=null) {
+ while (p!=NULL) {
if (count==i) {
ET_MSC_LOGGER_SYNC_EXIT
return p->name;
@@ -310,7 +310,7 @@ void etRuntime_resetAllMemoryManagementStatistics() {
{
etMemory* p = etRuntime_memmgmt_head;
- while (p!=null) {
+ while (p!=NULL) {
etMemory_resetStatistics(p);
p = p->next;
}

Back to the top