Commit Graph

171 Commits

Author SHA1 Message Date
Enno Rehling d94cde67a4 kill autoconf.h, replace platform.h for C99 compatibility work 2017-01-26 18:03:48 +01:00
Enno Rehling d71d5e413a eliminate unnecessary strncpy use. 2017-01-26 17:57:21 +01:00
Enno Rehling a4badc0a75 remove quicklist shim, use selist everywhere 2017-01-26 17:41:21 +01:00
Enno Rehling c72b050a42 WIP: quicklist->selist shim can compile and link, but tests crash 2017-01-26 10:53:52 +01:00
Enno Rehling e52cf75c59 remove autoconf.h from platform.h, fix lots of includes 2016-11-25 20:15:11 +01:00
Enno Rehling 7f9313f1a7 static analysis warnings.
PVS-Studio warnings reduced or suppressed.
2016-11-23 18:56:40 +01:00
Enno Rehling 19a0c2ddb3 quelling some static analysis complaints. 2016-11-19 20:57:10 +01:00
Enno Rehling 303eb86399 factionid and curseid are also boring. 2016-11-17 21:29:15 +01:00
Enno Rehling cbb18edb8f declutter config.h, use it sparingly. 2016-11-17 10:38:09 +01:00
Enno Rehling 467ffe2db0 include guard.h directly, not through laws.h 2016-11-01 22:11:10 +01:00
Enno Rehling 92d027014a Make runtests more verbose in case of errors.
Eliminate stray ERROR messages from tests.
2016-10-31 20:36:05 +01:00
Enno Rehling 754ad78db7 WIP: remove GUARD_* flags.
TODO: does not compile
TODO: write new guard.test.c tests
2016-10-31 07:45:06 +01:00
Enno Rehling fb470b7af1 re-organize lighthouse reporting. 2016-10-05 20:36:01 +02:00
Enno Rehling c53ac9d8aa remove RS_FARVISION, it is the only spell that uses units. 2016-10-01 21:03:16 +02:00
Enno Rehling 15702daf99 Add a new attribute and RF_OBSERVER flag. 2016-09-25 13:01:51 +02:00
Enno Rehling 87873702ca eliminate RS_FARVISION enum, there is no other kind of RC_SPELL. 2016-09-24 20:31:31 +02:00
Enno Rehling d758f065d5 only use lists for lighthouses with range > 3. 2016-09-24 11:33:00 +02:00
Enno Rehling 9eb376e0e5 clumsy repair of duplicate regions for range >= 2 (RF_MARK) 2016-09-24 11:20:33 +02:00
Enno Rehling c755c1d69e for short lighthouse ranges, don't use lists. 2016-09-23 19:51:33 +02:00
Enno Rehling b0905f8e6e incomplete new get_regions_distance implementation 2016-09-23 17:03:18 +02:00
Enno Rehling c606a9ac4d extract RC_SPELL handling into a small function, minimize get_race calls. 2016-09-22 20:22:23 +02:00
Enno Rehling a3ad9a0222 I am now calling get_race far too often. Fix this a bit. 2016-09-20 20:27:41 +02:00
Enno Rehling 69b420ae2f separate interval generation from seen-markup a bit more. 2016-09-20 15:53:55 +02:00
Enno Rehling f8ac5c390d SAMRT_INTERVALS is no longer an option, but regular 2016-09-20 09:39:21 +02:00
Enno Rehling ec9d8eab1c fix marking seen_neighbour regions.
fix reports-tests that didn't think about them.
2016-09-18 13:27:25 +02:00
Enno Rehling 7349ec0aa9 improve lighthouse tests.
you must be inside lighthouse to get a report from it.
2016-09-17 13:20:02 +02:00
Enno Rehling 0753ea0174 fix travelthru reporting (passes unit test) 2016-09-17 08:28:33 +02:00
Enno Rehling a86e30d014 re-enable report testing, find out that it fails. 2016-09-16 21:17:54 +02:00
Enno Rehling 783c042d50 Merge branch 'develop' into kill-seen-region
Conflicts:
	src/reports.c
