diff --git a/bacnet-stack/demo/dcc/main.c b/bacnet-stack/demo/dcc/main.c index ef380b7e..e62843d5 100644 --- a/bacnet-stack/demo/dcc/main.c +++ b/bacnet-stack/demo/dcc/main.c @@ -174,8 +174,8 @@ int main( } /* decode the command line parameters */ Target_Device_Object_Instance = strtol(argv[1], NULL, 0); - Communication_State = strtol(argv[2], NULL, 0); - Communication_Timeout_Minutes = strtol(argv[3], NULL, 0); + Communication_State = (uint16_t) strtol(argv[2], NULL, 0); + Communication_Timeout_Minutes = (uint16_t) strtol(argv[3], NULL, 0); /* optional password */ if (argc > 4) Communication_Password = argv[4]; @@ -211,7 +211,7 @@ int main( } /* at least one second has passed */ if (current_seconds != last_seconds) - tsm_timer_milliseconds(((current_seconds - last_seconds) * 1000)); + tsm_timer_milliseconds((uint16_t)((current_seconds - last_seconds) * 1000)); if (Error_Detected) break; /* wait until the device is bound, or timeout and quit */ diff --git a/bacnet-stack/demo/epics/main.c b/bacnet-stack/demo/epics/main.c index adf79650..e628e1e0 100644 --- a/bacnet-stack/demo/epics/main.c +++ b/bacnet-stack/demo/epics/main.c @@ -1317,7 +1317,7 @@ int main( current_seconds = time(NULL); /* Has at least one second passed ? */ if (current_seconds != last_seconds) { - tsm_timer_milliseconds(((current_seconds - last_seconds) * 1000)); + tsm_timer_milliseconds((uint16_t)((current_seconds - last_seconds) * 1000)); } /* OK to proceed; see what we are up to now */ diff --git a/bacnet-stack/demo/readprop/main.c b/bacnet-stack/demo/readprop/main.c index 62e5222f..f56b1f08 100644 --- a/bacnet-stack/demo/readprop/main.c +++ b/bacnet-stack/demo/readprop/main.c @@ -273,7 +273,7 @@ int main( /* at least one second has passed */ if (current_seconds != last_seconds) - tsm_timer_milliseconds(((current_seconds - last_seconds) * 1000)); + tsm_timer_milliseconds((uint16_t)((current_seconds - last_seconds) * 1000)); if (Error_Detected) break; /* wait until the device is bound, or timeout and quit */ diff --git a/bacnet-stack/demo/server/main.c b/bacnet-stack/demo/server/main.c index c646a802..ab958bea 100644 --- a/bacnet-stack/demo/server/main.c +++ b/bacnet-stack/demo/server/main.c @@ -185,7 +185,7 @@ int main( npdu_handler(&src, &Rx_Buf[0], pdu_len); } /* at least one second has passed */ - elapsed_seconds = current_seconds - last_seconds; + elapsed_seconds = (uint32_t)(current_seconds - last_seconds); if (elapsed_seconds) { last_seconds = current_seconds; dcc_timer_seconds(elapsed_seconds); diff --git a/bacnet-stack/demo/writeprop/main.c b/bacnet-stack/demo/writeprop/main.c index d7b6ad8a..f5cbb037 100644 --- a/bacnet-stack/demo/writeprop/main.c +++ b/bacnet-stack/demo/writeprop/main.c @@ -247,7 +247,7 @@ int main( Target_Object_Type = strtol(argv[2], NULL, 0); Target_Object_Instance = strtol(argv[3], NULL, 0); Target_Object_Property = strtol(argv[4], NULL, 0); - Target_Object_Property_Priority = strtol(argv[5], NULL, 0); + Target_Object_Property_Priority = (uint8_t) strtol(argv[5], NULL, 0); Target_Object_Property_Index = strtol(argv[6], NULL, 0); if (Target_Object_Property_Index == -1) Target_Object_Property_Index = BACNET_ARRAY_ALL; @@ -276,7 +276,7 @@ int main( tag_value_arg = 7 + (i * 2); /* special case for context tagged values */ if (toupper(argv[tag_value_arg][0]) == 'C') { - context_tag = strtol(&argv[tag_value_arg][1], NULL, 0); + context_tag = (uint8_t) strtol(&argv[tag_value_arg][1], NULL, 0); tag_value_arg++; args_remaining--; Target_Object_Property_Value[i].context_tag = context_tag; @@ -345,7 +345,7 @@ int main( /* at least one second has passed */ if (current_seconds != last_seconds) - tsm_timer_milliseconds(((current_seconds - last_seconds) * 1000)); + tsm_timer_milliseconds((uint16_t)((current_seconds - last_seconds) * 1000)); if (Error_Detected) break; /* wait until the device is bound, or timeout and quit */