Commit Graph
100 Commits
Author SHA1 Message Date
SHIRAKATA Kentaro d2af1afb52 split "swallowit" on throwit() into a separate function 2025-03-04 21:31:17 +09:00
SHIRAKATA Kentaro bcf7bfc52e add a short README for test/ 2025-03-01 15:01:14 +09:00
SHIRAKATA Kentaro 83bb81c624 fix Makefile.nmake when USE_DLB=N 2025-03-01 00:12:03 +09:00
SHIRAKATA Kentaro 88a571fab8 add sanity check on parse_status_hl2()
dt is initialized with -1, and it's not so obvious that it will be always overwritten later.
2025-01-16 01:41:48 +09:00
SHIRAKATA Kentaro 36443c965b second argument of check_version() can take NULL
There is a code path starting at restore.c line 830.

    (void) validate(nhfp, (char *) 0, FALSE);
2025-01-13 13:57:40 +09:00
SHIRAKATA Kentaro 9b7bcf67ba change the type of xytod()'s return value to int
xytod()'s return value is an index, so its type should be int, not coordxy.
2025-01-12 14:37:13 +09:00
SHIRAKATA Kentaro aba2bda159 split eval_offering() into a separate function 2024-11-16 04:10:11 +09:00
SHIRAKATA Kentaro 2ee31972a5 unify to early return on offer_corpse()
* remove redundant `else`
 * reduce indent
