]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] cmath is a bit more strict 5051/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 11 Jul 2024 13:13:26 +0000 (14:13 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 11 Jul 2024 13:13:26 +0000 (14:13 +0100)
src/libserver/cfg_utils.cxx

index afa4009ccf68019bb06a8f36f763eab91982c6ee..1344bc4f9f0cb6a382109ec4b633bd05c90d6347 100644 (file)
@@ -136,14 +136,14 @@ struct rspamd_actions_list {
        void sort()
        {
                std::sort(actions.begin(), actions.end(), [](const action_ptr &a1, const action_ptr &a2) -> bool {
-                       if (!isnan(a1->threshold) && !isnan(a2->threshold)) {
+                       if (!std::isnan(a1->threshold) && !std::isnan(a2->threshold)) {
                                return a1->threshold < a2->threshold;
                        }
 
-                       if (isnan(a1->threshold) && isnan(a2->threshold)) {
+                       if (std::isnan(a1->threshold) && std::isnan(a2->threshold)) {
                                return false;
                        }
-                       else if (isnan(a1->threshold)) {
+                       else if (std::isnan(a1->threshold)) {
                                return true;
                        }
 
@@ -1541,7 +1541,7 @@ rspamd_config_new_symbol(struct rspamd_config *cfg, const char *symbol,
                rspamd_mempool_alloc0_type(cfg->cfg_pool, struct rspamd_symbol);
        score_ptr = rspamd_mempool_alloc_type(cfg->cfg_pool, double);
 
-       if (isnan(score)) {
+       if (std::isnan(score)) {
                /* In fact, it could be defined later */
                msg_debug_config("score is not defined for symbol %s, set it to zero",
                                                 symbol);
@@ -1652,7 +1652,7 @@ rspamd_config_add_symbol(struct rspamd_config *cfg,
                }
 
                if (sym_def->priority > priority &&
-                       (isnan(score) || !(sym_def->flags & RSPAMD_SYMBOL_FLAG_UNSCORED))) {
+                       (std::isnan(score) || !(sym_def->flags & RSPAMD_SYMBOL_FLAG_UNSCORED))) {
                        msg_debug_config("symbol %s has been already registered with "
                                                         "priority %ud, do not override (new priority: %ud)",
                                                         symbol,
@@ -1673,7 +1673,7 @@ rspamd_config_add_symbol(struct rspamd_config *cfg,
                }
                else {
 
-                       if (!isnan(score)) {
+                       if (!std::isnan(score)) {
                                msg_debug_config("symbol %s has been already registered with "
                                                                 "priority %ud, override it with new priority: %ud, "
                                                                 "old score: %.2f, new score: %.2f",
@@ -2013,7 +2013,7 @@ rspamd_config_action_from_ucl(struct rspamd_config *cfg,
 
        /* TODO: add lua references support */
 
-       if (isnan(threshold) && !(flags & RSPAMD_ACTION_NO_THRESHOLD)) {
+       if (std::isnan(threshold) && !(flags & RSPAMD_ACTION_NO_THRESHOLD)) {
                msg_err_config("action %s has no threshold being set and it is not"
                                           " a no threshold action",
                                           act->name);