Fixed compiler warning format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=] by casting or increasing format specifier size and casting. (#1092)
* Fixed compiler warning format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=] by casting or increasing format specifier size and casting. Increased the size of the name string to handle larger possible integers.
* Fixed copied code that no longer needs static function scope variables for text names.
This commit is contained in:
@@ -75,7 +75,7 @@ uint32_t Analog_Input_Index_To_Instance(unsigned index)
|
||||
bool Analog_Input_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text_string[16] = "AI-0"; /* okay for single thread */
|
||||
char text_string[16] = "AI-0";
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ANALOG_INPUTS) {
|
||||
|
||||
@@ -131,7 +131,7 @@ float Analog_Value_Present_Value(uint32_t object_instance)
|
||||
bool Analog_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text_string[16] = "AV-0"; /* okay for single thread */
|
||||
char text_string[16] = "AV-0";
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ANALOG_VALUES) {
|
||||
|
||||
@@ -110,7 +110,7 @@ BACNET_BINARY_PV Binary_Input_Present_Value(uint32_t object_instance)
|
||||
bool Binary_Input_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text_string[16] = "BI-0"; /* okay for single thread */
|
||||
char text_string[16] = "BI-0";
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_BINARY_INPUTS) {
|
||||
|
||||
@@ -105,7 +105,7 @@ BACNET_BINARY_PV Binary_Value_Present_Value(uint32_t object_instance)
|
||||
bool Binary_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text_string[16] = "BV-0"; /* okay for single thread */
|
||||
char text_string[16] = "BV-0";
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_BINARY_VALUES) {
|
||||
|
||||
@@ -77,7 +77,7 @@ uint32_t Analog_Input_Index_To_Instance(unsigned index)
|
||||
bool Analog_Input_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32]; /* okay for single thread */
|
||||
char text[32];
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_ANALOG_INPUTS) {
|
||||
|
||||
@@ -141,7 +141,7 @@ bool Analog_Value_Present_Value_Set(
|
||||
bool Analog_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32] = ""; /* okay for single thread */
|
||||
char text[32] = "";
|
||||
unsigned index = 0;
|
||||
bool status = false;
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ bool Binary_Input_Present_Value_Set(
|
||||
bool Binary_Input_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32]; /* okay for single thread */
|
||||
char text[32];
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_BINARY_INPUTS) {
|
||||
|
||||
@@ -192,7 +192,7 @@ bool Binary_Output_Out_Of_Service(uint32_t instance)
|
||||
bool Binary_Output_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32]; /* okay for single thread */
|
||||
char text[32];
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_BINARY_OUTPUTS) {
|
||||
|
||||
@@ -181,7 +181,7 @@ bool Binary_Output_Out_Of_Service(uint32_t instance)
|
||||
bool Binary_Output_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text_string[16] = "BO-0"; /* okay for single thread */
|
||||
char text_string[16] = "BO-0";
|
||||
bool status = false;
|
||||
|
||||
if (object_instance < MAX_BINARY_OUTPUTS) {
|
||||
|
||||
+1
-1
@@ -93,7 +93,7 @@ void bip6_set_interface(char *ifname)
|
||||
Hints.ai_socktype = SOCK_DGRAM;
|
||||
Hints.ai_protocol = IPPROTO_UDP;
|
||||
Hints.ai_flags = AI_NUMERICHOST | AI_PASSIVE;
|
||||
snprintf(port, sizeof(port), "%u", BIP6_Addr.port);
|
||||
snprintf(port, sizeof(port), "%u", (unsigned)BIP6_Addr.port);
|
||||
if (BIP6_Debug) {
|
||||
debug_fprintf(
|
||||
stderr, "BIP6: seeking IPv6 address %s port %s...\n", ifname, port);
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ unsigned Analog_Input_Count(void)
|
||||
bool Analog_Input_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
static char text[32]; /* okay for single thread */
|
||||
char text[32];
|
||||
bool status = false;
|
||||
unsigned index = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user