2024-11-12 22:50:17 +09:00
SHIRAKATA Kentaro 93072b8784 shrink scopes of some vars on offer_corpse() 2024-11-11 17:34:32 +09:00
SHIRAKATA Kentaro e23095a829 omit return value of offer_corpse(), as it is always ECMD_TIME 2024-11-10 22:46:31 +09:00
SHIRAKATA Kentaro db460a4fcf split offering a corpse into a separate function 2024-11-09 02:35:19 +09:00
SHIRAKATA Kentaro ffe2dfc17c split offering negative valued items into a separate function 2024-11-07 03:30:13 +09:00
SHIRAKATA Kentaro b953625e5b early return when value == 0 on dosacrifice()
`calc_value()` returns a non-negative value, and there is no code that sets `value` to 0 after this point.
2024-11-05 15:30:07 +09:00
SHIRAKATA Kentaro 955c2c5faf early return on dosacrifice()
... to reduce indents and prepare further refactorings.
2024-11-05 00:50:19 +09:00
SHIRAKATA Kentaro ce41d32c2c split "got_target" on use_leash() into a separate function 2024-11-03 03:06:17 +09:00
SHIRAKATA Kentaro 3f3e1cc49a split calculating sacrifice value into a separate function 2024-10-30 13:36:42 +09:00
SHIRAKATA Kentaro bb401fcb38 split a message of a rock disappearing into a separate function
... to prepare further refactoring
2024-10-27 00:48:01 +09:00
SHIRAKATA Kentaro d2b7c2f5c5 split "assess_dmg" on passiveum() into a separate function 2024-10-15 03:21:08 +09:00
SHIRAKATA Kentaro 666b053c09 split "dopush" on moverock_core() into a separate function 2024-10-09 23:00:16 +09:00
SHIRAKATA Kentaro 387b23f633 split "nopushmsg" on moverock_core() into a separate function 2024-09-28 04:47:25 +09:00
SHIRAKATA Kentaro d6890a38fa split "finishi_splitting" into a separate function 2024-09-22 14:54:44 +09:00
SHIRAKATA Kentaro ee137de820 eliminate some gotos on do_earthquake() 2024-09-20 01:00:37 +09:00
SHIRAKATA Kentaro aaac9dc1f7 split making pits on do_earthquake() into a separate function 2024-09-20 01:00:37 +09:00
SHIRAKATA Kentaro f98f7d0bba split "cannot_push" on moverock_done() into a separate function 2024-09-16 16:03:20 +09:00
SHIRAKATA Kentaro f1626f48ea split moverock_core() into a separate function
... to force a call to moverock_done() at the end.
2024-09-13 02:51:11 +09:00
SHIRAKATA Kentaro 7bb1d4a827 unify moverock() to "early return" style
... to prepare further refactorings.
2024-09-03 23:46:21 -07:00
SHIRAKATA Kentaro 01910d2998 split "moverock_done" into a separate function 2024-08-17 18:13:35 -07:00
SHIRAKATA Kentaro 39665ba017 split "getcad" into a separate function 2024-08-17 18:07:51 -07:00
SHIRAKATA Kentaro 94eef3c3db split "poof" in potion_dip() into a separate function 2024-08-17 18:02:03 -07:00
SHIRAKATA Kentaro 82e6eacfbb split returning from throwit() into separate function 2024-07-13 19:38:23 -07:00
SHIRAKATA Kentaro ce9abbc52d split monster escaping the dungeon into separate function 2024-05-31 10:27:31 -07:00
SHIRAKATA Kentaro c68f870819 split 'nothing_special' of arti_invoke() into separate function 2024-05-31 10:15:25 -07:00
SHIRAKATA Kentaro 982e98a177 Update history to sync with the Guidebook 2024-03-20 04:29:05 +09:00
SHIRAKATA Kentaro 6ff799d4f9 split damage from acid potion into separate function 2024-01-09 22:45:23 +09:00
SHIRAKATA Kentaro ea62674621 delete ancient commented out codes
These codes have been commented out since 3.4.3, at least.
2024-01-06 15:29:11 -08:00
SHIRAKATA Kentaro 358278938a add sanity check on choose_classes_menu()
If class_list contains an illegal char for mon/obj class (even if it should not happen), it might cause out-of-bound access.
2023-12-16 14:49:05 +09:00
SHIRAKATA Kentaro 190d840d2a remove unnecessary null-check on gold_detect()
`sobj` here is always non-null, otherwise it leads segv at earlier code.
2023-12-13 15:52:51 +09:00
SHIRAKATA Kentaro 7b8998aa34 remove unused argument on display_trap_map() 2023-12-12 17:55:49 +09:00
SHIRAKATA Kentaro 5de1f6e5ed remove unnecessary null-check on hmon_hitmon_poison()
`obj` here is always non-null, otherwise it leads segv at earlier code.
2023-12-11 13:47:07 +09:00
SHIRAKATA Kentaro 027b325a3d remove unnecessary null-check on get_table_mapchr_opt()
`name` here is always non-null, otherwise it leads segv at earlier code.
2023-12-06 11:23:10 +09:00
SHIRAKATA Kentaro b36d792334 remove unnecessary null-check on bhitm()
`otmp` here is always non-null, otherwise it leads segv at earlier code.
2023-12-04 22:14:37 +09:00
SHIRAKATA Kentaro fffb1d53ff split 'postmov' of m_move() into separate function 2023-12-01 03:37:47 -08:00
SHIRAKATA Kentaro 3ab0d92ac9 remove unnecessary condition on save_mtraits()
`mtmp->data` here is always non-null, otherwise it leads segv at earlier code.
2023-12-01 02:05:38 +09:00
SHIRAKATA Kentaro 5f6535728d remove unnecessary condition on use_offensive()
`otmp` here is always non-null, otherwise it leads segv at earlier code.
2023-11-29 11:27:20 -08:00
SHIRAKATA Kentaro 51042bb0df remove unnecessary condition on optfn_pickup_types()
`opts` here is always non-null, otherwise it leads segv at earlier code.
2023-11-14 11:40:34 -08:00
SHIRAKATA Kentaro 4250dd91d8 split wand explosion into separate function 2023-11-13 07:24:15 -08:00
SHIRAKATA Kentaro e4dc88bdea early return on do_play_instrument() 2023-11-12 15:12:05 +09:00
SHIRAKATA Kentaro 3db06f4c6d split discarding broken wand into separate function 2023-11-10 16:46:06 +09:00
SHIRAKATA Kentaro 637db78cea streamline dosacrifice(): early return when offering other than corpse 2023-11-09 21:32:32 -08:00
SHIRAKATA Kentaro eb03b1a6db remove unnecessary condition on parseoptions()
`opts` here is always non-null, otherwise it leads segv at earlier code.
2023-11-09 12:37:25 +09:00
SHIRAKATA Kentaro 7d007ea365 null-check argument bl before using it 2023-11-09 00:10:23 +09:00
SHIRAKATA Kentaro 7e735d9386 remove unused assignments 2023-11-07 16:26:12 -08:00
SHIRAKATA Kentaro d5fa2f8ba0 Split sacrificing same race into separete function 2023-11-04 13:52:31 +09:00
SHIRAKATA Kentaro 97edd4b845 split offering fake amulet into separate function 2023-07-04 22:19:04 -07:00
SHIRAKATA Kentaro c543ff1f6b Split bestowing artifact into separete function 2023-04-10 09:09:27 +03:00
SHIRAKATA Kentaro 3b567dd74e prevent free()ing static buffer on save_luadata() 2023-04-06 02:17:31 -07:00
SHIRAKATA Kentaro 6e1016be45 split kicking a door into a separate function 2023-02-14 09:16:47 +02:00
SHIRAKATA Kentaro 32080bc7fd split offering to different alignment alter into a separate function 2023-02-06 16:05:35 -08:00
SHIRAKATA Kentaro 38cb1b9096 split offering the real amulet into a separate function 2023-01-26 08:19:39 -08:00
SHIRAKATA Kentaro 06615b6e9e substitute non-ASCII chararacters in Makefile.nmake 2023-01-25 04:09:02 +09:00
SHIRAKATA Kentaro b8ec2dfc96 Avoid casting time_t to int
As time_t may not fit int, cast -1 to time_t instead.
2023-01-24 13:48:43 +09:00
SHIRAKATA Kentaro 0d441b0c2f remove the code to silence lint
Warning facilities on recent compilers are incredibly improved,
so the code to silence "good-old" lint is much less sense.
2022-11-19 00:49:11 -08:00
SHIRAKATA Kentaro 99d974333c remove GCC_WARN
Now, the only usage of GCC_WARN is for the guard of PRINTF_F in wincurs.h.
This guard can be removed safely, as PRINTF_F is already used unconditionally in extern.h.
2022-11-08 12:09:26 -08:00
SHIRAKATA Kentaro 79927d70a0 remove the code for embedding SCCS ID
This code is for UNIXy build, but current UNIXy builds define GCC_WARN,
so this is never used.

