Skip to content

Commit

Permalink
Fix compiler warnings in MDNS service
Browse files Browse the repository at this point in the history
- the current #pragma pack alignment value is modified
- equality comparison with extraneous parentheses
  • Loading branch information
Arto Kinnunen committed Mar 28, 2019
1 parent 924acad commit db2e2cd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
@@ -1,5 +1,6 @@
/**************************************************************************
*
* Copyright (c) 2019 Arm Limited and affiliates.
* Copyright 2011-2016 by Andrey Butok. FNET Community.
* Copyright 2008-2010 by Andrey Butok. Freescale Semiconductor, Inc.
*
Expand Down Expand Up @@ -71,6 +72,11 @@
#define FNET_COMP_PACKED_VAR __packed
#endif

#if FNET_CFG_COMP_UV6
#define FNET_COMP_PACKED_BEGIN _Pragma("pack(1)")
#define FNET_COMP_PACKED_END _Pragma("pack()")
#endif

#if FNET_CFG_COMP_GNUC
#define FNET_COMP_PACKED_BEGIN _Pragma("pack(1)")
#define FNET_COMP_PACKED_END _Pragma("pack(8)")
Expand Down
@@ -1,5 +1,6 @@
/**************************************************************************
*
* Copyright (c) 2019 Arm Limited and affiliates.
* Copyright 2011-2016 by Andrey Butok. FNET Community.
* Copyright 2008-2010 by Andrey Butok. Freescale Semiconductor, Inc.
*
Expand Down Expand Up @@ -40,7 +41,8 @@
* Current version of the FNET supports the following compiler definitions:
* - @c FNET_CFG_COMP_IAR = Used compiler is IAR.
* - @c FNET_CFG_COMP_GNUC = Used compiler is GCC.
* - @c FNET_CFG_COMP_UV = Used compiler is Keil uVision.
* - @c FNET_CFG_COMP_UV6 = Used compiler is Keil uVision with armclang.
* - @c FNET_CFG_COMP_UV = Used compiler is Keil uVision with armcc.
* - @c FNET_CFG_COMP_GHS = Used compiler is Green Hills.
* - @c FNET_CFG_COMP_DCC = Used compiler is Diab.
* - @c FNET_CFG_COMP_CW = Used compiler is CodeWarrior.
Expand All @@ -61,7 +63,10 @@
/* GHS compiler. */
#elif (defined(FNET_CFG_COMP_GHS) && FNET_CFG_COMP_GHS)
#define FNET_COMP_STR "GHS"
/* Keil uVision compiler. */
/* Keil uVision compiler with armclang. */
#elif (defined(FNET_CFG_COMP_UV6) && FNET_CFG_COMP_UV6)
#define FNET_COMP_STR "UV6"
/* Keil uVision compiler with armcc. */
#elif (defined(FNET_CFG_COMP_UV) && FNET_CFG_COMP_UV)
#define FNET_COMP_STR "UV"
/* GNU GCC */
Expand All @@ -85,8 +90,12 @@
#elif defined(__ghs__)
#define FNET_CFG_COMP_GHS (1)
#define FNET_COMP_STR "GHS"
/* Keil uVision compiler. */
#elif defined(__CC_ARM)
/* Keil uVision compiler using armclang. */
#elif defined(__CC_ARM) || defined(__ARMCC_VERSION) && defined(__GNUC__)
#define FNET_CFG_COMP_UV6 (1)
#define FNET_COMP_STR "UV6"
/* Keil uVision compiler using armcc. */
#elif defined(__CC_ARM) || defined(__ARMCC_VERSION)
#define FNET_CFG_COMP_UV (1)
#define FNET_COMP_STR "UV"
/* GNU GCC */
Expand All @@ -109,6 +118,9 @@
#ifndef FNET_CFG_COMP_CW
#define FNET_CFG_COMP_CW (0)
#endif
#ifndef FNET_CFG_COMP_UV6
#define FNET_CFG_COMP_UV6 (0)
#endif
#ifndef FNET_CFG_COMP_UV
#define FNET_CFG_COMP_UV (0)
#endif
Expand Down
@@ -1,6 +1,6 @@
/**************************************************************************
*
* Copyright (c) 2017, Arm Limited and affiliates.
* Copyright (c) 2017, 2019 Arm Limited and affiliates.
* Copyright 2016 by Andrey Butok. FNET Community.
*
***************************************************************************
Expand Down Expand Up @@ -1614,7 +1614,7 @@ static const fnet_uint8_t *fnet_mdns_process_response(fnet_mdns_if_t *mdns_if, c
mdns_if->host_name_conflict_timestamp = fnet_timer_get_ms();

/* If in Probing state, change name and try again */
if((mdns_if->state == FNET_MDNS_STATE_PROBING))
if(mdns_if->state == FNET_MDNS_STATE_PROBING)
{
fnet_mdns_update_name_counter(mdns_if); /* Regenerate name.*/
}
Expand Down
1 change: 0 additions & 1 deletion source/Service_Libs/mdns/fnet_user_config.h
Expand Up @@ -42,7 +42,6 @@

/* Environment */
#define FNET_CFG_CPU_LITTLE_ENDIAN (1) // Simulator is big endian, Add HW endianess also, follow target
#define FNET_CFG_COMP_GNUC (1) // select compiler to keep compiler selection happy
#define FNET_CFG_MDNS_MAX (1) // allow only 1 mDNS server, as socket needs to be bound to port 5353
#define FNET_CFG_MDNS_SERVICE_MAX (2) // Allow 2 services per server

Expand Down

0 comments on commit db2e2cd

Please sign in to comment.