From ff888401a15de39a791affaecadb91491d350eb9 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 8 Sep 2015 07:40:08 +0200 Subject: [PATCH 1/3] disable valgrind --- tests/run-turn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run-turn.sh b/tests/run-turn.sh index 4055613e5..e6b896618 100755 --- a/tests/run-turn.sh +++ b/tests/run-turn.sh @@ -30,7 +30,7 @@ set -e cd $ROOT/tests setup cleanup -VALGRIND=`which valgrind` +#VALGRIND=`which valgrind` SERVER=../Debug/eressea/eressea if [ -n "$VALGRIND" ]; then SUPP=../share/ubuntu-12_04.supp From 3eead446d0fba2db8d83e2b880ba927454abdd40 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 26 Sep 2015 22:42:22 +0200 Subject: [PATCH 2/3] reduce cron log spam --- src/battle.c | 4 ++-- src/kernel/save.c | 29 +++++++++++++---------------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/battle.c b/src/battle.c index 44a594863..a47db8163 100644 --- a/src/battle.c +++ b/src/battle.c @@ -1691,9 +1691,9 @@ void do_combatmagic(battle * b, combatmagic_t was) if (was == DO_PRECOMBATSPELL) { for (s = b->sides; s != b->sides + b->nsides; ++s) { fighter *fig = 0; - if (s->bf->attacker) { + if (fval(s->faction, FFL_CURSED) && s->bf->attacker) { spell *sp = find_spell("igjarjuk"); - if (sp && fval(s->faction, FFL_CURSED)) { + if (sp) { int si; for (si = 0; s->enemies[si]; ++si) { side *se = s->enemies[si]; diff --git a/src/kernel/save.c b/src/kernel/save.c index fc348acac..300555180 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -1204,7 +1204,7 @@ faction *readfaction(struct gamedata * data) READ_STR(data->store, name, sizeof(name)); f->banner = _strdup(name); - log_printf(stdout, " - Lese Partei %s (%s)\n", f->name, factionid(f)); + log_debug(" - Lese Partei %s (%s)", f->name, factionid(f)); READ_STR(data->store, name, sizeof(name)); if (set_email(&f->email, name) != 0) { @@ -1385,7 +1385,7 @@ int readgame(const char *filename, bool backup) FILE *F; init_locales(); - log_printf(stdout, "- reading game data from %s\n", filename); + log_debug("- reading game data from %s\n", filename); sprintf(path, "%s/%s", datapath(), filename); if (backup) { @@ -1433,7 +1433,7 @@ int readgame(const char *filename, bool backup) a_read(&store, &global.attribs, NULL); READ_INT(&store, &turn); global.data_turn = turn; - log_printf(stdout, " - reading turn %d\n", turn); + log_debug(" - reading turn %d\n", turn); rng_init(turn); ++global.cookie; READ_INT(&store, &nread); /* max_unique_id = ignore */ @@ -1501,7 +1501,7 @@ int readgame(const char *filename, bool backup) /* Read factions */ read_alliances(&store); READ_INT(&store, &nread); - log_printf(stdout, " - Einzulesende Parteien: %d\n", nread); + log_debug(" - Einzulesende Parteien: %d\n", nread); fp = &factions; while (*fp) fp = &(*fp)->next; @@ -1522,7 +1522,7 @@ int readgame(const char *filename, bool backup) if (rmax < 0) { rmax = nread; } - log_printf(stdout, " - Einzulesende Regionen: %d/%d\r", rmax, nread); + log_debug(" - Einzulesende Regionen: %d/%d\r", rmax, nread); while (--nread >= 0) { unit **up; int x, y; @@ -1530,7 +1530,7 @@ int readgame(const char *filename, bool backup) READ_INT(&store, &y); if ((nread & 0x3FF) == 0) { /* das spart extrem Zeit */ - log_printf(stdout, " - Einzulesende Regionen: %d/%d * %d,%d \r", rmax, nread, x, y); + log_debug(" - Einzulesende Regionen: %d/%d * %d,%d \r", rmax, nread, x, y); } --rmax; @@ -1635,16 +1635,15 @@ int readgame(const char *filename, bool backup) update_interval(u->faction, u->region); } } - log_printf(stdout, "\n"); read_borders(&store); binstore_done(&store); fstream_done(&strm); /* Unaufgeloeste Zeiger initialisieren */ - log_printf(stdout, "fixing unresolved references.\n"); + log_debug("fixing unresolved references.\n"); resolve(); - log_printf(stdout, "updating area information for lighthouses.\n"); + log_debug("updating area information for lighthouses.\n"); for (r = regions; r; r = r->next) { if (r->flags & RF_LIGHTHOUSE) { building *b; @@ -1652,7 +1651,7 @@ int readgame(const char *filename, bool backup) update_lighthouse(b); } } - log_printf(stdout, "marking factions as alive.\n"); + log_debug("marking factions as alive.\n"); for (f = factions; f; f = f->next) { if (f->flags & FFL_NPC) { f->alive = 1; @@ -1699,7 +1698,7 @@ int readgame(const char *filename, bool backup) if (loadplane || maxregions >= 0) { remove_empty_factions(); } - log_printf(stdout, "Done loading turn %d.\n", turn); + log_debug("Done loading turn %d.\n", turn); return 0; } @@ -1805,7 +1804,7 @@ int writegame(const char *filename) WRITE_INT(&store, n); WRITE_SECTION(&store); - log_printf(stdout, " - Schreibe %d Parteien...\n", n); + log_debug(" - Schreibe %d Parteien...\n", n); for (f = factions; f; f = f->next) { if (fval(f, FFL_NPC)) { clear_npc_orders(f); @@ -1819,13 +1818,12 @@ int writegame(const char *filename) n = listlen(regions); WRITE_INT(&store, n); WRITE_SECTION(&store); - log_printf(stdout, " - Schreibe Regionen: %d \r", n); + log_debug(" - Schreibe Regionen: %d", n); for (r = regions; r; r = r->next, --n) { /* plus leerzeile */ if ((n % 1024) == 0) { /* das spart extrem Zeit */ - log_printf(stdout, " - Schreibe Regionen: %d \r", n); - fflush(stdout); + log_debug(" - Schreibe Regionen: %d", n); } WRITE_SECTION(&store); WRITE_INT(&store, r->x); @@ -1876,7 +1874,6 @@ int writegame(const char *filename) binstore_done(&store); fstream_done(&strm); - log_printf(stdout, "\nOk.\n"); return 0; } From 5e28cc9de39d348ada9cdcb585d5b8399f6537cb Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 28 Sep 2015 11:31:58 +0200 Subject: [PATCH 3/3] re-enable valgrind --- tests/run-turn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run-turn.sh b/tests/run-turn.sh index e6b896618..4055613e5 100755 --- a/tests/run-turn.sh +++ b/tests/run-turn.sh @@ -30,7 +30,7 @@ set -e cd $ROOT/tests setup cleanup -#VALGRIND=`which valgrind` +VALGRIND=`which valgrind` SERVER=../Debug/eressea/eressea if [ -n "$VALGRIND" ]; then SUPP=../share/ubuntu-12_04.supp