(After all, embedding SCCS ID itself is out of date.)
2022-10-31 15:57:28 +09:00
SHIRAKATA Kentaro 2a8ddf1145 remove duplicate code
Here, `then` clause and `else` clause is identical.
2022-09-21 17:00:01 -07:00
SHIRAKATA Kentaro 4e3fc4dcb0 remove unnecessary if 2022-08-19 06:22:01 -07:00
SHIRAKATA Kentaro b3b09bca5a split "letknow" into separate function 2022-07-22 13:07:22 -07:00
SHIRAKATA Kentaro 58b32e76f0 split starving dog into separate function 2022-07-20 14:40:50 -07:00
SHIRAKATA Kentaro 8a78442e2d remove unnecessary code on destroy_one_item()
`physical_damage` is initialized to FALSE, and no codes change it.
2022-06-28 12:52:06 -07:00
SHIRAKATA Kentaro a377a1fc67 split displaying trap map into separate function 2022-06-28 12:39:38 -07:00
SHIRAKATA Kentaro 20fa315bfc fix warnings 2022-06-11 17:18:34 +09:00
SHIRAKATA Kentaro d23f26077b remove unnecessary null-check on parsesymbols()
`strval` here is always non-null,
because the null-check is done in earlier code.
2022-06-08 05:28:32 +09:00
SHIRAKATA Kentaro ed7fb3895f split cleaning-up on gd_move() into separate function 2022-06-06 20:28:21 +09:00
SHIRAKATA Kentaro 4faf79dccc fix memory leaks related to selection_new()
selection_new() returns an address of malloc()'ed buffer.
If ov is null, this value is discarded without freeing the buffer.
To avoid this, move null-checks before calling selection_new().

