From e824286452082b90af5fa0893daa4299526bd407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Lach?= Date: Sat, 3 Jul 2021 18:01:30 +0200 Subject: [PATCH] - Only style fixes diff --git a/common/counters.c b/common/counters.c index c4f744b69b..4afb24b36c 100644 --- a/common/counters.c +++ b/common/counters.c @@ -21,9 +21,8 @@ #include "counters.h" -static struct counter counters[MAX_COUNTERS] = -{ - { "Owned", COUNTER_OWNED, CTGT_CITY, 0 } +static struct counter counters[MAX_COUNTERS] = { + {"Owned", COUNTER_OWNED, CTGT_CITY, 0} }; static struct counter *counters_city[MAX_COUNTERS]; @@ -36,9 +35,10 @@ void counters_init(void) int i; int city_i = 0; - for (i = 0; i < MAX_COUNTERS; i++) { - - if (counters[i].type == COUNTER_OWNED) { + for (i = 0; i < MAX_COUNTERS; i++) + { + if (counters[i].type == COUNTER_OWNED) + { /* City counter type */ counters_city[city_i] = &counters[i]; counters[i].index = city_i++; @@ -83,8 +83,10 @@ struct counter *counter_by_rule_name(const char *name) fc_assert_ret_val(NULL != name, NULL); fc_assert_ret_val('\0' != name[0], NULL); - for (i = 0; i < MAX_COUNTERS; i++) { - if (0 == fc_strcasecmp(name, counters[i].rule_name)) { + for (i = 0; i < MAX_COUNTERS; i++) + { + if (0 == fc_strcasecmp (name, counters[i].rule_name)) + { return &counters[i]; } } @@ -115,13 +117,14 @@ int counter_index(struct counter *pcount) ****************************************************************************/ struct counter *counter_by_index(int index, enum counter_target target) { - switch (target) { - case CTGT_CITY: - return counters_city[index]; - break; - - default: - fc_assert_exit_msg(false, "Bad counter type inside counter_by_index." - "Exiting"); + switch (target) + { + case CTGT_CITY: + return counters_city[index]; + break; + + default: + fc_assert_exit_msg (false, "Bad counter type inside counter_by_index." + "Exiting"); } } diff --git a/common/counters.h b/common/counters.h index 6224001488..07de09a4e7 100644 --- a/common/counters.h +++ b/common/counters.h @@ -14,18 +14,23 @@ #define FC__COUNTERS_H #ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +extern "C" +{ +#endif /* __cplusplus */ -enum counter_type { COUNTER_OWNED = 0, COUNTER_COUNT }; +enum counter_type { + COUNTER_OWNED = 0, + COUNTER_COUNT +}; -enum counter_target { CTGT_CITY }; +enum counter_target { + CTGT_CITY +}; /* Space for one counter of each type */ #define MAX_COUNTERS COUNTER_COUNT -struct counter -{ +struct counter { const char *rule_name; enum counter_type type; enum counter_target target; @@ -46,6 +51,6 @@ struct counter *counter_by_index(int index, enum counter_target target); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ #endif /* FC__COUNTERS_H */ -- 2.32.0