From c29968905f0e5bb987c0aef5702d9a8d0dc2a744 Mon Sep 17 00:00:00 2001 From: Inaky Perez-Gonzalez Date: Fri, 1 Oct 2010 13:54:28 -0700 Subject: cleanup: remove warnings caused by crazy static wmxSDK_Nds_Cmn.h:wmx_StateReason_tStr Signed-off-by: Inaky Perez-Gonzalez --- .../OSAgnostic/Product/AppSrvInfra/L4MsgProxy.c | 2 +- .../WiMax/Agents/NDnS/Source/NDnSAgent.c | 2 +- .../WiMax/Wrappers/Include/wmxSDK_Nds_Cmn.h | 69 ++++++++++++---------- 3 files changed, 40 insertions(+), 33 deletions(-) diff --git a/InfraStack/OSAgnostic/Product/AppSrvInfra/L4MsgProxy.c b/InfraStack/OSAgnostic/Product/AppSrvInfra/L4MsgProxy.c index dde2916..1add118 100644 --- a/InfraStack/OSAgnostic/Product/AppSrvInfra/L4MsgProxy.c +++ b/InfraStack/OSAgnostic/Product/AppSrvInfra/L4MsgProxy.c @@ -28,7 +28,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -#pragma warning(disable : 4201) // warning C4201: nonstandard extension used : nameless struct/union +//#pragma warning(disable : 4201) // warning C4201: nonstandard extension used : nameless struct/union #include "Services_Ctrl.h" #include "L5Common.h" diff --git a/InfraStack/OSAgnostic/WiMax/Agents/NDnS/Source/NDnSAgent.c b/InfraStack/OSAgnostic/WiMax/Agents/NDnS/Source/NDnSAgent.c index 5dd9dba..f65fd92 100644 --- a/InfraStack/OSAgnostic/WiMax/Agents/NDnS/Source/NDnSAgent.c +++ b/InfraStack/OSAgnostic/WiMax/Agents/NDnS/Source/NDnSAgent.c @@ -924,7 +924,7 @@ BOOL L4C_HandleFastReconnect(wmx_pSystemStateUpdate systemStateUpdate) } else // fast reconnect is enabled { - TRACE(TR_MOD_NDNS_AGENT, TR_SEV_NOTICE, "Starting fast reconnect. Reason: %s", wmx_StateReason_tStr[systemStateUpdate->ReportStateReason]); + TRACE(TR_MOD_NDNS_AGENT, TR_SEV_NOTICE, "Starting fast reconnect. Reason: %s", WMX_STATE_REASON_STR(systemStateUpdate->ReportStateReason)); // get the recent connected NSP status = L4db_GetRecentNsp(&lastConnectedNSPid); if(status != WMX_ST_OK) diff --git a/InfraStack/OSAgnostic/WiMax/Wrappers/Include/wmxSDK_Nds_Cmn.h b/InfraStack/OSAgnostic/WiMax/Wrappers/Include/wmxSDK_Nds_Cmn.h index 040620d..adde9ea 100644 --- a/InfraStack/OSAgnostic/WiMax/Wrappers/Include/wmxSDK_Nds_Cmn.h +++ b/InfraStack/OSAgnostic/WiMax/Wrappers/Include/wmxSDK_Nds_Cmn.h @@ -141,38 +141,45 @@ typedef enum _wmx_StateReason_t StateReasonFWRequestFuncReset, }wmx_StateReason_t, *wmx_pStateReason_t; -static char *wmx_StateReason_tStr[] = { - "Illegal value", - "Normal", - "Failed to connect to NW", - "Failed to connect - Ranging", - "Failed to connect - SBC", - "Failed to connect - EAPAuth", - "Failed to connect - 3WayHandshake", - "Failed to connect - REG", - "Failed to connect - Datapath", - "Failed to connect - CoexNoRF", - "Disconnected - Dreg", - "Disconnected - Abort", - "Disconnected - Reset", - "Disconnected - Drop", - "SPLock validation failed", - "Disconnected - ReAuth", - "Reset - HwWdt", - "Reset - SwWdt", - "Reset - Assert", - "Reset - Thermal", - "Reset - RfKill", - "Reset - CoExistence", - "Reset - Host", - "Disconnected - Protocol Error", - "FW Requested Reset - Device", - "FW Requested Reset - Function" -}; - -#define WMX_STATE_REASON_COUNT 26 +static inline +const char * WMX_STATE_REASON_STR(unsigned index) +{ + static const char *wmx_StateReason_tStr[] = { + "Illegal value", + "Normal", + "Failed to connect to NW", + "Failed to connect - Ranging", + "Failed to connect - SBC", + "Failed to connect - EAPAuth", + "Failed to connect - 3WayHandshake", + "Failed to connect - REG", + "Failed to connect - Datapath", + "Failed to connect - CoexNoRF", + "Disconnected - Dreg", + "Disconnected - Abort", + "Disconnected - Reset", + "Disconnected - Drop", + "SPLock validation failed", + "Disconnected - ReAuth", + "Reset - HwWdt", + "Reset - SwWdt", + "Reset - Assert", + "Reset - Thermal", + "Reset - RfKill", + "Reset - CoExistence", + "Reset - Host", + "Disconnected - Protocol Error", + "FW Requested Reset - Device", + "FW Requested Reset - Function" + }; + static const unsigned count = + sizeof(wmx_StateReason_tStr) / sizeof(wmx_StateReason_tStr[0]); + if (index < count) + return wmx_StateReason_tStr[index]; + else + return "Illegal"; +} -#define WMX_STATE_REASON_STR(wmx_StateReason) (wmx_StateReason < WMX_STATE_REASON_COUNT ? wmx_StateReason_tStr[wmx_StateReason] : "Ilegal") /// /// Type definition for an enum specifying the possible outcomes of a connect attempt. -- cgit v1.2.3