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:
@@ -90,9 +90,9 @@ void handler_alarm_ack(
|
||||
*/
|
||||
#if PRINT_ENABLED
|
||||
fprintf(stderr,
|
||||
"Alarm Ack Operation: Received acknowledge for object id %d from %s for process id %d for object %id\n",
|
||||
data.eventObjectIdentifier.instance, data.ackSource.value,
|
||||
data.ackProcessIdentifier, data.eventObjectIdentifier.instance);
|
||||
"Alarm Ack Operation: Received acknowledge for object id %lu from %s for process id %lu for object %lu\n",
|
||||
(unsigned long)data.eventObjectIdentifier.instance, data.ackSource.value,
|
||||
(unsigned long)data.ackProcessIdentifier, (unsigned long)data.eventObjectIdentifier.instance);
|
||||
#endif
|
||||
|
||||
len =
|
||||
|
||||
@@ -79,8 +79,8 @@ void handler_atomic_read_file_ack(
|
||||
octetstring_length(&data.fileData), 1,
|
||||
pFile) != 1) {
|
||||
#if PRINT_ENABLED
|
||||
fprintf(stderr, "Failed to write to %s (%u)!\n",
|
||||
pFilename, instance);
|
||||
fprintf(stderr, "Failed to write to %s (%lu)!\n",
|
||||
pFilename, (unsigned long)instance);
|
||||
#endif
|
||||
}
|
||||
fclose(pFile);
|
||||
|
||||
@@ -385,8 +385,8 @@ void handler_cov_task(
|
||||
if (lifetime_seconds >= elapsed_seconds) {
|
||||
COV_Subscriptions[index].lifetime -= elapsed_seconds;
|
||||
#if 0
|
||||
fprintf(stderr, "COVtask: subscription[%d].lifetime=%d\n",
|
||||
index, COV_Subscriptions[index].lifetime);
|
||||
fprintf(stderr, "COVtask: subscription[%d].lifetime=%lu\n",
|
||||
index, (unsigned long)COV_Subscriptions[index].lifetime);
|
||||
#endif
|
||||
} else {
|
||||
COV_Subscriptions[index].lifetime = 0;
|
||||
|
||||
@@ -52,7 +52,7 @@ void handler_i_am_add(
|
||||
#endif
|
||||
if (len != -1) {
|
||||
#if PRINT_ENABLED
|
||||
fprintf(stderr, " from %u, MAC = %d.%d.%d.%d.%d.%d\n", device_id,
|
||||
fprintf(stderr, " from %lu, MAC = %d.%d.%d.%d.%d.%d\n", (unsigned long)device_id,
|
||||
src->mac[0], src->mac[1], src->mac[2], src->mac[3], src->mac[4],
|
||||
src->mac[5]);
|
||||
#endif
|
||||
|
||||
@@ -45,11 +45,11 @@ void handler_i_have(
|
||||
len = ihave_decode_service_request(service_request, service_len, &data);
|
||||
if (len != -1) {
|
||||
#if PRINT_ENABLED
|
||||
fprintf(stderr, "I-Have: %s %d from %s %u!\r\n",
|
||||
fprintf(stderr, "I-Have: %s %lu from %s %lu!\r\n",
|
||||
bactext_object_type_name(data.object_id.type),
|
||||
data.object_id.instance,
|
||||
(unsigned long)data.object_id.instance,
|
||||
bactext_object_type_name(data.device_id.type),
|
||||
data.device_id.instance);
|
||||
(unsigned long)data.device_id.instance);
|
||||
#endif
|
||||
} else {
|
||||
#if PRINT_ENABLED
|
||||
|
||||
@@ -89,8 +89,8 @@ void handler_lso(
|
||||
*/
|
||||
#if PRINT_ENABLED
|
||||
fprintf(stderr,
|
||||
"Life Safety Operation: Received operation %d from process id %d for object %id\n",
|
||||
data.operation, data.processId, data.targetObject.instance);
|
||||
"Life Safety Operation: Received operation %d from process id %lu for object %lu\n",
|
||||
data.operation, (unsigned long)data.processId, (unsigned long)data.targetObject.instance);
|
||||
#endif
|
||||
|
||||
len =
|
||||
|
||||
@@ -62,12 +62,12 @@ void npdu_handler(
|
||||
} else {
|
||||
if (dest.net) {
|
||||
#if PRINT_ENABLED
|
||||
printf("NPDU: DNET=%d. Discarded!\n", dest.net);
|
||||
printf("NPDU: DNET=%u. Discarded!\n", (unsigned)dest.net);
|
||||
#endif
|
||||
} else {
|
||||
#if PRINT_ENABLED
|
||||
printf("NPDU: BACnet Protocol Version=%d. Discarded!\n",
|
||||
npdu_data.protocol_version);
|
||||
printf("NPDU: BACnet Protocol Version=%u. Discarded!\n",
|
||||
(unsigned)npdu_data.protocol_version);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,13 +166,13 @@ void ProcessPTA(
|
||||
cBlockNumber = (char) ulTemp;
|
||||
DecodeBlock(cBlockNumber, &data->serviceParameters[iLen]);
|
||||
} else { /* Read error */
|
||||
printf("Private Transfer read operation returned error code: %u\n",
|
||||
uiErrorCode);
|
||||
printf("Private Transfer read operation returned error code: %lu\n",
|
||||
(unsigned long)uiErrorCode);
|
||||
return;
|
||||
}
|
||||
} else { /* Write I/O block - should just be an OK type message */
|
||||
printf("Private Transfer write operation returned error code: %u\n",
|
||||
uiErrorCode);
|
||||
printf("Private Transfer write operation returned error code: %lu\n",
|
||||
(unsigned long)uiErrorCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,14 +55,14 @@ static void PrintReadPropertyData(
|
||||
if (data) {
|
||||
#if 0
|
||||
if (data->array_index == BACNET_ARRAY_ALL)
|
||||
fprintf(stderr, "%s #%u %s\n",
|
||||
fprintf(stderr, "%s #%lu %s\n",
|
||||
bactext_object_type_name(data->object_type),
|
||||
data->object_instance,
|
||||
(unsigned long)data->object_instance,
|
||||
bactext_property_name(data->object_property));
|
||||
else
|
||||
fprintf(stderr, "%s #%u %s[%d]\n",
|
||||
fprintf(stderr, "%s #%lu %s[%d]\n",
|
||||
bactext_object_type_name(data->object_type),
|
||||
data->object_instance,
|
||||
(unsigned long)data->object_instance,
|
||||
bactext_property_name(data->object_property),
|
||||
data->array_index);
|
||||
#endif
|
||||
|
||||
@@ -198,9 +198,9 @@ static void PrintReadPropertyMultipleData(
|
||||
|
||||
if (rpm_data) {
|
||||
#if PRINT_ENABLED
|
||||
fprintf(stdout, "%s #%u\r\n",
|
||||
fprintf(stdout, "%s #%lu\r\n",
|
||||
bactext_object_type_name(rpm_data->object_type),
|
||||
rpm_data->object_instance);
|
||||
(unsigned long)rpm_data->object_instance);
|
||||
fprintf(stdout, "{\r\n");
|
||||
#endif
|
||||
listOfProperties = rpm_data->listOfProperties;
|
||||
@@ -212,7 +212,7 @@ static void PrintReadPropertyMultipleData(
|
||||
propertyIdentifier));
|
||||
} else {
|
||||
fprintf(stdout, " proprietary %u: ",
|
||||
listOfProperties->propertyIdentifier);
|
||||
(unsigned)listOfProperties->propertyIdentifier);
|
||||
}
|
||||
#endif
|
||||
if (listOfProperties->propertyArrayIndex != BACNET_ARRAY_ALL) {
|
||||
|
||||
@@ -87,9 +87,9 @@ void handler_write_property(
|
||||
#if PRINT_ENABLED
|
||||
if (len > 0)
|
||||
fprintf(stderr,
|
||||
"WP: type=%u instance=%u property=%u priority=%u index=%d\n",
|
||||
wp_data.object_type, wp_data.object_instance,
|
||||
wp_data.object_property, wp_data.priority, wp_data.array_index);
|
||||
"WP: type=%lu instance=%lu property=%lu priority=%lu index=%ld\n",
|
||||
(unsigned long)wp_data.object_type, (unsigned long)wp_data.object_instance,
|
||||
(unsigned long)wp_data.object_property, (unsigned long)wp_data.priority, (long)wp_data.array_index);
|
||||
else
|
||||
fprintf(stderr, "WP: Unable to decode Request!\n");
|
||||
#endif
|
||||
|
||||
@@ -91,8 +91,8 @@ OBJECT_DEVICE_T *objects_device_new(
|
||||
Keylist_Data_Add(Device_List, key, pDevice);
|
||||
} else {
|
||||
fprintf(stderr,
|
||||
"Objects: Unable to allocate device %d buffer\n",
|
||||
device_instance);
|
||||
"Objects: Unable to allocate device %lu buffer\n",
|
||||
(unsigned long)device_instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,8 +109,8 @@ OBJECT_DEVICE_T *objects_device_delete(
|
||||
if (Device_List) {
|
||||
pDevice = Keylist_Data_Delete_By_Index(Device_List, index);
|
||||
if (pDevice) {
|
||||
fprintf(stderr, "Objects: removing device %d",
|
||||
pDevice->Object_Identifier.instance);
|
||||
fprintf(stderr, "Objects: removing device %lu",
|
||||
(unsigned long)pDevice->Object_Identifier.instance);
|
||||
if (pDevice->Object_List) {
|
||||
do {
|
||||
pObject =
|
||||
|
||||
Reference in New Issue
Block a user