Quellcode durchsuchen

NULL -> UA_NULL

FlorianPalm vor 10 Jahren
Ursprung
Commit
5ae0716d65

+ 9 - 9
examples/networklayer_tcp.c

@@ -53,12 +53,12 @@ typedef struct TCPConnectionHandle {
 
 NetworklayerTCP *NetworklayerTCP_new(UA_ConnectionConfig localConf, UA_UInt32 port) {
     NetworklayerTCP *newlayer = malloc(sizeof(NetworklayerTCP));
-    if(newlayer == NULL)
-        return NULL;
+    if(newlayer == UA_NULL)
+        return UA_NULL;
 	newlayer->localConf = localConf;
 	newlayer->port = port;
 	newlayer->connectionsSize = 0;
-	newlayer->connections = NULL;
+	newlayer->connections = UA_NULL;
 	return newlayer;
 }
 
@@ -75,7 +75,7 @@ static UA_StatusCode NetworklayerTCP_remove(NetworklayerTCP *layer, UA_Int32 soc
         return UA_STATUSCODE_BADINTERNALERROR;
 
     if(layer->connections[index].connection.channel)
-        layer->connections[index].connection.channel->connection = NULL;
+        layer->connections[index].connection.channel->connection = UA_NULL;
 
 	UA_Connection_deleteMembers(&layer->connections[index].connection);
 
@@ -94,7 +94,7 @@ void NetworklayerTCP_delete(NetworklayerTCP *layer) {
 	for(UA_UInt32 index = 0;index < layer->connectionsSize;index++) {
 		shutdown(layer->connections[index].sockfd, 2);
         if(layer->connections[index].connection.channel)
-            layer->connections[index].connection.channel->connection = NULL;
+            layer->connections[index].connection.channel->connection = UA_NULL;
         UA_Connection_deleteMembers(&layer->connections[index].connection);
 		CLOSESOCKET(layer->connections[index].sockfd);
 	}
@@ -124,7 +124,7 @@ void writeCallback(TCPConnectionHandle *handle, UA_ByteStringArray gather_buf) {
 	while (nWritten < total_len) {
 		UA_UInt32 n=0;
 		do {
-			result = WSASend(handle->sockfd, buf, gather_buf.stringsSize , (LPDWORD)&n, 0, NULL, NULL);
+			result = WSASend(handle->sockfd, buf, gather_buf.stringsSize , (LPDWORD)&n, 0, UA_NULL, UA_NULL);
 			if(result != 0)
 				printf("NL_TCP_Writer - Error WSASend, code: %d \n", WSAGetLastError());
 		} while (errno == EINTR);
@@ -138,8 +138,8 @@ void writeCallback(TCPConnectionHandle *handle, UA_ByteStringArray gather_buf) {
 		iov[i].iov_len = gather_buf.strings[i].length;
 		total_len += gather_buf.strings[i].length;
 	}
-	struct msghdr message = {.msg_name = NULL, .msg_namelen = 0, .msg_iov = iov,
-							 .msg_iovlen = gather_buf.stringsSize, .msg_control = NULL,
+	struct msghdr message = {.msg_name = UA_NULL, .msg_namelen = 0, .msg_iov = iov,
+							 .msg_iovlen = gather_buf.stringsSize, .msg_control = UA_NULL,
 							 .msg_controllen = 0, .msg_flags = 0};
 	while (nWritten < total_len) {
 		UA_Int32 n = 0;
@@ -302,7 +302,7 @@ UA_StatusCode NetworkLayerTCP_run(NetworklayerTCP *layer, UA_Server *server, str
 	while (*running) {
 		setFDSet(layer);
 		struct timeval tmptv = tv;
-		UA_Int32 resultsize = select(layer->highestfd, &layer->fdset, NULL, NULL, &tmptv);
+		UA_Int32 resultsize = select(layer->highestfd, &layer->fdset, UA_NULL, UA_NULL, &tmptv);
 		if (resultsize <= 0) {
 #ifdef WIN32
 			UA_Int32 err = (resultsize == SOCKET_ERROR) ? WSAGetLastError() : 0;

+ 4 - 4
examples/opcuaClient.c

@@ -56,11 +56,11 @@ int sendOpenSecureChannel(UA_Int32 sock) {
 	UA_String_copycstring("http://opcfoundation.org/UA/SecurityPolicy#None", &securityPolicy);
 
 	UA_String senderCert;
-	senderCert.data = NULL;
+	senderCert.data = UA_NULL;
 	senderCert.length = -1;
 
 	UA_String receiverCertThumb;
-	receiverCertThumb.data = NULL;
+	receiverCertThumb.data = UA_NULL;
 	receiverCertThumb.length = -1;
 
 	UA_UInt32 sequenceNumber = 51;
@@ -288,12 +288,12 @@ int main(int argc, char *argv[]) {
 	UA_UInt32 nodesToReadSize;
 	UA_UInt32 tries;
 	UA_Boolean alwaysSameNode;
-	if(argv[1] == NULL)
+	if(argv[1] == UA_NULL)
 		nodesToReadSize = 1;
 	else
 		nodesToReadSize = atoi(argv[1]);
 
-	if(argv[2] == NULL)
+	if(argv[2] == UA_NULL)
 		tries= 2;
 	else
 		tries = (UA_UInt32) atoi(argv[2]);

+ 1 - 1
examples/opcuaServer.c

@@ -33,7 +33,7 @@ void serverCallback(UA_Server *server) {
 
 UA_ByteString loadCertificate() {
     UA_ByteString certificate = UA_STRING_NULL;
-	FILE *fp = NULL;
+	FILE *fp = UA_NULL;
 	//FIXME: a potiential bug of locating the certificate, we need to get the path from the server's config
 	fp=fopen("localhost.der", "rb");
 

+ 6 - 6
examples/ua_nodestore_concurrent.c

@@ -35,7 +35,7 @@ static INLINE hash_t hash_array(const UA_Byte *data, UA_UInt32 len, UA_UInt32 se
     static const uint32_t n  = 0xe6546b64;
     hash_t hash = seed;
 
-    if(data == NULL) return 0;
+    if(data == UA_NULL) return 0;
 
     const int32_t   nblocks = len / 4;
     const uint32_t *blocks  = (const uint32_t *)data;
@@ -180,7 +180,7 @@ UA_StatusCode open62541NodeStore_new(open62541NodeStore **result) {
         return UA_STATUSCODE_BADOUTOFMEMORY;
 
     /* 32 is the minimum size for the hashtable. */
-    ns->ht = cds_lfht_new(32, 32, 0, CDS_LFHT_AUTO_RESIZE, NULL);
+    ns->ht = cds_lfht_new(32, 32, 0, CDS_LFHT_AUTO_RESIZE, UA_NULL);
     if(!ns->ht) {
         UA_free(ns);
         return UA_STATUSCODE_BADOUTOFMEMORY;
@@ -197,7 +197,7 @@ void open62541NodeStore_delete(open62541NodeStore *ns) {
 
     rcu_read_lock();
     cds_lfht_first(ht, &iter);
-    while(iter.node != NULL) {
+    while(iter.node != UA_NULL) {
         found_htn = cds_lfht_iter_get_node(&iter);
         if(!cds_lfht_del(ht, found_htn)) {
             open62541NodeStore_Entry *entry = caa_container_of(found_htn, open62541NodeStore_Entry, htn);
@@ -207,7 +207,7 @@ void open62541NodeStore_delete(open62541NodeStore *ns) {
     }
     rcu_read_unlock();
 
-    cds_lfht_destroy(ht, NULL);
+    cds_lfht_destroy(ht, UA_NULL);
     UA_free(ns);
 }
 
@@ -288,7 +288,7 @@ UA_StatusCode open62541NodeStore_insert(open62541NodeStore *ns, UA_Node **node,
     if(flags & open62541NodeStore_INSERT_GETMANAGED)
         *node = &entry->node;
     else
-        *node = NULL;
+        *node = UA_NULL;
 
     return UA_STATUSCODE_GOOD;
 }
@@ -341,7 +341,7 @@ void open62541NodeStore_iterate(const open62541NodeStore *ns, open62541NodeStore
 
     rcu_read_lock();
     cds_lfht_first(ht, &iter);
-    while(iter.node != NULL) {
+    while(iter.node != UA_NULL) {
         open62541NodeStore_Entry *found_entry = (open62541NodeStore_Entry *)cds_lfht_iter_get_node(&iter);
         uatomic_inc(&found_entry->readcount);
         const UA_Node      *node = &found_entry->node;

+ 1 - 1
src/ongoing/ua_base64.c

@@ -50,7 +50,7 @@ UA_Int32 UA_base64_getDecodedSize(UA_String *const base64EncodedData) {
 }
 
 UA_Int32 UA_base64_decode(UA_String *const base64EncodedData, UA_Byte *target) {
-    if(target == NULL)
+    if(target == UA_NULL)
         return UA_ERROR;
     base64_decodestate state;
     base64_init_decodestate(&state);

+ 1 - 1
src/ongoing/ua_namespace_xml.c

@@ -17,7 +17,7 @@ UA_Int32 Namespace_loadXml(Namespace **ns,UA_UInt32 nsid,const char* rootName, X
 	*ns = n.ns;
 
 	XML_Stack_addChildHandler(&s, "UANodeSet", strlen("UANodeSet"), (XML_decoder) UA_NodeSet_decodeXmlFromStack, UA_INVALIDTYPE, &n);
-	XML_Parser parser = XML_ParserCreate(NULL);
+	XML_Parser parser = XML_ParserCreate(UA_NULL);
 	XML_SetUserData(parser, &s);
 	XML_SetElementHandler(parser, XML_Stack_startElement, XML_Stack_endElement);
 	XML_SetCharacterDataHandler(parser, XML_Stack_handleText);

+ 2 - 2
src/ongoing/ua_services_subscription.c

@@ -23,8 +23,8 @@ UA_Int32 Service_Publish(UA_Server *server, UA_Session *session, const UA_Publis
 UA_Int32 Service_SetPublishingMode(UA_Server *server, UA_Session *session,
                                    const UA_SetPublishingModeRequest *request,
                                    UA_SetPublishingModeResponse *response) {
-    response->diagnosticInfos = NULL;
-    response->results = NULL;
+    response->diagnosticInfos = UA_NULL;
+    response->results = UA_NULL;
     response->resultsSize     = 0;
     return UA_SUCCESS;
 }

+ 20 - 20
src/ongoing/ua_types_encoding_xml.c

@@ -54,7 +54,7 @@ UA_Int32 UA_UInt16_copycstring(cstring src, UA_UInt16 *dst) {
 UA_Int32 UA_Int16_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_Int16 *dst, _Bool isStart) {
 	DBG_VERBOSE(printf("UA_Int32 entered with dst=%p,isStart=%d\n", (void * )dst, isStart));
 	if(isStart) {
-		if(dst == NULL) {
+		if(dst == UA_NULL) {
 			UA_Int16_new(&dst);
 			s->parent[s->depth - 1].children[s->parent[s->depth - 1].activeChild].obj = (void *)dst;
 		}
@@ -77,7 +77,7 @@ UA_TYPE_METHOD_ENCODEXML_NOTIMPL(UA_Int32)
 UA_Int32 UA_Int32_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_Int32 *dst, _Bool isStart) {
 	DBG_VERBOSE(printf("UA_Int32 entered with dst=%p,isStart=%d\n", (void * )dst, isStart));
 	if(isStart) {
-		if(dst == NULL) {
+		if(dst == UA_NULL) {
 			UA_Int32_new(&dst);
 			s->parent[s->depth - 1].children[s->parent[s->depth - 1].activeChild].obj = (void *)dst;
 		}
@@ -120,7 +120,7 @@ UA_Int32 UA_String_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_String *d
 	DBG_VERBOSE(printf("UA_String entered with dst=%p,isStart=%d\n", (void * )dst, isStart));
 	UA_UInt32 i;
 	if(isStart) {
-		if(dst == NULL) {
+		if(dst == UA_NULL) {
 			UA_String_new(&dst);
 			s->parent[s->depth - 1].children[s->parent[s->depth - 1].activeChild].obj = (void *)dst;
 		}
@@ -141,7 +141,7 @@ UA_Int32 UA_String_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_String *d
 	} else {
 		switch(s->parent[s->depth - 1].activeChild) {
 		case 0:
-			if(dst != NULL && dst->data != NULL && dst->length == -1)
+			if(dst != UA_NULL && dst->data != UA_NULL && dst->length == -1)
 				dst->length = strlen((char const *)dst->data);
 			break;
 		}
@@ -179,7 +179,7 @@ UA_Int32 UA_NodeId_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_NodeId *d
 	DBG_VERBOSE(printf("UA_NodeId entered with dst=%p,isStart=%d\n", (void * )dst, isStart));
 	UA_UInt32 i;
 	if(isStart) {
-		if(dst == NULL) {
+		if(dst == UA_NULL) {
 			UA_NodeId_new(&dst);
 			s->parent[s->depth - 1].children[s->parent[s->depth - 1].activeChild].obj = (void *)dst;
 		}
@@ -191,7 +191,7 @@ UA_Int32 UA_NodeId_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_NodeId *d
 		                              "Numeric"), (XML_decoder)UA_Int32_decodeXmlFromStack, UA_INT32,
 		                          &(dst->identifier.numeric));
 		XML_Stack_addChildHandler(s, "Identifier", strlen(
-		                              "Identifier"), (XML_decoder)UA_String_decodeXmlFromStack, UA_STRING, NULL);
+		                              "Identifier"), (XML_decoder)UA_String_decodeXmlFromStack, UA_STRING, UA_NULL);
 		XML_Stack_handleTextAsElementOf(s, "Data", 2);
 
 		// set attributes
@@ -221,7 +221,7 @@ UA_Int32 UA_ExpandedNodeId_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_E
 	DBG_VERBOSE(printf("UA_ExpandedNodeId entered with dst=%p,isStart=%d\n", (void * )dst, isStart));
 	UA_UInt32 i;
 	if(isStart) {
-		if(dst == NULL) {
+		if(dst == UA_NULL) {
 			UA_ExpandedNodeId_new(&dst);
 			s->parent[s->depth - 1].children[s->parent[s->depth - 1].activeChild].obj = (void *)dst;
 		}
@@ -233,7 +233,7 @@ UA_Int32 UA_ExpandedNodeId_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_E
 		                          &(dst->nodeId.namespaceIndex));
 		XML_Stack_addChildHandler(s, "Numeric", strlen("Numeric"), (XML_decoder)UA_Int32_decodeXmlFromStack, UA_INT32,
 		                          &(dst->nodeId.identifier.numeric));
-		XML_Stack_addChildHandler(s, "Id", strlen("Id"), (XML_decoder)UA_String_decodeXmlFromStack, UA_STRING, NULL);
+		XML_Stack_addChildHandler(s, "Id", strlen("Id"), (XML_decoder)UA_String_decodeXmlFromStack, UA_STRING, UA_NULL);
 		XML_Stack_handleTextAsElementOf(s, "Data", 3);
 
 		// set attributes
@@ -270,7 +270,7 @@ UA_Int32 UA_QualifiedName_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_Qu
 	DBG_VERBOSE(printf("UA_QualifiedName entered with dst=%p,isStart=%d\n", (void * )dst, isStart));
 	UA_UInt32 i;
 	if(isStart) {
-		if(dst == NULL) {
+		if(dst == UA_NULL) {
 			UA_QualifiedName_new(&dst);
 			s->parent[s->depth - 1].children[s->parent[s->depth - 1].activeChild].obj = (void *)dst;
 		}
@@ -305,7 +305,7 @@ UA_Int32 UA_LocalizedText_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_Lo
 	DBG_VERBOSE(printf("UA_LocalizedText entered with dst=%p,isStart=%d\n", (void * )dst, isStart));
 	UA_UInt32 i;
 	if(isStart) {
-		if(dst == NULL) {
+		if(dst == UA_NULL) {
 			UA_LocalizedText_new(&dst);
 			s->parent[s->depth - 1].children[s->parent[s->depth - 1].activeChild].obj = (void *)dst;
 		}
@@ -354,7 +354,7 @@ UA_Int32 UA_ExtensionObject_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_
 
 	if(isStart) {
 		// create a new object if called with UA_NULL
-		if(dst == NULL) {
+		if(dst == UA_NULL) {
 			UA_ExtensionObject_new(&dst);
 			s->parent[s->depth - 1].children[s->parent[s->depth - 1].activeChild].obj = (void *)dst;
 		}
@@ -392,7 +392,7 @@ UA_Int32 UA_Variant_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_Variant
 
 	if(isStart) {
 		// create a new object if called with UA_NULL
-		if(dst == NULL) {
+		if(dst == UA_NULL) {
 			UA_Variant_new(&dst);
 			s->parent[s->depth - 1].children[s->parent[s->depth - 1].activeChild].obj = (void *)dst;
 		}
@@ -400,10 +400,10 @@ UA_Int32 UA_Variant_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_Variant
 		s->parent[s->depth].len = 0;
 		XML_Stack_addChildHandler(s, "ListOfExtensionObject", strlen(
 		                              "ListOfExtensionObject"), (XML_decoder)UA_TypedArray_decodeXmlFromStack,
-		                          UA_EXTENSIONOBJECT, NULL);
+		                          UA_EXTENSIONOBJECT, UA_NULL);
 		XML_Stack_addChildHandler(s, "ListOfLocalizedText", strlen(
 		                              "ListOfLocalizedText"), (XML_decoder)UA_TypedArray_decodeXmlFromStack,
-		                          UA_LOCALIZEDTEXT, NULL);
+		                          UA_LOCALIZEDTEXT, UA_NULL);
 
 		// set attributes
 		for(i = 0;attr[i];i += 2) {
@@ -413,22 +413,22 @@ UA_Int32 UA_Variant_decodeXmlFromStack(XML_Stack *s, XML_Attr *attr, UA_Variant
 			}
 		}
 	} else {
-		if(s->parent[s->depth - 1].activeChild == 0 && attr != NULL ) {  // ExtensionObject
+		if(s->parent[s->depth - 1].activeChild == 0 && attr != UA_NULL ) {  // ExtensionObject
 			UA_TypedArray *array = (UA_TypedArray *)attr;
 			DBG_VERBOSE(printf("UA_Variant_decodeXml - finished array: references=%p, size=%d\n", (void *)array,
-			                   (array == NULL) ? -1 : array->size));
+			                   (array == UA_NULL) ? -1 : array->size));
 			dst->arrayLength  = array->size;
 			dst->data         = array->elements;
 			dst->vt = &UA_.types[UA_EXTENSIONOBJECT];
-			s->parent[s->depth - 1].children[s->parent[s->depth - 1].activeChild].obj = NULL;
-		} else if(s->parent[s->depth - 1].activeChild == 1 && attr != NULL ) {  // LocalizedText
+			s->parent[s->depth - 1].children[s->parent[s->depth - 1].activeChild].obj = UA_NULL;
+		} else if(s->parent[s->depth - 1].activeChild == 1 && attr != UA_NULL ) {  // LocalizedText
 			UA_TypedArray *array = (UA_TypedArray *)attr;
 			DBG_VERBOSE(printf("UA_Variant_decodeXml - finished array: references=%p, size=%d\n", (void *)array,
-			                   (array == NULL) ? -1 : array->size));
+			                   (array == UA_NULL) ? -1 : array->size));
 			dst->arrayLength  = array->size;
 			dst->data         = array->elements;
 			dst->vt = &UA_.types[UA_LOCALIZEDTEXT];
-			s->parent[s->depth - 1].children[s->parent[s->depth - 1].activeChild].obj = NULL;
+			s->parent[s->depth - 1].children[s->parent[s->depth - 1].activeChild].obj = UA_NULL;
 		}
 	}
 	return UA_SUCCESS;

+ 6 - 6
src/server/nodestore/open62541_nodestore_concurrent_core.c

@@ -35,7 +35,7 @@ static INLINE hash_t hash_array(const UA_Byte *data, UA_UInt32 len, UA_UInt32 se
     static const uint32_t n  = 0xe6546b64;
     hash_t hash = seed;
 
-    if(data == NULL) return 0;
+    if(data == UA_NULL) return 0;
 
     const int32_t   nblocks = len / 4;
     const uint32_t *blocks  = (const uint32_t *)data;
@@ -180,7 +180,7 @@ UA_StatusCode open62541NodeStore_new(open62541NodeStore **result) {
         return UA_STATUSCODE_BADOUTOFMEMORY;
 
     /* 32 is the minimum size for the hashtable. */
-    ns->ht = cds_lfht_new(32, 32, 0, CDS_LFHT_AUTO_RESIZE, NULL);
+    ns->ht = cds_lfht_new(32, 32, 0, CDS_LFHT_AUTO_RESIZE, UA_NULL);
     if(!ns->ht) {
         UA_free(ns);
         return UA_STATUSCODE_BADOUTOFMEMORY;
@@ -197,7 +197,7 @@ void open62541NodeStore_delete(open62541NodeStore *ns) {
 
     rcu_read_lock();
     cds_lfht_first(ht, &iter);
-    while(iter.node != NULL) {
+    while(iter.node != UA_NULL) {
         found_htn = cds_lfht_iter_get_node(&iter);
         if(!cds_lfht_del(ht, found_htn)) {
             open62541NodeStore_Entry *entry = caa_container_of(found_htn, open62541NodeStore_Entry, htn);
@@ -207,7 +207,7 @@ void open62541NodeStore_delete(open62541NodeStore *ns) {
     }
     rcu_read_unlock();
 
-    cds_lfht_destroy(ht, NULL);
+    cds_lfht_destroy(ht, UA_NULL);
     UA_free(ns);
 }
 
@@ -288,7 +288,7 @@ UA_StatusCode open62541NodeStore_insert(open62541NodeStore *ns, UA_Node **node,
     if(flags & open62541NodeStore_INSERT_GETMANAGED)
         *node = &entry->node;
     else
-        *node = NULL;
+        *node = UA_NULL;
 
     return UA_STATUSCODE_GOOD;
 }
@@ -341,7 +341,7 @@ void open62541NodeStore_iterate(const open62541NodeStore *ns, open62541NodeStore
 
     rcu_read_lock();
     cds_lfht_first(ht, &iter);
-    while(iter.node != NULL) {
+    while(iter.node != UA_NULL) {
         open62541NodeStore_Entry *found_entry = (open62541NodeStore_Entry *)cds_lfht_iter_get_node(&iter);
         uatomic_inc(&found_entry->readcount);
         const UA_Node      *node = &found_entry->node;

+ 8 - 8
src/server/nodestore/open62541_nodestore_core.c

@@ -65,7 +65,7 @@ static INLINE hash_t hash_array(const UA_Byte *data, UA_UInt32 len,
 	static const uint32_t n = 0xe6546b64;
 	hash_t hash = seed;
 
-	if (data == NULL)
+	if (data == UA_NULL)
 		return 0;
 
 	blocks = (const uint32_t *) data;
@@ -132,7 +132,7 @@ static INLINE hash_t hash(const UA_NodeId *n) {
 
 static INLINE void clear_entry(open62541NodeStore *ns, const UA_Node **entry) {
 	const UA_Node *node;
-	if (entry == NULL || *entry == NULL)
+	if (entry == UA_NULL || *entry == UA_NULL)
 		return;
 
 	node = *entry;
@@ -173,7 +173,7 @@ static INLINE void clear_entry(open62541NodeStore *ns, const UA_Node **entry) {
 		UA_assert(UA_FALSE);
 		break;
 	}
-	entry = NULL;
+	entry = UA_NULL;
 	ns->count--;
 }
 
@@ -186,7 +186,7 @@ static INLINE UA_StatusCode find_entry(const open62541NodeStore *ns,
 	hash_t index = mod(h, size);
 	const UA_Node **e = &ns->entries[index];
 
-	if (*e == NULL) {
+	if (*e == UA_NULL) {
 		*entry = e;
 		return UA_STATUSCODE_BADINTERNALERROR;
 	}
@@ -204,7 +204,7 @@ static INLINE UA_StatusCode find_entry(const open62541NodeStore *ns,
 
 		e = &ns->entries[index];
 
-		if (*e == NULL) {
+		if (*e == UA_NULL) {
 			*entry = e;
 			return UA_STATUSCODE_BADINTERNALERROR;
 		}
@@ -250,7 +250,7 @@ static UA_StatusCode expand(open62541NodeStore *ns) {
 
 	const UA_Node **p = oentries;
 	do {
-		if (*p != NULL) {
+		if (*p != UA_NULL) {
 			const UA_Node **e;
 			find_entry(ns, &(*p)->nodeId, &e); /* We know this returns an empty entry here */
 			*e = *p;
@@ -320,7 +320,7 @@ UA_StatusCode open62541NodeStore_insert(open62541NodeStore *ns, UA_Node **node,
 	}
 
 	if (!(flags & UA_NODESTORE_INSERT_GETMANAGED))
-		*node = NULL;
+		*node = UA_NULL;
 
 	ns->count++;
 	return UA_STATUSCODE_GOOD;
@@ -356,7 +356,7 @@ void open62541NodeStore_iterate(const open62541NodeStore *ns,
 		UA_NodeStore_nodeVisitor visitor) {
 	for (UA_UInt32 i = 0; i < ns->size; i++) {
 		const UA_Node *node = ns->entries[i];
-		if (node != NULL)
+		if (node != UA_NULL)
 			visitor(node);
 	}
 }

+ 8 - 8
src/server/nodestore/open62541_nodestore_nodemanagement.c

@@ -41,7 +41,7 @@ static UA_Int32 AddReference(open62541NodeStore *nodestore, UA_Node *node,
 	UA_Int32 retval = AddSingleReference(node, reference);
 	UA_Node *targetnode;
 	UA_ReferenceNode inversereference;
-	if (retval != UA_STATUSCODE_GOOD || nodestore == NULL)
+	if (retval != UA_STATUSCODE_GOOD || nodestore == UA_NULL)
 		return retval;
 
 	// Do a copy every time?
@@ -62,7 +62,7 @@ static UA_Int32 AddReference(open62541NodeStore *nodestore, UA_Node *node,
 
 //TODO export to types, maybe?
 void UA_String_setToNULL(UA_String* string){
-	string->data = NULL;
+	string->data = UA_NULL;
 	string->length = -1;
 }
 
@@ -130,7 +130,7 @@ void UA_VariableNode_setAttributes(UA_VariableAttributes *variableAttributes, UA
 	}
 	if(variableAttributes->specifiedAttributes & UA_NODEATTRIBUTESMASK_ARRAYDIMENSIONS){
 		node->arrayDimensions = variableAttributes->arrayDimensions;
-		variableAttributes->arrayDimensions = NULL;
+		variableAttributes->arrayDimensions = UA_NULL;
 	}
 	if(variableAttributes->specifiedAttributes & UA_NODEATTRIBUTESMASK_ACCESSLEVEL){
 		node->accessLevel = variableAttributes->accessLevel;
@@ -164,10 +164,10 @@ UA_Int32 open62541NodeStore_AddReferences(const UA_RequestHeader *requestHeader,
 		UA_DiagnosticInfo *diagnosticInfos)
 {
 	for(UA_UInt32 i = 0;i<indicesSize;i++){
-		UA_Node *node = NULL;
+		UA_Node *node = UA_NULL;
 		open62541NodeStore *ns = open62541NodeStore_getNodeStore();
 		open62541NodeStore_get((const open62541NodeStore*)ns,(const UA_NodeId*)&referencesToAdd[indices[i]].sourceNodeId, (const UA_Node**)&node);
-		if(node == NULL){
+		if(node == UA_NULL){
 			addReferencesResults[indices[i]] = UA_STATUSCODE_BADSOURCENODEIDINVALID;
 			continue;
 		}
@@ -202,7 +202,7 @@ UA_Int32 open62541NodeStore_AddNodes(const UA_RequestHeader *requestHeader,UA_Ad
 		UA_UInt32 indicesSize, UA_AddNodesResult* addNodesResults,
 		UA_DiagnosticInfo *diagnosticInfos){
 
-	UA_Node *node = NULL;
+	UA_Node *node = UA_NULL;
 	for(UA_UInt32 i=0;i<indicesSize;i++){
 
 		const UA_Node *parent;
@@ -218,11 +218,11 @@ UA_Int32 open62541NodeStore_AddNodes(const UA_RequestHeader *requestHeader,UA_Ad
 		open62541NodeStore_get((const open62541NodeStore*)ns, (const UA_NodeId*)&nodesToAdd[indices[i]].requestedNewNodeId.nodeId , (const UA_Node**)&node);
 
 
-		if(node!=NULL){
+		if(node!=UA_NULL){
 			//todo or overwrite existing node?
 			continue;
 		}
-		UA_Node *newNode = NULL;
+		UA_Node *newNode = UA_NULL;
 		UA_UInt32 offset = 0;
 		switch(nodesToAdd[indices[i]].nodeClass){
 			case UA_NODECLASS_DATATYPE:

+ 3 - 3
src/server/nodestore/open62541_nodestore_view.c

@@ -163,7 +163,7 @@ static UA_StatusCode findRelevantReferenceTypes(open62541NodeStore *ns, const UA
 static void getBrowseResult(open62541NodeStore *ns, const UA_BrowseDescription *browseDescription,
                             UA_UInt32 maxReferences, UA_BrowseResult *browseResult) {
     UA_UInt32  relevantReferenceTypesSize = 0;
-    UA_NodeId *relevantReferenceTypes = NULL;
+    UA_NodeId *relevantReferenceTypes = UA_NULL;
 
     // if the referencetype is null, all referencetypes are returned
     UA_Boolean returnAll = UA_NodeId_isNull(&browseDescription->referenceTypeId);
@@ -201,7 +201,7 @@ static void getBrowseResult(open62541NodeStore *ns, const UA_BrowseDescription *
         UA_UInt32 currentRefs = 0;
         for(UA_Int32 i = 0;i < parentNode->referencesSize && currentRefs < maxReferences;i++) {
             // 1) Is the node relevant? This might retrieve the node from the nodestore
-            const UA_Node *currentNode = NULL;
+            const UA_Node *currentNode = UA_NULL;
             if(!isRelevantTargetNode(ns, browseDescription, returnAll, &parentNode->references[i], &currentNode,
                                      relevantReferenceTypes, relevantReferenceTypesSize))
                 continue;
@@ -211,7 +211,7 @@ static void getBrowseResult(open62541NodeStore *ns, const UA_BrowseDescription *
                                         &browseResult->references[currentRefs]) != UA_STATUSCODE_GOOD) {
                 UA_Array_delete(browseResult->references, currentRefs, &UA_TYPES[UA_REFERENCEDESCRIPTION]);
                 currentRefs = 0;
-                browseResult->references = NULL;
+                browseResult->references = UA_NULL;
                 browseResult->statusCode = UA_STATUSCODE_UNCERTAINNOTALLNODESAVAILABLE;
                 break;
             }

+ 6 - 6
src/server/ua_namespace_manager.c

@@ -44,10 +44,10 @@ UA_StatusCode UA_NamespaceManager_removeNamespace(UA_NamespaceManager *namespace
 {
 	UA_Namespace *namespace;
 	UA_NamespaceManager_getNamespace(namespaceManager,index,&namespace);
-	if(namespace == NULL)
+	if(namespace == UA_NULL)
 		return UA_STATUSCODE_BADNOTFOUND;
 
-    struct namespace_list_entry *current = NULL;
+    struct namespace_list_entry *current = UA_NULL;
     LIST_FOREACH(current, &namespaceManager->namespaces, pointers) {
         if(current->namespace.index  == index)
             break;
@@ -63,13 +63,13 @@ UA_StatusCode UA_NamespaceManager_removeNamespace(UA_NamespaceManager *namespace
 UA_Int32 UA_NamespaceManager_getNamespace(UA_NamespaceManager *namespaceManager, UA_UInt16 index, UA_Namespace **ns)
 {
 
-    struct namespace_list_entry *current = NULL;
+    struct namespace_list_entry *current = UA_NULL;
     LIST_FOREACH(current, &namespaceManager->namespaces, pointers) {
         if(current->namespace.index == index)
             break;
     }
     if(!current) {
-        *ns = NULL;
+        *ns = UA_NULL;
         return UA_STATUSCODE_BADNOTFOUND;
     }
     *ns = &current->namespace;
@@ -78,9 +78,9 @@ UA_Int32 UA_NamespaceManager_getNamespace(UA_NamespaceManager *namespaceManager,
 
 UA_Int32 UA_NamespaceManager_setNodeStore(UA_NamespaceManager *namespaceManager,UA_UInt16 index, UA_NodeStore *nodeStore)
 {
-	UA_Namespace *namespace = NULL;
+	UA_Namespace *namespace = UA_NULL;
 	UA_NamespaceManager_getNamespace(namespaceManager,index,&namespace);
-	if(namespace == NULL)
+	if(namespace == UA_NULL)
 	{
 		return UA_STATUSCODE_BADNOTFOUND;
 	}

+ 7 - 7
src/server/ua_nodestore_interface.c

@@ -6,7 +6,7 @@
 
 UA_StatusCode UA_NodeStore_registerAddNodesOperation(UA_NodeStore *nodeStore, UA_NodeStore_addNodes addNodes)
 {
-	if(nodeStore==NULL){
+	if(nodeStore==UA_NULL){
 		return UA_STATUSCODE_BADNOTFOUND;
 	}
 	nodeStore->addNodes = addNodes;
@@ -15,7 +15,7 @@ UA_StatusCode UA_NodeStore_registerAddNodesOperation(UA_NodeStore *nodeStore, UA
 
 UA_StatusCode UA_NodeStore_registerAddReferencesOperation(UA_NodeStore *nodeStore, UA_NodeStore_addReferences addReferences)
 {
-	if(nodeStore==NULL){
+	if(nodeStore==UA_NULL){
 		return UA_STATUSCODE_BADNOTFOUND;
 	}
 	nodeStore->addReferences = addReferences;
@@ -24,7 +24,7 @@ UA_StatusCode UA_NodeStore_registerAddReferencesOperation(UA_NodeStore *nodeStor
 
 UA_StatusCode UA_NodeStore_registerDeleteNodesOperation(UA_NodeStore *nodeStore, UA_NodeStore_deleteNodes deleteNodes)
 {
-	if(nodeStore==NULL){
+	if(nodeStore==UA_NULL){
 		return UA_STATUSCODE_BADNOTFOUND;
 	}
 	nodeStore->deleteNodes = deleteNodes;
@@ -33,7 +33,7 @@ UA_StatusCode UA_NodeStore_registerDeleteNodesOperation(UA_NodeStore *nodeStore,
 
 UA_StatusCode UA_NodeStore_registerDeleteReferencesOperation(UA_NodeStore *nodeStore, UA_NodeStore_deleteReferences deleteReferences)
 {
-	if(nodeStore==NULL){
+	if(nodeStore==UA_NULL){
 		return UA_STATUSCODE_BADNOTFOUND;
 	}
 	nodeStore->deleteReferences = deleteReferences;
@@ -43,7 +43,7 @@ UA_StatusCode UA_NodeStore_registerDeleteReferencesOperation(UA_NodeStore *nodeS
 
 UA_StatusCode UA_NodeStore_registerReadNodesOperation(UA_NodeStore *nodeStore, UA_NodeStore_readNodes readNodes)
 {
-	if(nodeStore==NULL){
+	if(nodeStore==UA_NULL){
 		return UA_STATUSCODE_BADNOTFOUND;
 	}
 	nodeStore->readNodes = readNodes;
@@ -52,7 +52,7 @@ UA_StatusCode UA_NodeStore_registerReadNodesOperation(UA_NodeStore *nodeStore, U
 
 UA_StatusCode UA_NodeStore_registerWriteNodesOperation(UA_NodeStore *nodeStore, UA_NodeStore_writeNodes writeNodes)
 {
-	if(nodeStore==NULL){
+	if(nodeStore==UA_NULL){
 		return UA_STATUSCODE_BADNOTFOUND;
 	}
 	nodeStore->writeNodes = writeNodes;
@@ -61,7 +61,7 @@ UA_StatusCode UA_NodeStore_registerWriteNodesOperation(UA_NodeStore *nodeStore,
 
 UA_StatusCode UA_NodeStore_registerBrowseNodesOperation(UA_NodeStore *nodeStore, UA_NodeStore_browseNodes browseNodes)
 {
-	if(nodeStore==NULL){
+	if(nodeStore==UA_NULL){
 		return UA_STATUSCODE_BADNOTFOUND;
 	}
 	nodeStore->browseNodes = browseNodes;

+ 6 - 6
src/server/ua_securechannel_manager.c

@@ -24,9 +24,9 @@ void UA_SecureChannelManager_deleteMembers(UA_SecureChannelManager *cm) {
     while(entry) {
         LIST_REMOVE(entry, pointers);
         if(entry->channel.session)
-            entry->channel.session->channel = NULL;
+            entry->channel.session->channel = UA_NULL;
         if(entry->channel.connection)
-            entry->channel.connection->channel = NULL;
+            entry->channel.connection->channel = UA_NULL;
         UA_SecureChannel_deleteMembers(&entry->channel);
         UA_free(entry);
         entry = LIST_FIRST(&cm->channels);
@@ -88,7 +88,7 @@ UA_StatusCode UA_SecureChannelManager_renew(UA_SecureChannelManager           *c
                                             UA_OpenSecureChannelResponse      *response) {
 
     UA_SecureChannel *channel = conn->channel;
-    if(channel == NULL)
+    if(channel == UA_NULL)
         return UA_STATUSCODE_BADINTERNALERROR;
 
     channel->securityToken.tokenId         = cm->lastTokenId++;
@@ -112,7 +112,7 @@ UA_StatusCode UA_SecureChannelManager_get(UA_SecureChannelManager *cm, UA_UInt32
             return UA_STATUSCODE_GOOD;
         }
     }
-    *channel = NULL;
+    *channel = UA_NULL;
     return UA_STATUSCODE_BADINTERNALERROR;
 }
 
@@ -123,9 +123,9 @@ UA_StatusCode UA_SecureChannelManager_close(UA_SecureChannelManager *cm, UA_UInt
     LIST_FOREACH(entry, &cm->channels, pointers) {
         if(entry->channel.securityToken.channelId == channelId) {
             if(entry->channel.connection)
-                entry->channel.connection->channel = NULL; // remove pointer back to the channel
+                entry->channel.connection->channel = UA_NULL; // remove pointer back to the channel
             if(entry->channel.session)
-                entry->channel.session->channel = NULL; // remove ponter back to the channel
+                entry->channel.session->channel = UA_NULL; // remove ponter back to the channel
             UA_SecureChannel_deleteMembers(&entry->channel);
             LIST_REMOVE(entry, pointers);
             UA_free(entry);

+ 2 - 2
src/server/ua_server.c

@@ -42,7 +42,7 @@ void ns0_addObjectNode(UA_Server *server, UA_NodeId REFTYPE_NODEID,
 		char* BROWSENAME, char* DISPLAYNAME, char* DESCRIPTION) {
 	UA_ObjectAttributes objAttr;
 	UA_AddNodesItem addNodesItem;
-	UA_Namespace *ns0 = NULL;
+	UA_Namespace *ns0 = UA_NULL;
 	UA_NamespaceManager_getNamespace(server->namespaceManager, 0, &ns0);
 	addNodesItem.parentNodeId = PARENTNODEID;
 	addNodesItem.requestedNewNodeId = REQ_NODEID;
@@ -69,7 +69,7 @@ void ns0_addVariableNode(UA_Server *server, UA_NodeId refTypeNodeId,
 		UA_DataValue *dataValue, UA_Int32 valueRank) {
 	UA_VariableAttributes varAttr;
 	UA_AddNodesItem addNodesItem;
-	UA_Namespace *ns0 = NULL;
+	UA_Namespace *ns0 = UA_NULL;
 	UA_NamespaceManager_getNamespace(server->namespaceManager, 0, &ns0);
 	addNodesItem.parentNodeId = parentNodeId;
 	addNodesItem.requestedNewNodeId = requestedNodeId;

+ 1 - 1
src/server/ua_server_binary.c

@@ -363,7 +363,7 @@ void UA_Server_processBinaryMessage(UA_Server *server, UA_Connection *connection
             	//no break
                 // if this fails, the connection is closed (no break on the case)
                 if(connection->state == UA_CONNECTION_ESTABLISHED &&
-                   connection->channel != NULL) {
+                   connection->channel != UA_NULL) {
                     processMessage(connection, server, msg, &pos);
                     break;
                 }

+ 4 - 4
src/server/ua_services_attribute.c

@@ -211,7 +211,7 @@ static UA_DataValue service_read_node(UA_Server *server,
 */
 void Service_Read(UA_Server *server, UA_Session *session,
 		const UA_ReadRequest *request, UA_ReadResponse *response) {
-	UA_assert(server != NULL && session != NULL && request != NULL && response != NULL);
+	UA_assert(server != UA_NULL && session != UA_NULL && request != UA_NULL && response != UA_NULL);
 
 	if (request->nodesToReadSize <= 0) {
 		response->responseHeader.serviceResult = UA_STATUSCODE_BADNOTHINGTODO;
@@ -260,7 +260,7 @@ void Service_Read(UA_Server *server, UA_Session *session,
 		UA_Namespace *tmpNamespace;
 		UA_NamespaceManager_getNamespace(server->namespaceManager,
 				associatedIndices[i], &tmpNamespace);
-		if (tmpNamespace != NULL) {
+		if (tmpNamespace != UA_NULL) {
 
 			//build up index array for each read operation onto a different namespace
 			UA_UInt32 n = 0;
@@ -291,7 +291,7 @@ void Service_Read(UA_Server *server, UA_Session *session,
 
 void Service_Write(UA_Server *server, UA_Session *session,
 		const UA_WriteRequest *request, UA_WriteResponse *response) {
-	UA_assert(server != NULL && session != NULL && request != NULL && response != NULL);
+	UA_assert(server != UA_NULL && session != UA_NULL && request != UA_NULL && response != UA_NULL);
 
 	response->resultsSize = request->nodesToWriteSize;
 
@@ -349,7 +349,7 @@ void Service_Write(UA_Server *server, UA_Session *session,
 		UA_Namespace *tmpNamespace;
 		UA_NamespaceManager_getNamespace(server->namespaceManager,
 				associatedIndices[i], &tmpNamespace);
-		if (tmpNamespace != NULL) {
+		if (tmpNamespace != UA_NULL) {
 
 			//build up index array for each read operation onto a different namespace
 			UA_UInt32 n = 0;

+ 3 - 3
src/server/ua_services_nodemanagement.c

@@ -9,7 +9,7 @@
 
 void Service_AddNodes(UA_Server *server, UA_Session *session,
 		const UA_AddNodesRequest *request, UA_AddNodesResponse *response) {
-	UA_assert(server != NULL && session != NULL);
+	UA_assert(server != UA_NULL && session != UA_NULL);
 
 	if (request->nodesToAddSize <= 0) {
 		response->responseHeader.serviceResult = UA_STATUSCODE_BADNOTHINGTODO;
@@ -60,7 +60,7 @@ void Service_AddNodes(UA_Server *server, UA_Session *session,
 		UA_Namespace *tmpNamespace;
 		UA_NamespaceManager_getNamespace(server->namespaceManager,
 				associatedIndices[i], &tmpNamespace);
-		if (tmpNamespace != NULL) {
+		if (tmpNamespace != UA_NULL) {
 			//build up index array for each read operation onto a different namespace
 			UA_UInt32 n = 0;
 			for (UA_Int32 j = 0; j < request->nodesToAddSize; j++) {
@@ -138,7 +138,7 @@ void Service_AddReferences(UA_Server *server, UA_Session *session,
 		UA_Namespace *tmpNamespace;
 		UA_NamespaceManager_getNamespace(server->namespaceManager,
 				associatedIndices[i], &tmpNamespace);
-		if (tmpNamespace != NULL) {
+		if (tmpNamespace != UA_NULL) {
 			//build up index array for each read operation onto a different namespace
 			UA_UInt32 n = 0;
 			for (UA_Int32 j = 0; j < request->referencesToAddSize; j++) {

+ 2 - 2
src/server/ua_services_session.c

@@ -38,7 +38,7 @@ void Service_ActivateSession(UA_Server *server,UA_SecureChannel *channel,
                                         (UA_NodeId*)&request->requestHeader.authenticationToken,
                                         &foundSession);
 
-	if(foundSession == NULL)
+	if(foundSession == UA_NULL)
         response->responseHeader.serviceResult = UA_STATUSCODE_BADIDENTITYTOKENINVALID;
     else
         channel->session = foundSession;
@@ -51,7 +51,7 @@ void Service_CloseSession(UA_Server *server, const UA_CloseSessionRequest *reque
 			(UA_NodeId*)&request->requestHeader.authenticationToken,
 			&foundSession);
 
-	if(foundSession == NULL){
+	if(foundSession == UA_NULL){
 		response->responseHeader.serviceResult = UA_STATUSCODE_BADIDENTITYTOKENINVALID;
 		return;
 	}

+ 3 - 3
src/server/ua_services_view.c

@@ -10,7 +10,7 @@ void Service_Browse(UA_Server *server, UA_Session *session,
     UA_Int32 *numberOfFoundIndices;
     UA_UInt16 *associatedIndices;
     UA_UInt32 differentNamespaceIndexCount = 0;
-	UA_assert(server != NULL && session != NULL && request != NULL && response != NULL);
+	UA_assert(server != UA_NULL && session != UA_NULL && request != UA_NULL && response != UA_NULL);
 
     if(request->nodesToBrowseSize <= 0) {
         response->responseHeader.serviceResult = UA_STATUSCODE_BADNOTHINGTODO;
@@ -45,7 +45,7 @@ void Service_Browse(UA_Server *server, UA_Session *session,
     for(UA_UInt32 i = 0; i < differentNamespaceIndexCount; i++){
     	UA_Namespace *tmpNamespace;
     	UA_NamespaceManager_getNamespace(server->namespaceManager,associatedIndices[i],&tmpNamespace);
-    	if(tmpNamespace != NULL){
+    	if(tmpNamespace != UA_NULL){
 
     	    //build up index array for each read operation onto a different namespace
     	    UA_UInt32 n = 0;
@@ -74,7 +74,7 @@ void Service_Browse(UA_Server *server, UA_Session *session,
 void Service_TranslateBrowsePathsToNodeIds(UA_Server *server, UA_Session *session,
                                            const UA_TranslateBrowsePathsToNodeIdsRequest *request,
                                            UA_TranslateBrowsePathsToNodeIdsResponse *response) {
-    UA_assert(server != NULL && session != NULL && request != NULL && response != NULL);
+    UA_assert(server != UA_NULL && session != UA_NULL && request != UA_NULL && response != UA_NULL);
 
     if(request->browsePathsSize <= 0) {
         response->responseHeader.serviceResult = UA_STATUSCODE_BADNOTHINGTODO;

+ 11 - 11
src/server/ua_session_manager.c

@@ -28,7 +28,7 @@ void UA_SessionManager_deleteMembers(UA_SessionManager *sessionManager) {
     while(current) {
         LIST_REMOVE(current, pointers);
         if(current->session.channel)
-            current->session.channel->session = NULL; // the channel is no longer attached to a session
+            current->session.channel->session = UA_NULL; // the channel is no longer attached to a session
         UA_Session_deleteMembers(&current->session);
         UA_free(current);
         current = LIST_FIRST(&sessionManager->sessions);
@@ -36,19 +36,19 @@ void UA_SessionManager_deleteMembers(UA_SessionManager *sessionManager) {
 }
 
 UA_StatusCode UA_SessionManager_getSessionById(UA_SessionManager *sessionManager, UA_NodeId *sessionId, UA_Session **session) {
-    if(sessionManager == NULL) {
-        *session = NULL;
+    if(sessionManager == UA_NULL) {
+        *session = UA_NULL;
         return UA_STATUSCODE_BADINTERNALERROR;
     }
 
-    struct session_list_entry *current = NULL;
+    struct session_list_entry *current = UA_NULL;
     LIST_FOREACH(current, &sessionManager->sessions, pointers) {
         if(UA_NodeId_equal(&current->session.sessionId, sessionId))
             break;
     }
 
     if(!current) {
-        *session = NULL;
+        *session = UA_NULL;
         return UA_STATUSCODE_BADINTERNALERROR;
     }
 
@@ -59,19 +59,19 @@ UA_StatusCode UA_SessionManager_getSessionById(UA_SessionManager *sessionManager
 }
 
 UA_StatusCode UA_SessionManager_getSessionByToken(UA_SessionManager *sessionManager, UA_NodeId *token, UA_Session **session) {
-    if(sessionManager == NULL) {
-        *session = NULL;
+    if(sessionManager == UA_NULL) {
+        *session = UA_NULL;
         return UA_STATUSCODE_BADINTERNALERROR;
     }
 
-    struct session_list_entry *current = NULL;
+    struct session_list_entry *current = UA_NULL;
     LIST_FOREACH(current, &sessionManager->sessions, pointers) {
         if(UA_NodeId_equal(&current->session.authenticationToken, token))
             break;
     }
 
     if(!current) {
-        *session = NULL;
+        *session = UA_NULL;
         return UA_STATUSCODE_BADINTERNALERROR;
     }
 
@@ -108,7 +108,7 @@ UA_StatusCode UA_SessionManager_createSession(UA_SessionManager *sessionManager,
 }
 
 UA_StatusCode UA_SessionManager_removeSession(UA_SessionManager *sessionManager, UA_NodeId  *sessionId) {
-    struct session_list_entry *current = NULL;
+    struct session_list_entry *current = UA_NULL;
     LIST_FOREACH(current, &sessionManager->sessions, pointers) {
         if(UA_NodeId_equal(&current->session.sessionId, sessionId))
             break;
@@ -119,7 +119,7 @@ UA_StatusCode UA_SessionManager_removeSession(UA_SessionManager *sessionManager,
 
     LIST_REMOVE(current, pointers);
     if(current->session.channel)
-        current->session.channel->session = NULL; // the channel is no longer attached to a session
+        current->session.channel->session = UA_NULL; // the channel is no longer attached to a session
     UA_Session_deleteMembers(&current->session);
     UA_free(current);
     return UA_STATUSCODE_GOOD;

+ 1 - 1
src/ua_connection.c

@@ -9,7 +9,7 @@ UA_StatusCode UA_Connection_init(UA_Connection *connection, UA_ConnectionConfig
                                  UA_Connection_closeCallback close, UA_Connection_writeCallback write) {
     connection->state          = UA_CONNECTION_OPENING;
     connection->localConf      = localConf;
-    connection->channel        = NULL;
+    connection->channel        = UA_NULL;
     connection->callbackHandle = callbackHandle;
     connection->close          = close;
     connection->write          = write;

+ 2 - 2
src/ua_securechannel.c

@@ -9,8 +9,8 @@ void UA_SecureChannel_init(UA_SecureChannel *channel) {
     UA_AsymmetricAlgorithmSecurityHeader_init(&channel->serverAsymAlgSettings);
     UA_ByteString_init(&channel->clientNonce);
     UA_ByteString_init(&channel->serverNonce);
-    channel->connection = NULL;
-    channel->session    = NULL;
+    channel->connection = UA_NULL;
+    channel->session    = UA_NULL;
 }
 
 void UA_SecureChannel_deleteMembers(UA_SecureChannel *channel) {

+ 17 - 17
src/ua_session.c

@@ -6,14 +6,14 @@
 #include "ua_statuscodes.h"
 
 UA_Session anonymousSession = {
-    .clientDescription =  {.applicationUri = {-1, NULL},
-                           .productUri = {-1, NULL},
-                           .applicationName = {.locale = {-1, NULL}, .text = {-1, NULL}},
+    .clientDescription =  {.applicationUri = {-1, UA_NULL},
+                           .productUri = {-1, UA_NULL},
+                           .applicationName = {.locale = {-1, UA_NULL}, .text = {-1, UA_NULL}},
                            .applicationType = UA_APPLICATIONTYPE_CLIENT,
-                           .gatewayServerUri = {-1, NULL},
-                           .discoveryProfileUri = {-1, NULL},
+                           .gatewayServerUri = {-1, UA_NULL},
+                           .discoveryProfileUri = {-1, UA_NULL},
                            .discoveryUrlsSize = -1,
-                           .discoveryUrls = NULL},
+                           .discoveryUrls = UA_NULL},
     .sessionName = {sizeof("Anonymous Session")-1, (UA_Byte*)"Anonymous Session"},
     .authenticationToken = {.namespaceIndex = 0, .identifierType = UA_NODEIDTYPE_NUMERIC, .identifier.numeric = 0}, // is never used, as this session is not stored in the sessionmanager
     .sessionId = {.namespaceIndex = 0, .identifierType = UA_NODEIDTYPE_NUMERIC, .identifier.numeric = 0},
@@ -21,17 +21,17 @@ UA_Session anonymousSession = {
     .maxResponseMessageSize = UA_UINT32_MAX,
     .timeout = UA_INT64_MAX,
     .validTill = UA_INT64_MAX,
-    .channel = NULL};
+    .channel = UA_NULL};
 
 UA_Session adminSession = {
-    .clientDescription =  {.applicationUri = {-1, NULL},
-                           .productUri = {-1, NULL},
-                           .applicationName = {.locale = {-1, NULL}, .text = {-1, NULL}},
+    .clientDescription =  {.applicationUri = {-1, UA_NULL},
+                           .productUri = {-1, UA_NULL},
+                           .applicationName = {.locale = {-1, UA_NULL}, .text = {-1, UA_NULL}},
                            .applicationType = UA_APPLICATIONTYPE_CLIENT,
-                           .gatewayServerUri = {-1, NULL},
-                           .discoveryProfileUri = {-1, NULL},
+                           .gatewayServerUri = {-1, UA_NULL},
+                           .discoveryProfileUri = {-1, UA_NULL},
                            .discoveryUrlsSize = -1,
-                           .discoveryUrls = NULL},
+                           .discoveryUrls = UA_NULL},
     .sessionName = {sizeof("Administrator Session")-1, (UA_Byte*)"Administrator Session"},
     .authenticationToken = {.namespaceIndex = 0, .identifierType = UA_NODEIDTYPE_NUMERIC, .identifier.numeric = 1}, // is never used, as this session is not stored in the sessionmanager
     .sessionId = {.namespaceIndex = 0, .identifierType = UA_NODEIDTYPE_NUMERIC, .identifier.numeric = 1},
@@ -39,7 +39,7 @@ UA_Session adminSession = {
     .maxResponseMessageSize = UA_UINT32_MAX,
     .timeout = UA_INT64_MAX,
     .validTill = UA_INT64_MAX,
-    .channel = NULL};
+    .channel = UA_NULL};
 
 UA_Session * UA_Session_new() {
     UA_Session *s = UA_alloc(sizeof(UA_Session));
@@ -51,7 +51,7 @@ UA_Session * UA_Session_new() {
 UA_StatusCode UA_Session_generateToken(UA_NodeId *newToken) {
     //Random token generation
     UA_StatusCode retval = UA_STATUSCODE_GOOD;
-    srand(time(NULL));
+    srand(time(UA_NULL));
 
     UA_Int32 i, r = 0;
     newToken->namespaceIndex = 0; // where else?
@@ -81,7 +81,7 @@ void UA_Session_init(UA_Session *session) {
     session->maxResponseMessageSize = 0;
     session->timeout = 0;
     UA_DateTime_init(&session->validTill);
-    session->channel = NULL;
+    session->channel = UA_NULL;
 }
 
 void UA_Session_deleteMembers(UA_Session *session) {
@@ -89,7 +89,7 @@ void UA_Session_deleteMembers(UA_Session *session) {
     UA_NodeId_deleteMembers(&session->authenticationToken);
     UA_NodeId_deleteMembers(&session->sessionId);
     UA_String_deleteMembers(&session->sessionName);
-    session->channel = NULL;
+    session->channel = UA_NULL;
 }
 
 void UA_Session_delete(UA_Session *session) {

+ 15 - 15
src/ua_types.c

@@ -129,7 +129,7 @@ void UA_Double_print(const UA_Double *p, FILE *stream) {
 UA_TYPE_NEW_DEFAULT(UA_String)
 void UA_String_init(UA_String *p) {
     p->length = -1;
-    p->data   = NULL;
+    p->data   = UA_NULL;
 }
 
 UA_TYPE_DELETE_DEFAULT(UA_String)
@@ -164,8 +164,8 @@ UA_Int32 UA_String_copycstring(char const *src, UA_String *dst) {
     UA_Int32 length = strlen(src);
     if(length == 0) {
         dst->length = 0;
-        dst->data = NULL;
-    } else if((dst->data = UA_alloc(length)) != NULL) {
+        dst->data = UA_NULL;
+    } else if((dst->data = UA_alloc(length)) != UA_NULL) {
         memcpy(dst->data, src, length);
         dst->length = length;
     } else {
@@ -275,7 +275,7 @@ int gettimeofday(struct timeval *tp, struct timezone *tzp) {
 UA_DateTime UA_DateTime_now() {
     UA_DateTime    dateTime;
     struct timeval tv;
-    gettimeofday(&tv, NULL);
+    gettimeofday(&tv, UA_NULL);
     dateTime = (tv.tv_sec + FILETIME_UNIXTIME_BIAS_SEC)
                * HUNDRED_NANOSEC_PER_SEC + tv.tv_usec * HUNDRED_NANOSEC_PER_USEC;
     return dateTime;
@@ -386,7 +386,7 @@ UA_StatusCode UA_ByteString_newMembers(UA_ByteString *p, UA_Int32 length) {
         return UA_STATUSCODE_GOOD;
     }
 
-    p->data   = NULL;
+    p->data   = UA_NULL;
     if(length < 0)
         p->length = -1;
     else
@@ -789,12 +789,12 @@ void UA_Variant_deleteMembers(UA_Variant *p) {
                 p->vt->delete(p->storage.data.dataPtr);
             else
                 UA_Array_delete(p->storage.data.dataPtr, p->storage.data.arrayLength, p->vt);
-            p->storage.data.dataPtr = NULL;
+            p->storage.data.dataPtr = UA_NULL;
         }
 
         if(p->storage.data.arrayDimensions) {
             UA_free(p->storage.data.arrayDimensions);
-            p->storage.data.arrayDimensions = NULL;
+            p->storage.data.arrayDimensions = UA_NULL;
         }
         return;
     }
@@ -808,8 +808,8 @@ UA_TYPE_NEW_DEFAULT(UA_Variant)
 void UA_Variant_init(UA_Variant *p) {
     p->storageType = UA_VARIANT_DATA;
     p->storage.data.arrayLength = -1;  // no element, p->data == UA_NULL
-    p->storage.data.dataPtr        = NULL;
-    p->storage.data.arrayDimensions       = NULL;
+    p->storage.data.dataPtr        = UA_NULL;
+    p->storage.data.arrayDimensions       = UA_NULL;
     p->storage.data.arrayDimensionsLength = -1;
     p->vt = &UA_TYPES[UA_INVALIDTYPE];
 }
@@ -913,14 +913,14 @@ void UA_DiagnosticInfo_deleteMembers(UA_DiagnosticInfo *p) {
     UA_String_deleteMembers(&p->additionalInfo);
     if((p->encodingMask & UA_DIAGNOSTICINFO_ENCODINGMASK_INNERDIAGNOSTICINFO) && p->innerDiagnosticInfo) {
         UA_DiagnosticInfo_delete(p->innerDiagnosticInfo);
-        p->innerDiagnosticInfo = NULL;
+        p->innerDiagnosticInfo = UA_NULL;
     }
 }
 
 void UA_DiagnosticInfo_init(UA_DiagnosticInfo *p) {
     UA_String_init(&p->additionalInfo);
     p->encodingMask = 0;
-    p->innerDiagnosticInfo = NULL;
+    p->innerDiagnosticInfo = UA_NULL;
     UA_StatusCode_init(&p->innerStatusCode);
     p->locale              = 0;
     p->localizedText       = 0;
@@ -995,7 +995,7 @@ UA_StatusCode UA_InvalidType_copy(UA_InvalidType const *src, UA_InvalidType *dst
 }
 
 UA_InvalidType * UA_InvalidType_new() {
-    return NULL;
+    return UA_NULL;
 }
 
 #ifdef DEBUG
@@ -1010,14 +1010,14 @@ void UA_InvalidType_print(const UA_InvalidType *p, FILE *stream) {
 
 UA_StatusCode UA_Array_new(void **p, UA_Int32 noElements, const UA_VTable_Entry *vt) {
     if(noElements <= 0) {
-        *p = NULL;
+        *p = UA_NULL;
         return UA_STATUSCODE_GOOD;
     }
     
     // Arrays cannot be larger than 2^16 elements. This was randomly chosen so
     // that the development VM does not blow up during fuzzing tests.
     if(noElements > (1<<15)) {
-        *p = NULL;
+        *p = UA_NULL;
         return UA_STATUSCODE_BADOUTOFMEMORY;
     }
 
@@ -1066,7 +1066,7 @@ UA_StatusCode UA_Array_copy(const void *src, UA_Int32 noElements, const UA_VTabl
     if(retval) {
         i--; // undo last increase
         UA_Array_delete(*dst, i, vt);
-        *dst = NULL;
+        *dst = UA_NULL;
     }
 
     return retval;

+ 10 - 10
src/ua_types_encoding_binary.c

@@ -80,7 +80,7 @@ static UA_StatusCode UA_Array_encodeBinary_asExtensionObject(const void *src, UA
 UA_StatusCode UA_Array_decodeBinary(const UA_ByteString *src, UA_UInt32 *offset, UA_Int32 length,
                                     const UA_VTable_Entry *vt, void **dst) {
     if(length <= 0) {
-        *dst = NULL;
+        *dst = UA_NULL;
         return UA_STATUSCODE_GOOD;
     }
 
@@ -104,7 +104,7 @@ UA_StatusCode UA_Array_decodeBinary(const UA_ByteString *src, UA_UInt32 *offset,
             arr += memSize;
         }
         UA_free(*dst);
-        *dst = NULL;
+        *dst = UA_NULL;
     }
 
     return retval;
@@ -613,18 +613,18 @@ UA_TYPE_ENCODEBINARY(UA_QualifiedName,
 
 UA_UInt32 UA_LocalizedText_calcSizeBinary(UA_LocalizedText const *p) {
     UA_UInt32 length = 1; // for encodingMask
-    if(p->locale.data != NULL)
+    if(p->locale.data != UA_NULL)
         length += UA_String_calcSizeBinary(&p->locale);
-    if(p->text.data != NULL)
+    if(p->text.data != UA_NULL)
         length += UA_String_calcSizeBinary(&p->text);
     return length;
 }
 
 UA_TYPE_ENCODEBINARY(UA_LocalizedText,
                      UA_Byte encodingMask = 0;
-                     if(src->locale.data != NULL)
+                     if(src->locale.data != UA_NULL)
                          encodingMask |= UA_LOCALIZEDTEXT_ENCODINGMASKTYPE_LOCALE;
-                     if(src->text.data != NULL)
+                     if(src->text.data != UA_NULL)
                          encodingMask |= UA_LOCALIZEDTEXT_ENCODINGMASKTYPE_TEXT;
                      retval |= UA_Byte_encodeBinary(&encodingMask, dst, offset);
                      if(encodingMask & UA_LOCALIZEDTEXT_ENCODINGMASKTYPE_LOCALE)
@@ -802,7 +802,7 @@ UA_UInt32 UA_Variant_calcSizeBinary(UA_Variant const *p) {
     }
         
     arrayLength = data->arrayLength;
-    if(data->dataPtr == NULL)
+    if(data->dataPtr == UA_NULL)
         arrayLength = -1;
 
     length = sizeof(UA_Byte); //p->encodingMask
@@ -815,7 +815,7 @@ UA_UInt32 UA_Variant_calcSizeBinary(UA_Variant const *p) {
             length += 9;  // 4 byte nodeid + 1 byte encoding + 4 byte bytestring length
     }
 
-    if(arrayLength != 1 && data->arrayDimensions != NULL) {
+    if(arrayLength != 1 && data->arrayDimensions != UA_NULL) {
         if(is_builtin(&p->vt->typeId))
             length += UA_Array_calcSizeBinary(data->arrayDimensionsLength, &UA_TYPES[UA_INT32], data->arrayDimensions);
         else
@@ -843,7 +843,7 @@ UA_TYPE_ENCODEBINARY(UA_Variant,
                      }
 
                      isArray       = data->arrayLength != 1;  // a single element is not an array
-                     hasDimensions = isArray && data->arrayDimensions != NULL;
+                     hasDimensions = isArray && data->arrayDimensions != UA_NULL;
                      isBuiltin     = is_builtin(&src->vt->typeId);
 
                      encodingByte = 0;
@@ -1000,7 +1000,7 @@ UA_StatusCode UA_DiagnosticInfo_decodeBinary(UA_ByteString const *src, UA_UInt32
         if((dst->innerDiagnosticInfo = UA_alloc(sizeof(UA_DiagnosticInfo)))) {
             if(UA_DiagnosticInfo_decodeBinary(src, offset, dst->innerDiagnosticInfo) != UA_STATUSCODE_GOOD) {
                 UA_free(dst->innerDiagnosticInfo);
-                dst->innerDiagnosticInfo = NULL;
+                dst->innerDiagnosticInfo = UA_NULL;
                 retval |= UA_STATUSCODE_BADINTERNALERROR;
             }
         } else {

+ 10 - 10
tests/check_builtin.c

@@ -72,7 +72,7 @@ START_TEST(UA_DiagnosticInfo_calcSizeShallWorkOnExample) {
 END_TEST
 START_TEST(UA_String_calcSizeWithNegativLengthShallReturnEncodingSize) {
 	// given
-	UA_String arg = { -1, NULL };
+	UA_String arg = { -1, UA_NULL };
 	// when
 	UA_UInt32 encodingSize = UA_String_calcSizeBinary(&arg);
 	// then
@@ -90,7 +90,7 @@ START_TEST(UA_String_calcSizeWithNegativLengthAndValidPointerShallReturnEncoding
 END_TEST
 START_TEST(UA_String_calcSizeWithZeroLengthShallReturnEncodingSize) {
 	// given
-	UA_String arg = { 0, NULL };
+	UA_String arg = { 0, UA_NULL };
 	// when
 	UA_UInt32 encodingSize = UA_String_calcSizeBinary(&arg);
 	// then
@@ -275,9 +275,9 @@ START_TEST(UA_Variant_calcSizeVariableSizeArrayShallReturnEncodingSize) {
 #define ARRAY_LEN 3
 	arg.storage.data.arrayLength = ARRAY_LEN;
 	UA_String strings[3];
-	strings[0] = (UA_String) {-1, NULL };
+	strings[0] = (UA_String) {-1, UA_NULL };
 	strings[1] = (UA_String) {3, (UA_Byte *)"PLT" };
-	strings[2] = (UA_String) {47, NULL };
+	strings[2] = (UA_String) {47, UA_NULL };
 	arg.storage.data.dataPtr   = (void *)strings;
 	// when
 	UA_UInt32 encodingSize = UA_Variant_calcSizeBinary(&arg);
@@ -558,7 +558,7 @@ START_TEST(UA_String_decodeWithNegativeSizeShallNotAllocateMemoryAndNullPtr) {
 	// then
 	ck_assert_int_eq(retval, UA_STATUSCODE_GOOD);
 	ck_assert_int_eq(dst.length, -1);
-	ck_assert_ptr_eq(dst.data, NULL);
+	ck_assert_ptr_eq(dst.data, UA_NULL);
 }
 END_TEST
 START_TEST(UA_String_decodeWithZeroSizeShallNotAllocateMemoryAndNullPtr) {
@@ -574,7 +574,7 @@ START_TEST(UA_String_decodeWithZeroSizeShallNotAllocateMemoryAndNullPtr) {
 	// then
 	ck_assert_int_eq(retval, UA_STATUSCODE_GOOD);
 	ck_assert_int_eq(dst.length, -1); // shall we keep zero?
-	ck_assert_ptr_eq(dst.data, NULL);
+	ck_assert_ptr_eq(dst.data, UA_NULL);
 }
 END_TEST
 START_TEST(UA_NodeId_decodeTwoByteShallReadTwoBytesAndSetNamespaceToZero) {
@@ -1183,7 +1183,7 @@ START_TEST(UA_ExtensionObject_copyShallWorkOnExample) {
 	ck_assert_int_eq(valueCopied.typeId.identifier.numeric, value.typeId.identifier.numeric);
 
 	//finally
-	value.body.data = NULL; // we cannot free the static string
+	value.body.data = UA_NULL; // we cannot free the static string
 	UA_ExtensionObject_deleteMembers(&value);
 	UA_ExtensionObject_deleteMembers(&valueCopied);
 }
@@ -1269,8 +1269,8 @@ START_TEST(UA_DiagnosticInfo_copyShallWorkOnExample) {
 	ck_assert_int_eq(copiedValue.symbolicId, value.symbolicId);
 
 	//finally
-	value.additionalInfo.data = NULL; // do not delete the static string
-	value.innerDiagnosticInfo = NULL; // do not delete the static innerdiagnosticinfo
+	value.additionalInfo.data = UA_NULL; // do not delete the static string
+	value.innerDiagnosticInfo = UA_NULL; // do not delete the static innerdiagnosticinfo
 	UA_DiagnosticInfo_deleteMembers(&value);
 	UA_DiagnosticInfo_deleteMembers(&copiedValue);
 
@@ -1423,7 +1423,7 @@ START_TEST(UA_Variant_copyShallWorkOnSingleValueExample) {
 	ck_assert_int_eq(value.storage.data.arrayLength, copiedValue.storage.data.arrayLength);
 
 	//finally
-	((UA_String*)value.storage.data.dataPtr)->data = NULL; // the string is statically allocated. do not free it.
+	((UA_String*)value.storage.data.dataPtr)->data = UA_NULL; // the string is statically allocated. do not free it.
 	UA_Variant_deleteMembers(&value);
 	UA_Variant_deleteMembers(&copiedValue);
 }

+ 1 - 1
tests/check_indexedList.c

@@ -19,7 +19,7 @@ void freer(void* payload){
 }
 
 _Bool matcher(void* payload){
-	if(payload == NULL){
+	if(payload == UA_NULL){
 		return FALSE;
 	}
 	if(*((UA_Int32*)payload) == 42){

+ 2 - 2
tests/check_memory.c

@@ -15,7 +15,7 @@ START_TEST(newAndEmptyObjectShallBeDeleted) {
 	UA_TYPES[_i].print(obj, stdout);
 #endif
 	// then
-	ck_assert_ptr_ne(obj, NULL);
+	ck_assert_ptr_ne(obj, UA_NULL);
     // finally
 	UA_TYPES[_i].delete(obj);
 }
@@ -109,7 +109,7 @@ END_TEST
 
 START_TEST(decodeScalarBasicTypeFromRandomBufferShallSucceed) {
 	// given
-	void *obj1 = NULL;
+	void *obj1 = UA_NULL;
 	UA_ByteString msg1;
 	UA_Int32 retval = UA_STATUSCODE_GOOD;
 	UA_Int32 buflen = 256;

+ 11 - 11
tests/check_nodestore.c

@@ -16,7 +16,7 @@ int zeroCnt = 0;
 int visitCnt = 0;
 void checkZeroVisitor(const UA_Node* node) {
 	visitCnt++;
-	if (node == NULL) zeroCnt++;
+	if (node == UA_NULL) zeroCnt++;
 }
 
 void printVisitor(const UA_Node* node) {
@@ -24,7 +24,7 @@ void printVisitor(const UA_Node* node) {
 }
 
 START_TEST(test_open62541NodeStore) {
-	open62541NodeStore *ns = NULL;
+	open62541NodeStore *ns = UA_NULL;
 	open62541NodeStore_new(&ns);
 	open62541NodeStore_delete(ns);
 }
@@ -48,7 +48,7 @@ START_TEST(findNodeInopen62541NodeStoreWithSingleEntry) {
 	open62541NodeStore_new(&ns);
 	UA_Node* n1; createNode(&n1,0,2253);
 	open62541NodeStore_insert(ns, &n1, UA_NODESTORE_INSERT_UNIQUE | UA_NODESTORE_INSERT_GETMANAGED);
-	const UA_Node* nr = NULL;
+	const UA_Node* nr = UA_NULL;
 	UA_Int32 retval;
 	// when
 	retval = open62541NodeStore_get(ns,&n1->nodeId,&nr);
@@ -70,13 +70,13 @@ START_TEST(failToFindNodeInOtheropen62541NodeStore) {
    	rcu_register_thread();
 #endif
 	// given
-	open62541NodeStore *ns = NULL;
+	open62541NodeStore *ns = UA_NULL;
 	open62541NodeStore_new(&ns);
 
 	UA_Node* n1; createNode(&n1,0,2253); open62541NodeStore_insert(ns, &n1, 0);
 	UA_Node* n2; createNode(&n2,0,2253); open62541NodeStore_insert(ns, &n2, 0);
 
-	const UA_Node* nr = NULL;
+	const UA_Node* nr = UA_NULL;
 	// when
 	UA_Node* n; createNode(&n,1,2255);
 	UA_Int32 retval = open62541NodeStore_get(ns,&n->nodeId, &nr);
@@ -106,7 +106,7 @@ START_TEST(findNodeInopen62541NodeStoreWithSeveralEntries) {
 	UA_Node* n5; createNode(&n5,0,1); open62541NodeStore_insert(ns, &n5, 0);
 	UA_Node* n6; createNode(&n6,0,12); open62541NodeStore_insert(ns, &n6, 0);
 
-	const UA_Node* nr = NULL;
+	const UA_Node* nr = UA_NULL;
 	UA_Int32 retval;
 	// when
 	retval = open62541NodeStore_get(ns,&(n3->nodeId),&nr);
@@ -164,7 +164,7 @@ START_TEST(findNodeInExpandedNamespace) {
 	for (; i<200; i++) {
 		createNode(&n,0,i); open62541NodeStore_insert(ns, &n, 0);
 	}
-	const UA_Node* nr = NULL;
+	const UA_Node* nr = UA_NULL;
 	UA_Int32 retval;
 	// when
 	createNode(&n,0,25);
@@ -223,7 +223,7 @@ START_TEST(failToFindNonExistantNodeInopen62541NodeStoreWithSeveralEntries) {
 	UA_Node* n5; createNode(&n5,0,1); open62541NodeStore_insert(ns, &n5, 0);
 	UA_Node* n6; createNode(&n6,0,12); 
 
-	const UA_Node* nr = NULL;
+	const UA_Node* nr = UA_NULL;
 	UA_Int32 retval;
 	// when
 	retval = open62541NodeStore_get(ns, &(n6->nodeId), &nr);
@@ -266,7 +266,7 @@ void *profileGetThread(void *arg) {
 	}
 	rcu_unregister_thread();
 	
-	return NULL;
+	return UA_NULL;
 }
 #endif
 
@@ -291,10 +291,10 @@ START_TEST(profileGetDelete) {
 	struct open62541NodeStoreProfileTest p[THREADS];
 	for (int i = 0; i < THREADS; i++) {
 		p[i] = (struct open62541NodeStoreProfileTest){ns, i*(N/THREADS), (i+1)*(N/THREADS), 50};
-		pthread_create(&t[i], NULL, profileGetThread, &p[i]);
+		pthread_create(&t[i], UA_NULL, profileGetThread, &p[i]);
 	}
 	for (int i = 0; i < THREADS; i++)
-		pthread_join(t[i], NULL);
+		pthread_join(t[i], UA_NULL);
 	end = clock();
 	printf("Time for %d create/get/delete on %d threads in a namespace: %fs.\n", N, THREADS, (double)(end - begin) / CLOCKS_PER_SEC);
 #else

+ 3 - 3
tests/check_stack.c

@@ -79,7 +79,7 @@ UA_Int32 stackTestFixture_delete(UA_UInt32 fixtureHandle) {
 stackTestFixture *stackTestFixture_getFixture(UA_UInt32 fixtureHandle) {
 	if(fixtureHandle < MAX_FIXTURES && ( fixturesMap & (1 << fixtureHandle)))
 		return fixtures[fixtureHandle];
-	return NULL;
+	return UA_NULL;
 }
 
 /** @brief write message provided in the gather buffers to the buffer of the fixture */
@@ -329,7 +329,7 @@ UA_Byte pkt_MSG_CreateSession[] = {
 START_TEST(emptyIndicationShallYieldNoResponse) {
 	// given
 	UA_Int32 handle = stackTestFixture_create(responseMsg, closerCallback);
-	UA_ByteString message = { -1, (UA_Byte *)NULL };
+	UA_ByteString message = { -1, (UA_Byte *)UA_NULL };
 
 	// when
 	indicateMsg(handle, &message);
@@ -424,7 +424,7 @@ START_TEST(validCreateSessionShallCreateSession) {
 
 
 	SL_ChannelManager_getChannel(25,&channel);
-	ck_assert_ptr_ne(channel,NULL);
+	ck_assert_ptr_ne(channel,UA_NULL);