starting to see diminishing returns.

This commit is contained in:
Enno Rehling 2018-12-15 20:12:53 +01:00
parent 7b8bc8af0f
commit 3fec7eb4e3
5 changed files with 14 additions and 4 deletions

2
clibs

@ -1 +1 @@
Subproject commit d80ba4b609c2aebf5bf38da60367dc0f0e2d50b9 Subproject commit 1854780fe3073e491775836c22f709668b1fff62

View File

@ -65,8 +65,11 @@ static building_type *setup_castle(item_type *it_stone) {
btype = test_create_buildingtype("castle"); btype = test_create_buildingtype("castle");
stage = btype->stages = calloc(1, sizeof(building_stage)); stage = btype->stages = calloc(1, sizeof(building_stage));
if (!stage) abort();
cons = stage->construction = calloc(1, sizeof(construction)); cons = stage->construction = calloc(1, sizeof(construction));
if (!cons) abort();
cons->materials = calloc(2, sizeof(requirement)); cons->materials = calloc(2, sizeof(requirement));
if (!cons->materials) abort();
cons->materials[0].number = 1; cons->materials[0].number = 1;
cons->materials[0].rtype = it_stone->rtype; cons->materials[0].rtype = it_stone->rtype;
cons->minskill = 1; cons->minskill = 1;
@ -74,8 +77,11 @@ static building_type *setup_castle(item_type *it_stone) {
cons->reqsize = 1; cons->reqsize = 1;
cons->skill = SK_BUILDING; cons->skill = SK_BUILDING;
stage = stage->next = calloc(1, sizeof(building_stage)); stage = stage->next = calloc(1, sizeof(building_stage));
if (!stage) abort();
cons = stage->construction = calloc(1, sizeof(construction)); cons = stage->construction = calloc(1, sizeof(construction));
if (!cons) abort();
cons->materials = calloc(2, sizeof(requirement)); cons->materials = calloc(2, sizeof(requirement));
if (!cons->materials) abort();
cons->materials[0].number = 1; cons->materials[0].number = 1;
cons->materials[0].rtype = it_stone->rtype; cons->materials[0].rtype = it_stone->rtype;
cons->minskill = 1; cons->minskill = 1;

View File

@ -19,7 +19,8 @@ const char *eressea_version(void) {
} }
int version_no(const char *str) { int version_no(const char *str) {
int maj = 0, min = 0, pat = 0; int c, maj = 0, min = 0, pat = 0;
sscanf(str, "%4d.%4d.%4d", &maj, &min, &pat); c = sscanf(str, "%4d.%4d.%4d", &maj, &min, &pat);
assert(c == 3);
return (maj << 16) | (min << 8) | pat; return (maj << 16) | (min << 8) | pat;
} }

View File

@ -277,6 +277,7 @@ void test_create_calendar(void) {
config_set_int("game.start", 184); config_set_int("game.start", 184);
months_per_year = 9; months_per_year = 9;
month_season = malloc(sizeof(int) * months_per_year); month_season = malloc(sizeof(int) * months_per_year);
if (!month_season) abort();
month_season[0] = SEASON_SUMMER; month_season[0] = SEASON_SUMMER;
month_season[1] = SEASON_AUTUMN; month_season[1] = SEASON_AUTUMN;
month_season[2] = SEASON_AUTUMN; month_season[2] = SEASON_AUTUMN;

View File

@ -250,8 +250,10 @@ char *__crypt_gensalt_ra(const char *prefix, unsigned long count,
if (!dst) if (!dst)
__set_errno(ENOMEM); __set_errno(ENOMEM);
#endif #endif
if (dst) {
retval = memcpy(dst, retval, len); retval = memcpy(dst, retval, len);
} }
}
return retval; return retval;
} }