summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>2010-10-01 13:54:28 -0700
committerInaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>2010-10-02 00:28:23 -0700
commitc29968905f0e5bb987c0aef5702d9a8d0dc2a744 (patch)
treeabb4b46ef8c73df0ee77debf0dba1f72808c1e53
parent1987318f351c042d61b8e5b5279e1f0e5e6a6f5d (diff)
cleanup: remove warnings caused by crazy static wmxSDK_Nds_Cmn.h:wmx_StateReason_tStr
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
-rw-r--r--InfraStack/OSAgnostic/Product/AppSrvInfra/L4MsgProxy.c2
-rw-r--r--InfraStack/OSAgnostic/WiMax/Agents/NDnS/Source/NDnSAgent.c2
-rw-r--r--InfraStack/OSAgnostic/WiMax/Wrappers/Include/wmxSDK_Nds_Cmn.h69
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")
/// <summary>
/// Type definition for an enum specifying the possible outcomes of a connect attempt.