summaryrefslogtreecommitdiffhomepage
path: root/src/fov.c
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2023-05-16 22:12:57 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2023-05-16 23:00:24 +0100
commitcba9387c361c3d33dcf1b21ff0e5beb4b0a81ade (patch)
treec3b590a682447959a41c0d90f690e59b23365a3d /src/fov.c
parent182b36609acc44d3338f64ca3975e1604b50f619 (diff)
Do some pedantic spring cleaning
- Use const in more places where it makes sense - not absolutely everywhere because it can get a bit annoying - Make all the instruction search loops a bit more readable by casting the function pointer into a temporary variable to loop over - Add a few more doc comments and fix a typo or two - Make that RTTI thing flexibly-sized, finally - Don't include gamedata.h in vcall.h for no reason; consequently include gamedata.h in a bunch of places where it was implictly pulled in before - Fix dbg_toghidra() and ent_getedict() having mismatched return types between their headers and respective source files - Remove that one broken, hacky, secret Portal non-feature that probably nobody even ended up using; it can be implemented properly later if required
Diffstat (limited to 'src/fov.c')
-rw-r--r--src/fov.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fov.c b/src/fov.c
index 1a0874c..236182a 100644
--- a/src/fov.c
+++ b/src/fov.c
@@ -1,5 +1,5 @@
/*
- * Copyright © 2022 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2023 Michael Smith <mikesmiffy128@gmail.com>
* Copyright © 2022 Willian Henrique <wsimanbrazil@yahoo.com.br>
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -50,9 +50,9 @@ static void VCALLCONV hook_SetDefaultFOV(void *this, int fov) {
}
static bool find_SetDefaultFOV(struct con_cmd *fov) {
- uchar *fovcb = (uchar *)fov->cb;
+ const uchar *insns = (const uchar *)fov->cb;
int callcnt = 0;
- for (uchar *p = fovcb; p - fovcb < 96;) {
+ for (const uchar *p = insns; p - insns < 96;) {
// fov command source, and consequent asm, calls 4 functions, one of
// them virtual (i.e. via register). of the 3 direct calls,
// SetDefaultFOV is the third.