Browse Source

fix win32 cross-compilation

Julius Pfrommer 9 years ago
parent
commit
4e6ba890a8
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/ua_types.c
  2. 1 1
      src/ua_types_encoding_binary.c

+ 1 - 1
src/ua_types.c

@@ -1012,7 +1012,7 @@ UA_StatusCode UA_Array_new(void **p, UA_Int32 noElements, const UA_DataType *dat
         return UA_STATUSCODE_BADINTERNALERROR;
     }
 
-    if(dataType->memSize * noElements < 0 || dataType->memSize * noElements > MAX_ARRAY_SIZE )
+    if((UA_Int32)dataType->memSize * noElements < 0 || dataType->memSize * noElements > MAX_ARRAY_SIZE )
         return UA_STATUSCODE_BADOUTOFMEMORY;
 
     *p = malloc(dataType->memSize * (size_t)noElements);

+ 1 - 1
src/ua_types_encoding_binary.c

@@ -1231,7 +1231,7 @@ UA_StatusCode UA_Array_decodeBinary(const UA_ByteString *src, size_t *offset, UA
         return UA_STATUSCODE_GOOD;
     }
 
-    if(dataType->memSize * noElements < 0 || dataType->memSize * noElements > MAX_ARRAY_SIZE )
+    if((UA_Int32)dataType->memSize * noElements < 0 || dataType->memSize * noElements > MAX_ARRAY_SIZE )
         return UA_STATUSCODE_BADOUTOFMEMORY;
 
     // filter out arrays that can obviously not be parsed