Ver código fonte

added specification obj == decode(encode(obj)) breaks build

Leon Urbas 11 anos atrás
pai
commit
be90498c14
2 arquivos alterados com 2 adições e 2 exclusões
  1. 1 1
      include/ua_basictypes.h
  2. 1 1
      src/ua_basictypes.c

+ 1 - 1
include/ua_basictypes.h

@@ -45,7 +45,7 @@ UA_ByteString;
 /* Function return values */
 #define UA_SUCCESS 0
 #define UA_NO_ERROR UA_SUCCESS
-#define UA_ERROR (0x01)
+#define UA_ERROR (0x01 << 31)
 #define UA_ERR_INCONSISTENT  (UA_ERROR | (0x01 << 1))
 #define UA_ERR_INVALID_VALUE (UA_ERROR | (0x01 << 2))
 #define UA_ERR_NO_MEMORY     (UA_ERROR | (0x01 << 3))

+ 1 - 1
src/ua_basictypes.c

@@ -1244,7 +1244,7 @@ UA_Int32 UA_Variant_decodeBinary(UA_ByteString const * src, UA_Int32 *pos, UA_Va
 	ns0Id = dst->encodingMask & UA_VARIANT_ENCODINGMASKTYPE_TYPEID_MASK;
 
 	// initialize vTable
-	if (ns0Id < UA_BOOLEAN && ns0Id > UA_DOUBLECOMPLEXNUMBERTYPE) {
+	if (UA_toIndex(ns0Id) == UA_ERR_INVALID_VALUE) {
 		return UA_ERR_INVALID_VALUE;
 	} else {
 		dst->vt = &UA_[UA_toIndex(ns0Id)];