Changed a bunch of debug and information printfs so that they have a better chance of working on systems where int is smaller than 32 bits also fixed the signed/unsigned type of some to match the type of the arguments.

This commit is contained in:
petermcs
2010-01-26 21:30:38 +00:00
parent 0b76dd08c9
commit bfa8936bf5
25 changed files with 75 additions and 75 deletions
+3 -3
View File
@@ -2007,7 +2007,7 @@ void testBACDCodeUnsignedValue(
len = decode_unsigned(&array[len], len_value, &decoded_value);
ct_test(pTest, decoded_value == value);
if (decoded_value != value) {
printf("value=%u decoded_value=%u\n", value, decoded_value);
printf("value=%lu decoded_value=%lu\n", (unsigned long)value, (unsigned long)decoded_value);
print_apdu(&array[0], sizeof(array));
}
encode_application_unsigned(&encoded_array[0], decoded_value);
@@ -2075,14 +2075,14 @@ void testBACDCodeSignedValue(
ct_test(pTest, tag_number == BACNET_APPLICATION_TAG_SIGNED_INT);
ct_test(pTest, decoded_value == value);
if (decoded_value != value) {
printf("value=%d decoded_value=%d\n", value, decoded_value);
printf("value=%ld decoded_value=%ld\n", (long)value, (long)decoded_value);
print_apdu(&array[0], sizeof(array));
}
encode_application_signed(&encoded_array[0], decoded_value);
diff = memcmp(&array[0], &encoded_array[0], sizeof(array));
ct_test(pTest, diff == 0);
if (diff) {
printf("value=%d decoded_value=%d\n", value, decoded_value);
printf("value=%ld decoded_value=%ld\n", (long)value, (long)decoded_value);
print_apdu(&array[0], sizeof(array));
print_apdu(&encoded_array[0], sizeof(array));
}