]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix wpa_cipher_to_alg() return type
authorJoel Cunningham <joel.cunningham@me.com>
Mon, 19 Dec 2016 22:34:24 +0000 (16:34 -0600)
committerJouni Malinen <j@w1.fi>
Wed, 21 Dec 2016 10:48:16 +0000 (12:48 +0200)
wpa_cipher_to_alg() returns enumerated values from enum wpa_alg and all
uses of the return value treat it as enum wpa_alg (by either assigning
it to a variable of type enum wpa_alg or passing to a function that
expects enum wpa_alg).

This commit updates the return value to match the expected usage
(enum  wpa_alg) rather than int. This ensures the return value is
of the proper type and eliminates the following compiler warnings:

ARM RVCT (2.2):
  'Warning: #188-D: enumerated type mixed with another type'

Signed-off-by: Joel Cunningham <joel.cunningham@me.com>
src/common/wpa_common.c
src/common/wpa_common.h

index efc8a45f87a69f65de48dfa4f44910c861211785..6eb1e6631e2d4d5eb86697144158a7584550e86f 100644 (file)
@@ -1620,7 +1620,7 @@ int wpa_cipher_rsc_len(int cipher)
 }
 
 
-int wpa_cipher_to_alg(int cipher)
+enum wpa_alg wpa_cipher_to_alg(int cipher)
 {
        switch (cipher) {
        case WPA_CIPHER_CCMP_256:
index ce7479140f69a98bfbda11bf59d2f3f0f0a381de..4e952c1f8869cd73afe5dc6f2dc9fefec48a7570 100644 (file)
@@ -437,7 +437,7 @@ int wpa_ft_parse_ies(const u8 *ies, size_t ies_len, struct wpa_ft_ies *parse);
 
 int wpa_cipher_key_len(int cipher);
 int wpa_cipher_rsc_len(int cipher);
-int wpa_cipher_to_alg(int cipher);
+enum wpa_alg wpa_cipher_to_alg(int cipher);
 int wpa_cipher_valid_group(int cipher);
 int wpa_cipher_valid_pairwise(int cipher);
 int wpa_cipher_valid_mgmt_group(int cipher);