Explorar o código

fix: bug in old gcc versions that disallows {0} initialisation

More information here:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36750
Julius Pfrommer %!s(int64=8) %!d(string=hai) anos
pai
achega
794b2c1ed3
Modificáronse 1 ficheiros con 9 adicións e 5 borrados
  1. 9 5
      src/ua_types.c

+ 9 - 5
src/ua_types.c

@@ -14,11 +14,15 @@
  * datatypes are autogenerated. */
 
 /* Static definition of NULL type instances */
-const UA_String UA_STRING_NULL = {0};
-const UA_ByteString UA_BYTESTRING_NULL = {0};
-const UA_Guid UA_GUID_NULL = {0};
-const UA_NodeId UA_NODEID_NULL = {0};
-const UA_ExpandedNodeId UA_EXPANDEDNODEID_NULL = {0};
+const UA_String UA_STRING_NULL = {.length = 0, .data = NULL };
+const UA_ByteString UA_BYTESTRING_NULL = {.length = 0, .data = NULL };
+const UA_Guid UA_GUID_NULL = {.data1 = 0, .data2 = 0, .data3 = 0,
+                              .data4 = {0,0,0,0,0,0,0,0}};
+const UA_NodeId UA_NODEID_NULL = {0, UA_NODEIDTYPE_NUMERIC, {0}};
+const UA_ExpandedNodeId UA_EXPANDEDNODEID_NULL = {
+       .nodeId = {.namespaceIndex = 0, .identifierType = UA_NODEIDTYPE_NUMERIC,
+                  .identifier.numeric = 0 },
+       .namespaceUri = {.length = 0, .data = NULL}, .serverIndex = 0 };
 
 /***************************/
 /* Random Number Generator */