Explorar o código

compatibleValueRankArrayDimensions/compatibleValueRanks:
- cast compared constant value explicitly so same type like variable operand (signed UA_Int32)
- produced positive falses before

Thomas Bender %!s(int64=7) %!d(string=hai) anos
pai
achega
5b718739ee
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/server/ua_services_attribute.c

+ 2 - 2
src/server/ua_services_attribute.c

@@ -599,7 +599,7 @@ compatibleValueRankArrayDimensions(UA_Int32 valueRank, size_t arrayDimensionsSiz
             return false;
             return false;
         break;
         break;
     default: /* >= 1: the value is an array with the specified number of dimensions */
     default: /* >= 1: the value is an array with the specified number of dimensions */
-        if(valueRank < 0)
+        if(valueRank < (UA_Int32) 0)
             return false;
             return false;
         /* Must hold if the array has a defined length. Null arrays (length -1)
         /* Must hold if the array has a defined length. Null arrays (length -1)
          * need to be caught before. */
          * need to be caught before. */
@@ -624,7 +624,7 @@ compatibleValueRanks(UA_Int32 valueRank, UA_Int32 constraintValueRank) {
             return false;
             return false;
         break;
         break;
     case 0: /* the value is an array with one or more dimensions */
     case 0: /* the value is an array with one or more dimensions */
-        if(valueRank < 0)
+        if(valueRank < (UA_Int32) 0)
             return false;
             return false;
         break;
         break;
     default: /* >= 1: the value is an array with the specified number of dimensions */
     default: /* >= 1: the value is an array with the specified number of dimensions */