forked from github/server
cppcheck style
This commit is contained in:
parent
cb7d2e9fcb
commit
83556f8010
4 changed files with 5 additions and 7 deletions
|
@ -121,7 +121,7 @@ static int read_keyval_orig(gamedata *data, int *keys, int n) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int a_readkeys(variant *var, void *owner, gamedata *data) {
|
static int a_readkeys(variant *var, void *owner, gamedata *data) {
|
||||||
int i, n, ksn, *keys;
|
int n, ksn, *keys;
|
||||||
|
|
||||||
READ_INT(data->store, &n);
|
READ_INT(data->store, &n);
|
||||||
assert(n < 4096 && n >= 0);
|
assert(n < 4096 && n >= 0);
|
||||||
|
@ -155,7 +155,7 @@ static int a_readkeys(variant *var, void *owner, gamedata *data) {
|
||||||
}
|
}
|
||||||
keys[0] = n;
|
keys[0] = n;
|
||||||
if (data->version < SORTKEYS_VERSION) {
|
if (data->version < SORTKEYS_VERSION) {
|
||||||
int e = 1;
|
int i, e = 1;
|
||||||
for (i = 1; i != n; ++i) {
|
for (i = 1; i != n; ++i) {
|
||||||
int k = keys[i * 2 + 1];
|
int k = keys[i * 2 + 1];
|
||||||
int v = keys[i * 2 + 2];
|
int v = keys[i * 2 + 2];
|
||||||
|
|
|
@ -48,13 +48,12 @@ static int read_seenspells(variant *var, void *owner, struct gamedata *data)
|
||||||
{
|
{
|
||||||
selist *ql = NULL;
|
selist *ql = NULL;
|
||||||
storage *store = data->store;
|
storage *store = data->store;
|
||||||
spell *sp = 0;
|
|
||||||
char token[32];
|
char token[32];
|
||||||
|
|
||||||
UNUSED_ARG(owner);
|
UNUSED_ARG(owner);
|
||||||
READ_TOK(store, token, sizeof(token));
|
READ_TOK(store, token, sizeof(token));
|
||||||
while (token[0]) {
|
while (token[0]) {
|
||||||
sp = find_spell(token);
|
spell *sp = find_spell(token);
|
||||||
if (!sp) {
|
if (!sp) {
|
||||||
log_info("read_seenspells: could not find spell '%s'\n", token);
|
log_info("read_seenspells: could not find spell '%s'\n", token);
|
||||||
return AT_READ_FAIL;
|
return AT_READ_FAIL;
|
||||||
|
|
|
@ -82,7 +82,7 @@ void autostudy_run(scholar scholars[], int nscholars)
|
||||||
int ti = 0;
|
int ti = 0;
|
||||||
while (ti != nscholars) {
|
while (ti != nscholars) {
|
||||||
skill_t sk = scholars[ti].sk;
|
skill_t sk = scholars[ti].sk;
|
||||||
int t, s, se, ts = 0, tt = 0, si = ti;
|
int t, se, ts = 0, tt = 0, si = ti;
|
||||||
for (se = ti; se != nscholars && scholars[se].sk == sk; ++se) {
|
for (se = ti; se != nscholars && scholars[se].sk == sk; ++se) {
|
||||||
int mint;
|
int mint;
|
||||||
ts += scholars[se].u->number; /* count total scholars */
|
ts += scholars[se].u->number; /* count total scholars */
|
||||||
|
@ -108,7 +108,7 @@ void autostudy_run(scholar scholars[], int nscholars)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* invariant: unit ti can still teach i students */
|
/* invariant: unit ti can still teach i students */
|
||||||
int i = scholars[ti].u->number * STUDENTS_PER_TEACHER;
|
int s, i = scholars[ti].u->number * STUDENTS_PER_TEACHER;
|
||||||
/* invariant: unit si has n students that can still be taught */
|
/* invariant: unit si has n students that can still be taught */
|
||||||
int n = scholars[si].u->number;
|
int n = scholars[si].u->number;
|
||||||
for (t = ti, s = si; t != si && s != se; ) {
|
for (t = ti, s = si; t != si && s != se; ) {
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include "kernel/skills.h"
|
#include "kernel/skills.h"
|
||||||
#include "kernel/types.h"
|
#include "kernel/types.h"
|
||||||
#include <kernel/building.h>
|
#include <kernel/building.h>
|
||||||
#include <kernel/config.h>
|
|
||||||
#include <kernel/curse.h>
|
#include <kernel/curse.h>
|
||||||
#include "kernel/equipment.h"
|
#include "kernel/equipment.h"
|
||||||
#include <kernel/faction.h>
|
#include <kernel/faction.h>
|
||||||
|
|
Loading…
Reference in a new issue