2016-09-16 19:11:05 +02:00
Enno Rehling acfa2cfbe5 remove view functions for special planes (Regatta). 2016-09-16 18:59:24 +02:00
Enno Rehling d449ce4a8c re-enable report writing, fix report.c to work without seen_region 2016-09-16 18:03:28 +02:00
Enno Rehling dfbc520203 add a simple test for prepare_report.
TODO: it is _too_ simple.
2016-09-14 21:46:57 +02:00
Enno Rehling 929db73102 disable integration tests
combine prepare_ functions
2016-09-14 17:14:04 +02:00
Enno Rehling 8ec37783e2 fix nul-pointer access 2016-09-13 21:13:26 +02:00
Enno Rehling 20578da0e9 delete the old seen.* files
remove includes for seen.h
remove unused functions
2016-09-13 16:58:48 +02:00
Enno Rehling 71fa3600f7 recalculate [first,last) after lighthouses aand trvelthru 2016-09-13 09:09:35 +02:00
Enno Rehling 652ead4f60 prepare_seen has to check for ctx->f. we are no longer preparing everyone at once 2016-09-13 07:46:08 +02:00
Enno Rehling a67950433d WIP: prepare_seen vs lastregion/firstregion.
lighthouses and travelthru are handled by both, should only be in prepare_seen?
2016-09-12 22:03:16 +02:00
Enno Rehling 84bc6c58a8 prepare_reports gone
prepare_seen is something else now
unit tests are crashing
2016-09-12 15:59:22 +02:00
Enno Rehling dda845e2f4 free configuration data (valgrind calls it still-reachable leaks). 2016-09-07 20:46:41 +02:00
Enno Rehling d9e541843b further reduce number of bt_find calls. 2016-08-30 09:36:09 +01:00
Enno Rehling 5bb9a10a46 is_building_type should be a quicker way to test for a building type than bt_find. 2016-08-30 09:13:59 +01:00
Enno Rehling 8ff26eb0e4 optimization: no need to look for a curse if unit has no attribs. 2016-08-29 19:41:21 +01:00
Enno Rehling 40d9ebfa94 reduce code duplication: itemcloak code was copied between NR and CR. 2016-08-29 19:37:47 +01:00
Enno Rehling 5a73fc80d8 telepath_see is a planned, but never realized, feature. delete it. 2016-08-29 18:20:36 +01:00
Enno Rehling 4bc8817056 remove a TODO that was ill-advised. The reason that "resources" is a list is that it's built incrementally. 2016-08-29 18:15:20 +01:00
Enno Rehling ef44a4534e add a test for copying resources message arguments.
my plan is to add a new argument type for arrays of resources with fewer allocations.
2016-08-29 17:31:09 +01:00
Enno Rehling 2c5063095d fixed: tests that try to create duplicate spells do not spam stderr. 2016-08-29 14:49:31 +01:00
Enno Rehling 6ca3f04b89 issue #538: default terrain
I think it's unnecessary, so delete it
2016-08-20 23:42:15 +02:00
Enno Rehling 7cbd23c26b fix error detection during report writing 2016-08-06 20:50:27 +02:00
Enno Rehling e6f3dc8b85 Merge branch 'master' into develop
Conflicts:
	scripts/run-turn.lua
	src/buildno.h
	src/kernel/group.c
	src/kernel/save.c
	src/kernel/save.test.c
	src/kernel/version.h
	src/util/password.c
	src/util/password.test.c
	tests/run-turn.sh
