]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Remove floating constant suffix 'd' from test coee
authorJouni Malinen <j@w1.fi>
Sat, 26 Apr 2014 08:09:29 +0000 (11:09 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 29 Apr 2014 09:52:10 +0000 (12:52 +0300)
clang scan-build does not seem to like the 'd' suffix on floating
constants and ends up reporting analyzer failures. Since this suffix
does not seem to be needed, get rid of it to clear such warnings.

Signed-off-by: Jouni Malinen <j@w1.fi>
hostapd/config_file.c
src/ap/ap_config.c
src/ap/beacon.c
src/ap/ieee802_11.c
src/ap/wpa_auth.c

index c65d384a72ea694d0a6b6e29b97ed9954165fbef..caf51a94a5c27078e73e2ed186ae4cce258ac290 100644 (file)
@@ -3075,8 +3075,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                char *end;                                      \
                                                                \
                conf->_val = strtod(pos, &end);                 \
-               if (*end || conf->_val < 0.0d ||                \
-                   conf->_val > 1.0d) {                        \
+               if (*end || conf->_val < 0.0 ||                 \
+                   conf->_val > 1.0) {                         \
                        wpa_printf(MSG_ERROR,                   \
                                   "Line %d: Invalid value '%s'", \
                                   line, pos);                  \
index 0a143d394fa0ed16a2e340d3d0219e2968d9e5bc..9680817b5ee9344f2b9cb900d5089a4c9fd4a1ec 100644 (file)
@@ -174,11 +174,11 @@ struct hostapd_config * hostapd_config_defaults(void)
        conf->ap_table_expiration_time = 60;
 
 #ifdef CONFIG_TESTING_OPTIONS
-       conf->ignore_probe_probability = 0.0d;
-       conf->ignore_auth_probability = 0.0d;
-       conf->ignore_assoc_probability = 0.0d;
-       conf->ignore_reassoc_probability = 0.0d;
-       conf->corrupt_gtk_rekey_mic_probability = 0.0d;
+       conf->ignore_probe_probability = 0.0;
+       conf->ignore_auth_probability = 0.0;
+       conf->ignore_assoc_probability = 0.0;
+       conf->ignore_reassoc_probability = 0.0;
+       conf->corrupt_gtk_rekey_mic_probability = 0.0;
 #endif /* CONFIG_TESTING_OPTIONS */
 
 #ifdef CONFIG_ACS
index 38600e6ff83d10c851e9de7f2eb7a25cb1037e31..27525dc6220708f59d732d082d34321f435c0cd9 100644 (file)
@@ -645,7 +645,7 @@ void handle_probe_req(struct hostapd_data *hapd,
         * with AP configuration */
 
 #ifdef CONFIG_TESTING_OPTIONS
-       if (hapd->iconf->ignore_probe_probability > 0.0d &&
+       if (hapd->iconf->ignore_probe_probability > 0.0 &&
            drand48() < hapd->iconf->ignore_probe_probability) {
                wpa_printf(MSG_INFO,
                           "TESTING: ignoring probe request from " MACSTR,
index 0430c701dbc7e543ce1c77b08a0df8047150dc38..dbe63210fc3d82ff16d93586e453362884b135c2 100644 (file)
@@ -565,7 +565,7 @@ static void handle_auth(struct hostapd_data *hapd,
        }
 
 #ifdef CONFIG_TESTING_OPTIONS
-       if (hapd->iconf->ignore_auth_probability > 0.0d &&
+       if (hapd->iconf->ignore_auth_probability > 0.0 &&
            drand48() < hapd->iconf->ignore_auth_probability) {
                wpa_printf(MSG_INFO,
                           "TESTING: ignoring auth frame from " MACSTR,
@@ -1291,7 +1291,7 @@ static void handle_assoc(struct hostapd_data *hapd,
 
 #ifdef CONFIG_TESTING_OPTIONS
        if (reassoc) {
-               if (hapd->iconf->ignore_reassoc_probability > 0.0d &&
+               if (hapd->iconf->ignore_reassoc_probability > 0.0 &&
                    drand48() < hapd->iconf->ignore_reassoc_probability) {
                        wpa_printf(MSG_INFO,
                                   "TESTING: ignoring reassoc request from "
@@ -1299,7 +1299,7 @@ static void handle_assoc(struct hostapd_data *hapd,
                        return;
                }
        } else {
-               if (hapd->iconf->ignore_assoc_probability > 0.0d &&
+               if (hapd->iconf->ignore_assoc_probability > 0.0 &&
                    drand48() < hapd->iconf->ignore_assoc_probability) {
                        wpa_printf(MSG_INFO,
                                   "TESTING: ignoring assoc request from "
index 77e78584855e14a23cad4cb8175e41e2d7ff3993..d2126103d4d772b26908ae4870cafaa1d49cdce4 100644 (file)
@@ -1421,7 +1421,7 @@ void __wpa_send_eapol(struct wpa_authenticator *wpa_auth,
                                  key->key_mic);
 #ifdef CONFIG_TESTING_OPTIONS
                if (!pairwise &&
-                   wpa_auth->conf.corrupt_gtk_rekey_mic_probability > 0.0d &&
+                   wpa_auth->conf.corrupt_gtk_rekey_mic_probability > 0.0 &&
                    drand48() <
                    wpa_auth->conf.corrupt_gtk_rekey_mic_probability) {
                        wpa_auth_logger(wpa_auth, sm->addr, LOGGER_INFO,