Browse Source

[Minor] Learn to cycle back on unsigned

tags/3.7.1
Vsevolod Stakhov 8 months ago
parent
commit
509dad33dd
No account linked to committer's email address

+ 1
- 1
src/libserver/rspamd_symcache.h View File

@@ -209,7 +209,7 @@ gboolean rspamd_symcache_validate(struct rspamd_symcache *cache,
*/
gboolean rspamd_symcache_process_symbols(struct rspamd_task *task,
struct rspamd_symcache *cache,
gint stage);
guint stage);

/**
* Return statistics about the cache as ucl object (array of objects one per item)

+ 1
- 1
src/libserver/symcache/symcache_c.cxx View File

@@ -687,7 +687,7 @@ void rspamd_symcache_composites_foreach(struct rspamd_task *task,
gboolean
rspamd_symcache_process_symbols(struct rspamd_task *task,
struct rspamd_symcache *cache,
gint stage)
guint stage)
{
auto *real_cache = C_API_SYMCACHE(cache);


+ 5
- 5
src/libserver/symcache/symcache_runtime.cxx View File

@@ -1,11 +1,11 @@
/*-
* Copyright 2022 Vsevolod Stakhov
/*
* Copyright 2023 Vsevolod Stakhov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -279,7 +279,7 @@ auto symcache_runtime::get_dynamic_item(int id) const -> cache_dynamic_item *
return nullptr;
}

auto symcache_runtime::process_symbols(struct rspamd_task *task, symcache &cache, int stage) -> bool
auto symcache_runtime::process_symbols(struct rspamd_task *task, symcache &cache, unsigned int stage) -> bool
{
msg_debug_cache_task("symbols processing stage at pass: %d", stage);

@@ -308,7 +308,7 @@ auto symcache_runtime::process_symbols(struct rspamd_task *task, symcache &cache
auto symcache_runtime::process_pre_postfilters(struct rspamd_task *task,
symcache &cache,
int start_events,
int stage) -> bool
unsigned int stage) -> bool
{
auto saved_priority = std::numeric_limits<int>::min();
auto all_done = true;

+ 5
- 5
src/libserver/symcache/symcache_runtime.hxx View File

@@ -1,11 +1,11 @@
/*-
* Copyright 2022 Vsevolod Stakhov
/*
* Copyright 2023 Vsevolod Stakhov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -64,7 +64,7 @@ class symcache_runtime {
auto process_symbol(struct rspamd_task *task, symcache &cache, cache_item *item,
cache_dynamic_item *dyn_item) -> bool;
/* Specific stages of the processing */
auto process_pre_postfilters(struct rspamd_task *task, symcache &cache, int start_events, int stage) -> bool;
auto process_pre_postfilters(struct rspamd_task *task, symcache &cache, int start_events, unsigned int stage) -> bool;
auto process_filters(struct rspamd_task *task, symcache &cache, int start_events) -> bool;
auto check_metric_limit(struct rspamd_task *task) -> bool;
auto check_item_deps(struct rspamd_task *task, symcache &cache, cache_item *item,
@@ -180,7 +180,7 @@ public:
* @param stage
* @return
*/
auto process_symbols(struct rspamd_task *task, symcache &cache, int stage) -> bool;
auto process_symbols(struct rspamd_task *task, symcache &cache, unsigned int stage) -> bool;

/**
* Finalize execution of some item in the cache

+ 1
- 1
src/libserver/task.c View File

@@ -1662,7 +1662,7 @@ rspamd_task_get_required_score(struct rspamd_task *task, struct rspamd_scan_resu
}
}

for (guint i = m->nactions - 1; i >= 0; i--) {
for (guint i = m->nactions; i-- > 0;) {
struct rspamd_action_config *action_lim = &m->actions_config[i];



Loading…
Cancel
Save