2016-02-23 10:47:33 +01:00
Enno Rehling 29c9e719da eliminate plane.watchers feature
. we don't use them anywhere
. they have no tests
. they crash readgame when watchers have died
2016-02-18 08:48:54 +01:00
Enno Rehling 8a3bb35987 eliminate global log_flags, revert the mode arguments for fopen.
turns out that text is default, and windows hates it if I open a binary file without 'b'
standardize on using join_path to create filenames
(use backslash on windows, even though fopen doesn't seem to care).
2016-02-05 23:10:05 +01:00
Enno Rehling d0f8723ffb refactoring: eliminate a_findc, and too much const-fuckery 2016-02-01 17:31:03 +01:00
Enno Rehling 2f2bbb16ab remove wild mkdir calls all over the code, catch EEXIST errors
use join_path more consistently
fix a test that's intermittent on windows because fopen(..., "wb") fails, why?
2016-02-01 09:26:24 +01:00
Enno Rehling 74d8b53ba8 fix a TODO, reduce size of icastle_data 2015-12-17 12:59:12 +01:00
Enno Rehling 64b84481b2 refactoring: move parsing and allies code out of config.c 2015-11-24 18:52:09 +01:00
Enno Rehling edcd79d044 add a config_token function to look for a token inside a list 2015-11-22 12:20:33 +01:00
Enno Rehling a4cb5e2906 replace all get_param_* for global.parameters with config_get_* 2015-11-22 10:44:46 +01:00
Enno Rehling efc87a16e3 clarify dragon planning code (bug 2159) 2015-11-16 16:57:51 +01:00
Enno Rehling 2e7a1a3ded CID 32208 Time of check time of use 2015-11-09 18:03:19 +01:00
Enno Rehling 4ae94eaa3f fix compilation 2015-11-05 14:06:26 +01:00
Enno Rehling 5f99288af1 CID 22581 Time of check time of use
CID 22582 Time of check time of use
CID 30743 Time of check time of use
2015-11-05 13:27:38 +01:00
Enno Rehling 91758d2e51 CID 22439 Unchecked return value from library 2015-11-05 09:00:52 +01:00
Enno Rehling 52edf15cec CID 22438 Unchecked return value from library 2015-11-05 08:57:56 +01:00
Enno Rehling c9f886078b CID 22452 'Constant' variable guards dead code
github issue #353 there is no a_fshidden attribute.
2015-11-04 19:08:45 +01:00
Enno Rehling 68f8f0830e CID 22561: Copy into fixed size buffer (STRING_OVERFLOW) 2015-10-30 11:45:20 +01:00
Enno Rehling 0de6e5ecb8 CID 22564: Copy into fixed size buffer (STRING_OVERFLOW)
buffer sizes => bsdstring.h
2015-10-30 11:13:48 +01:00
Enno Rehling feb915fe4a eliminate deprecated reporting function, static variable 2015-10-27 12:40:04 +01:00
Enno Rehling e23a7fc87d deprecate report_kampfstatus and implement a replacement function. 2015-10-27 12:40:04 +01:00
Enno Rehling f740f2829a leak: in tests, when correct message_type doesn't exist, arguments should not leak 2015-10-14 20:41:42 +02:00
Enno Rehling 936c201d0b Merge pull request #312 from eressea/master
pull latest changes from master into develop
2015-10-11 16:47:29 +02:00
Enno Rehling 6a074fd294 only disable MSVC2015 warnings in MSVC2015, do not break confuse compilers. 2015-10-11 14:39:51 +02:00
Enno Rehling e8880db447 get the code to compile under vs2015 (disable warnings) 2015-10-11 14:39:43 +02:00
Enno Rehling 5f7b9129bc Merge branch 'master' into develop
Conflicts:
	tests/runtests.bat
2015-09-12 22:47:33 +02:00
Enno Rehling 06a04d0e20 fix logging for sp_igjarjuk, temporarily set log-levels for the game to error|warn|info
remove some code that accesses `verbosity` variable (todo: hide it more, fix logging)
2015-09-12 19:48:03 +02:00
Enno Rehling d29d38f710 refactor donations into a seaprate code module, add a basic test 2015-09-09 15:45:20 +02:00
Enno Rehling 65c39866e1 refactor: add a faction_add_seen function that also updates [first, last) interval.
add tests for add_seen.
disable test_faction_add_seen, looks like it needs a valgrind check?
2015-09-09 11:08:33 +02:00
Enno Rehling 7f9e84d68b fix neighbor seen_region collection. 2015-09-09 10:22:04 +02:00
Enno Rehling 3eabf082ac refactor prepare_report to extract prepare_seen, because we assume the bug is in there.
add a failing test for it to prove that bug is in here.
2015-09-09 09:04:59 +02:00
Enno Rehling 1fbbba564b add a unit test for the problem that fails (test_seen_interval_forward) 2015-09-08 16:28:47 +02:00
Enno Rehling 9312b44f8e move seen_region logic to a separate seen.[hc] module for testing.
currently failing test:

  1) Failure (tests.report.test_lighthouse):
  ./scripts/tests/common.lua:1051: true expected but was false
