Julius Pfrommer %!s(int64=9) %!d(string=hai) anos
pai
achega
b5bca6bd7d
Modificáronse 3 ficheiros con 7 adicións e 8 borrados
  1. 5 5
      include/ua_types.h
  2. 1 2
      src/server/ua_server_binary.c
  3. 1 1
      tests/check_builtin.c

+ 5 - 5
include/ua_types.h

@@ -378,11 +378,11 @@ UA_Boolean UA_EXPORT UA_NodeId_isNull(const UA_NodeId *p);
 
 /* ExpandedNodeId */
 UA_Boolean UA_EXPORT UA_ExpandedNodeId_isNull(const UA_ExpandedNodeId *p);
-#define UA_EXPANDEDNODEID_STATIC(NUMERICID, NAMESPACE)                                                   \
-    (UA_ExpandedNodeId){.nodeId = {.namespaceIndex = NAMESPACE, .identifierType = UA_NODEIDTYPE_NUMERIC, \
-                                   .identifier.numeric = NUMERICID},                                     \
-            .serverIndex = 0, .namespaceUri = {.length = -1, .data = UA_NULL} }
-
+#define UA_EXPANDEDNODEID_STATIC(NAMESPACE, NUMERICID) (UA_ExpandedNodeId) {             \
+        .nodeId = {.namespaceIndex = NAMESPACE, .identifierType = UA_NODEIDTYPE_NUMERIC, \
+                   .identifier.numeric = NUMERICID },                                    \
+        .serverIndex = 0, .namespaceUri = {.length = -1, .data = UA_NULL} }
+    
 /* QualifiedName */
 UA_StatusCode UA_EXPORT UA_QualifiedName_copycstring(char const *src, UA_QualifiedName *dst);
 #define UA_QUALIFIEDNAME_ASSIGN(VARIABLE, STRING) do {          \

+ 1 - 2
src/server/ua_server_binary.c

@@ -96,8 +96,7 @@ static void processOPN(UA_Connection *connection, UA_Server *server, const UA_By
     respHeader.messageHeader.messageSize = 0;
     respHeader.secureChannelId = p.securityToken.channelId;
 
-    UA_NodeId responseType;
-    UA_NODEID_ASSIGN(responseType, UA_NS0ID_OPENSECURECHANNELRESPONSE, 0);
+    UA_NodeId responseType = UA_NODEID_STATIC(0, UA_NS0ID_OPENSECURECHANNELRESPONSE);
     responseType.identifier.numeric += UA_ENCODINGOFFSET_BINARY;
 
     respHeader.messageHeader.messageSize =

+ 1 - 1
tests/check_builtin.c

@@ -1609,7 +1609,7 @@ START_TEST(UA_ExtensionObject_encodeDecodeShallWorkOnExtensionObject) {
 	varAttr.dataType.identifier.numeric = UA_TYPES_IDS[UA_TYPES_INT32];
 	UA_Variant_init(&varAttr.value);
 	varAttr.value.type = &UA_TYPES[UA_TYPES_INT32];
-    UA_NODEID_ASSIGN(varAttr.value.typeId, UA_TYPES_IDS[UA_TYPES_INT32], 0);
+    UA_NODEID_ASSIGN(varAttr.value.typeId, 0, UA_TYPES_IDS[UA_TYPES_INT32]);
 	varAttr.value.storage.data.dataPtr = &val;
 	varAttr.value.storage.data.arrayLength = 1;
 	varAttr.userWriteMask = 41;