Also, remove null-check of the return value of selection_new()
because it always returns non-null.
2022-06-01 21:38:51 +09:00
SHIRAKATA Kentaro 95fdd85b82 split "act_on_act" into separate function 2022-05-29 06:40:44 +09:00
SHIRAKATA Kentaro 3baa00bb1e adjust the function name in impossible() 2022-05-21 00:33:53 +09:00
SHIRAKATA Kentaro 0315cd876a split fixing curse trouble into separate function 2022-05-19 02:42:31 +09:00
SHIRAKATA Kentaro 0b00f97766 kickobjnam on dokick() is assigned only kicking object 2022-05-13 15:51:08 -07:00
SHIRAKATA Kentaro 4da4584633 split getting damages with a kick into separate function 2022-05-10 05:45:39 +09:00
SHIRAKATA Kentaro 037683581f split adjusting attributes into separate function 2022-05-09 20:38:15 +09:00
SHIRAKATA Kentaro 317bc9b3c2 split kicking empty space into separate function 2022-05-07 21:12:01 +09:00
SHIRAKATA Kentaro 397476a8a1 update condition for displaying on #version 2022-05-03 14:39:24 -07:00
SHIRAKATA Kentaro 1a361af084 add msghandler support for win32 2022-05-03 14:39:24 -07:00
SHIRAKATA Kentaro d6079b4ccb Separate some codes for desecratintg high altar
... and remove one goto.
2022-04-29 23:22:19 -07:00
SHIRAKATA Kentaro 0be21a231c remove redundant condition on tty_add_menu()
`newstr` is assigned to `str` or `buf`.
`buf` is an address of an array, and `str` is guarded,
so both are non-NULL.
2022-04-29 23:08:17 -07:00
SHIRAKATA Kentaro 4a79d4195a remove unnecessary null-check on wc_set_window_colors()
mungspaces() returns its argument itself, so `newop` is assigned to `buf`, and always non-null.
`tfg` and `tbg` is assigned to (some addition of) `newop`, so these are also always non-null.
2022-04-24 00:08:52 -07:00
SHIRAKATA Kentaro 949c30dffa remove redundant condition on adj_pit_checks()
supporting is never null, as outer if statement checks it.
2022-04-20 00:00:46 -07:00
SHIRAKATA Kentaro 8497b1c8ec Separate function for offering too soon 2022-04-08 09:39:30 -07:00
SHIRAKATA Kentaro 367ea0e6d6 add initializer on use_tinning_kit()
If poly_when_stoned() is true, an uninitialized buffer kbuf[] is passed to instapetrify().
Although instapetrify() doesn't access it in that situation for now,
it should be initialized anyway for readability.
2022-03-25 15:47:51 +09:00
SHIRAKATA Kentaro 291d872f62 move null-check on savelev()
Move null-check of ttmp before its first use.
2022-03-24 04:16:16 +09:00
SHIRAKATA Kentaro 1c7faa0585 Add explicit cast to void
All other these calls not using a return value have a cast.
2022-03-19 20:50:40 +09:00
SHIRAKATA Kentaro b82f5fa28f remove redundant null-check on untrap_prob()
`ttmp` should not be NULL here, otherwise this function will crash at earlier code.
2022-03-11 09:56:35 -08:00
SHIRAKATA Kentaro 467777539e add explicit cast on somexy() call
All other somexy() calls not using a return value have a cast.
2022-03-10 06:12:01 +09:00
SHIRAKATA Kentaro 757139476f move validations before their first use 2022-02-25 22:41:21 -08:00
SHIRAKATA Kentaro dc7d434f98 add missing initializer of jcp 2022-02-20 14:43:33 -08:00
SHIRAKATA Kentaro bb5150445a Check the return value of nhl_init() on com_pager_core()
nhl_init() can return NULL.
2022-02-12 07:45:46 -08:00
SHIRAKATA Kentaro 7c1dba3f0b remove redundant null-check on christen_orc()
rndorcname() returns buf2 itself, so orcname is never NULL.
2022-02-11 16:52:50 +09:00
SHIRAKATA Kentaro 9bd8bcdcfb move null-check on tin_details()
Move null-check of obj and buf before their first use.
2022-02-10 05:16:29 +09:00
SHIRAKATA Kentaro 128966bfe1 move null-check on savelev()
Move null-check of nhfp before its first use.
2022-02-10 01:25:13 +09:00
SHIRAKATA Kentaro b55954b2a1 Add null-check on repairable_damage()
Add null-check of dam before its first use.
2022-02-09 05:54:27 +09:00