2015-09-08 09:56:56 +02:00
Enno Rehling d64948f0fc eliminate duplicate call to link_seen (and report_context.seen) 2015-09-07 19:48:53 +02:00
Enno Rehling de808bf146 change effskill signature to take a region, change eff_skill to work on a skill * to avoid multiple lookups. 2015-08-27 16:16:55 +02:00
Enno Rehling fc308940b5 fix linux build 2015-08-19 14:50:24 +02:00
Enno Rehling a9ecd1f55e replace all at_travelunit code with travelthru_map calls.
welcome to callback hell.
this should stop the buffer for travelthru from running over.
tests for this should be hell, and I still owe writing them.
2015-08-19 14:37:51 +02:00
Enno Rehling ebe365fd6e move travelthru logic to a separate module. todo: split off the report writing from the collection of units. 2015-08-18 18:57:04 +02:00
Enno Rehling c8cbeea660 STRLCPY macro redefinition and fixes for gcc. work for monkeys. 2015-08-17 22:48:21 +02:00
Enno Rehling dcececf4fa Debug: move errno testing closer to the report-writing, so we know which report caused the error.
Fix: wrptr gets the result from _snprintf, which is int, not size_t.
2015-08-17 16:17:08 +02:00
Enno Rehling b8a2b9d0b7 Merge pull request #7 from ennorehling/feature/bug-2101-study-teach-testing
bug 2101: increase max printed length of orders
2015-08-06 17:05:32 +02:00
Enno Rehling 1e6a83f357 resize buffer in eval_command, it was too small for many commands.
increase MAXTEACHERS.
eliminate oldterrain warning in json_report.
2015-08-06 16:52:24 +02:00
Enno Rehling 0f5567b7f8 fix missing include (gcc) 2015-08-05 16:02:15 +02:00
Enno Rehling 8dc4e93e90 fix missing units from CR, add a test, partially convert from FILE* to stream 2015-08-05 14:45:46 +02:00
Enno Rehling 4d061d8592 repair update_long_order and K_DESTROY handling according to discussion in https://bugs.eressea.de/view.php?id=2080 2015-08-04 22:47:55 +02:00
Enno Rehling 979f3460d6 Bug 1805: re-enable NMR warnings
https://bugs.eressea.de/view.php?id=1805
move warnings to the top of the list of errors in the NR
2015-07-03 15:31:57 +02:00
Enno Rehling 3ba2b3d4d7 indentation fixes (tab->spaces) 2015-06-26 14:31:21 +02:00
Enno Rehling 9b7a4e813b functional test for forced leave configuration.
functional test for forced leave after combat.
functional test for MAKE TEMP.
error handling for Lua function building.create().
reduce some errors to warnings.
initialize race.battle_flags correctly (when not created through XML).
re-initialize processor in case config has changed.
handle missing translation of combat status, with error message.
2015-06-19 13:17:01 +02:00
Enno Rehling 22ae1b63de Merge pull request #201 from badgerman/issue-199-sparagraph
bugfix sparagraph (github issue #199).
2015-05-20 22:54:53 +02:00
Enno Rehling 465dcf4e1c bugfix sparagraph (github issue #199).
adding tests.
2015-05-20 18:05:25 +02:00
Enno Rehling 3a03579a65 rename set_origin/get_origin into faction.c, remove argument from adjust_coordinates. add test for bug 2070. 2015-05-19 08:27:16 +02:00