From 2211111b29830088e52b67cdc4d89e27328d48a4 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 25 Aug 2014 00:35:49 +0200 Subject: [PATCH] Remove a German-only piece of text, to reduce the footprint of fleets in the report a little. Fix English score message in NR. Small fixes to meet Visual Studio warning level 4. --- res/core/messages.xml | 3 +-- src/report.c | 2 ++ src/test_eressea.c | 2 +- src/util/bsdstring.test.c | 12 ++++++------ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/res/core/messages.xml b/res/core/messages.xml index 1195562e8..fd601adf0 100644 --- a/res/core/messages.xml +++ b/res/core/messages.xml @@ -854,7 +854,7 @@ "Deine Partei hat $int($score) Punkte. Der Durchschnitt für Parteien ähnlichen Alters ist $int($average) Punkte." - "Your faction has a score of $int($score). The average score for similar factions is $int($average)." + "Your faction has a score of $int($score). The average score for similar factions is $int($average)." @@ -862,7 +862,6 @@ "Report für $game, $date" - "Report for $game, $date" "Report for $game, $date" diff --git a/src/report.c b/src/report.c index 96a29cbf9..c6e4bc821 100644 --- a/src/report.c +++ b/src/report.c @@ -1417,6 +1417,7 @@ static void durchreisende(FILE * F, const region * r, const faction * f) if (cansee_durchgezogen(f, r, u, 0)) { ++counter; if (u->ship != NULL) { +#ifdef GERMAN_FLUFF_DISABLED if (counter == 1) { bytes = (int)strlcpy(bufp, "Die ", size); } @@ -1427,6 +1428,7 @@ static void durchreisende(FILE * F, const region * r, const faction * f) WARN_STATIC_BUFFER(); break; } +#endif bytes = (int)strlcpy(bufp, shipname(u->ship), size); } else { diff --git a/src/test_eressea.c b/src/test_eressea.c index 7a1e83d48..8bc2f0dd4 100644 --- a/src/test_eressea.c +++ b/src/test_eressea.c @@ -4,7 +4,7 @@ #include #include - +#pragma warning(disable: 4210) #define ADD_TESTS(suite, name) \ CuSuite *get_##name##_suite(void); \ CuSuiteAddSuite(suite, get_##name##_suite()) diff --git a/src/util/bsdstring.test.c b/src/util/bsdstring.test.c index 29ae6b45e..42423a766 100644 --- a/src/util/bsdstring.test.c +++ b/src/util/bsdstring.test.c @@ -6,7 +6,7 @@ static void test_strlcat(CuTest * tc) { char buffer[32]; - memset(buffer, 0xfe, sizeof(buffer)); + memset(buffer, 0x7f, sizeof(buffer)); buffer[0] = '\0'; CuAssertIntEquals(tc, 4, strlcat(buffer, "herp", 4)); @@ -15,29 +15,29 @@ static void test_strlcat(CuTest * tc) buffer[0] = '\0'; CuAssertIntEquals(tc, 4, strlcat(buffer, "herp", 8)); CuAssertStrEquals(tc, "herp", buffer); - CuAssertIntEquals(tc, (char)0xfe, buffer[5]); + CuAssertIntEquals(tc, 0x7f, buffer[5]); CuAssertIntEquals(tc, 8, strlcat(buffer, "derp", 8)); CuAssertStrEquals(tc, "herpder", buffer); - CuAssertIntEquals(tc, (char)0xfe, buffer[8]); + CuAssertIntEquals(tc, 0x7f, buffer[8]); } static void test_strlcpy(CuTest * tc) { char buffer[32]; - memset(buffer, 0xed, sizeof(buffer)); + memset(buffer, 0x7f, sizeof(buffer)); CuAssertIntEquals(tc, 4, strlcpy(buffer, "herp", 4)); CuAssertStrEquals(tc, "her", buffer); CuAssertIntEquals(tc, 4, strlcpy(buffer, "herp", 8)); CuAssertStrEquals(tc, "herp", buffer); - CuAssertIntEquals(tc, (char)0xed, buffer[5]); + CuAssertIntEquals(tc, 0x7f, buffer[5]); CuAssertIntEquals(tc, 8, strlcpy(buffer, "herpderp", 8)); CuAssertStrEquals(tc, "herpder", buffer); - CuAssertIntEquals(tc, (char)0xed, buffer[8]); + CuAssertIntEquals(tc, 0x7f, buffer[8]); } static void test_slprintf(CuTest * tc)