From 468456deb2a036713a836b7405b6da35dca05c62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Lach?= Date: Sat, 23 Jan 2021 11:30:02 +0100 Subject: [PATCH 4/4] - Correct documentation and code formating diff --git a/common/counters.c b/common/counters.c index 33c836818d..89cdd27471 100644 --- a/common/counters.c +++ b/common/counters.c @@ -27,7 +27,7 @@ static struct counter counters[MAX_COUNTERS] = static struct counter *counters_city[MAX_COUNTERS]; -/************************************************************************** +/************************************************************************//** Initialize counters system ****************************************************************************/ void counters_init(void) @@ -46,21 +46,21 @@ void counters_init(void) } } -/************************************************************************** +/************************************************************************//** Free resources allocated by counters system ****************************************************************************/ void counters_free(void) { } -/************************************************************************** +/************************************************************************//** Return counter by given id ****************************************************************************/ struct counter *counter_by_id(int id) { int i; - for (i = 0; i < MAX_COUNTERS; ++i) { + for (i = 0; i < MAX_COUNTERS; i++) { if (counters[i].id == id) { @@ -71,7 +71,7 @@ struct counter *counter_by_id(int id) return NULL; } -/************************************************************************** +/************************************************************************//** Return id of a given counter ****************************************************************************/ int counter_id(struct counter *pcount) @@ -80,7 +80,7 @@ int counter_id(struct counter *pcount) return pcount->id; } -/************************************************************************** +/************************************************************************//** Search for counter by rule name (return matched counter if found or NULL) ****************************************************************************/ @@ -88,9 +88,9 @@ struct counter *counter_by_rule_name(const char *name) { int i; - for (i = 0; i < MAX_COUNTERS; ++i) { + for (i = 0; i < MAX_COUNTERS; i++) { - if (0 == fc_strcasecmp(name,counters[i] .rule_name)) { + if (0 == fc_strcasecmp(name, counters[i].rule_name)) { return &counters[i]; } @@ -99,7 +99,7 @@ struct counter *counter_by_rule_name(const char *name) return NULL; } -/************************************************************************** +/************************************************************************//** Return rule name of a given counter ****************************************************************************/ const char *counter_rule_name(struct counter *pcount) @@ -107,7 +107,7 @@ const char *counter_rule_name(struct counter *pcount) return pcount->rule_name; } -/************************************************************************** +/************************************************************************//** Return index in global counter's array ****************************************************************************/ int counter_index(struct counter *pcount) @@ -116,7 +116,7 @@ int counter_index(struct counter *pcount) return pcount - counters; } -/************************************************************************** +/************************************************************************//** Return counter by given index ****************************************************************************/ struct counter *counter_by_index(int index) -- 2.30.0