aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tlsv1_common.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-10-26 14:00:57 (GMT)
committerJouni Malinen <j@w1.fi>2013-10-26 14:49:05 (GMT)
commite7ecab4a3b8bc5696ee6d9779bc9f9a1f8b4b6ed (patch)
tree85908522f34532000904ebcc47c331e7f0dfd942 /src/tls/tlsv1_common.c
parent39044a703348e50d9d35053baf1b9ba3f53efdbf (diff)
downloadhostap-e7ecab4a3b8bc5696ee6d9779bc9f9a1f8b4b6ed.zip
hostap-e7ecab4a3b8bc5696ee6d9779bc9f9a1f8b4b6ed.tar.gz
hostap-e7ecab4a3b8bc5696ee6d9779bc9f9a1f8b4b6ed.tar.bz2
Use ARRAY_SIZE() macro
Replace the common sizeof(a)/sizeof(a[0]) constructions with a more readable version. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/tls/tlsv1_common.c')
-rw-r--r--src/tls/tlsv1_common.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tls/tlsv1_common.c b/src/tls/tlsv1_common.c
index d212862..4578b22 100644
--- a/src/tls/tlsv1_common.c
+++ b/src/tls/tlsv1_common.c
@@ -57,8 +57,7 @@ static const struct tls_cipher_suite tls_cipher_suites[] = {
TLS_CIPHER_AES_256_CBC, TLS_HASH_SHA256 }
};
-#define NUM_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
-#define NUM_TLS_CIPHER_SUITES NUM_ELEMS(tls_cipher_suites)
+#define NUM_TLS_CIPHER_SUITES ARRAY_SIZE(tls_cipher_suites)
static const struct tls_cipher_data tls_ciphers[] = {
@@ -84,7 +83,7 @@ static const struct tls_cipher_data tls_ciphers[] = {
CRYPTO_CIPHER_ALG_AES }
};
-#define NUM_TLS_CIPHER_DATA NUM_ELEMS(tls_ciphers)
+#define NUM_TLS_CIPHER_DATA ARRAY_SIZE(tls_ciphers)
/**