Fix couple compiler warnings (#737)
* linux/bip6: Use function over PRINTF macro Our repo should be C89 compatibale. C89 does not support variac macros. For this reason use variac functions. This also enables to print different streams than just stderr. Also now if something is changed in debug_fprintf it also affect here which is good. * Use __inline__ over inline in library Use __inline__ over inline as that is C89/C90 combatible. With MSVC we need to use __inline so just define __inline__ to it if not already. * h_get_alarm_sum: Fix -Wself-assign compiler warning We get Wself-assign if PRINT_ENABLED is 0 ``` src/bacnet/basic/service/h_get_alarm_sum.c:129:16: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign] [build] 129 | bytes_sent = bytes_sent; [build] | ~~~~~~~~~~ ^ ~~~~~~~~~~ ``` --------- Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
This commit is contained in:
@@ -126,7 +126,7 @@ GET_ALARM_SUMMARY_ABORT:
|
||||
/*fprintf(stderr, "Failed to send PDU (%s)!\n", strerror(errno)); */
|
||||
}
|
||||
#else
|
||||
bytes_sent = bytes_sent;
|
||||
(void)bytes_sent;
|
||||
#endif
|
||||
|
||||
return;
|
||||
|
||||
@@ -52,6 +52,9 @@
|
||||
#ifndef strncasecmp
|
||||
#define strncasecmp _strnicmp
|
||||
#endif
|
||||
#ifndef __inline__
|
||||
#define __inline__ __inline
|
||||
#endif
|
||||
#if (_MSC_VER < 1900)
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
static struct uci_ptr ptr;
|
||||
|
||||
static inline int ucix_get_ptr(struct uci_context *ctx,
|
||||
static __inline__ int ucix_get_ptr(struct uci_context *ctx,
|
||||
const char *p,
|
||||
const char *s,
|
||||
const char *o,
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#if defined(PRINT_ENABLED_RECEIVE)
|
||||
#define printf_receive debug_printf
|
||||
#else
|
||||
static inline void printf_receive(const char *format, ...)
|
||||
static __inline__ void printf_receive(const char *format, ...)
|
||||
{
|
||||
(void)format;
|
||||
}
|
||||
@@ -53,7 +53,7 @@ static inline void printf_receive(const char *format, ...)
|
||||
#if defined(PRINT_ENABLED_RECEIVE_DATA)
|
||||
#define printf_receive_data debug_printf
|
||||
#else
|
||||
static inline void printf_receive_data(const char *format, ...)
|
||||
static __inline__ void printf_receive_data(const char *format, ...)
|
||||
{
|
||||
(void)format;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ static inline void printf_receive_data(const char *format, ...)
|
||||
#if defined(PRINT_ENABLED_RECEIVE_ERRORS)
|
||||
#define printf_receive_error debug_printf
|
||||
#else
|
||||
static inline void printf_receive_error(const char *format, ...)
|
||||
static __inline__ void printf_receive_error(const char *format, ...)
|
||||
{
|
||||
(void)format;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ static inline void printf_receive_error(const char *format, ...)
|
||||
#if defined(PRINT_ENABLED_MASTER)
|
||||
#define printf_master debug_printf
|
||||
#else
|
||||
static inline void printf_master(const char *format, ...)
|
||||
static __inline__ void printf_master(const char *format, ...)
|
||||
{
|
||||
(void)format;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user