From cba9387c361c3d33dcf1b21ff0e5beb4b0a81ade Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 16 May 2023 22:12:57 +0100 Subject: 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 --- src/dbg.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/dbg.h') diff --git a/src/dbg.h b/src/dbg.h index e3625e0..8e07a22 100644 --- a/src/dbg.h +++ b/src/dbg.h @@ -1,5 +1,5 @@ /* - * Copyright © 2022 Michael Smith + * Copyright © 2023 Michael Smith * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -17,6 +17,8 @@ #ifndef INC_DBG_H #define INC_DBG_H +#include "intdefs.h" + /* * These functions can all be used for development and debugging but aren't * available to release builds; this header shouldn't even be #included in real @@ -24,14 +26,14 @@ */ /* Prints out a basic hexadecimal listing of a byte range. */ -void dbg_hexdump(char *name, const void *p, int len); +void dbg_hexdump(const char *name, const void *p, int len); /* Prints out a disassembly of some instructions in memory. */ -void dbg_asmdump(char *name, const void *p, int len); +void dbg_asmdump(const char *name, const void *p, int len); #ifdef _WIN32 // at least for now /* Returns a function's Ghidra address, assuming default project offsets. */ -void *dbg_toghidra(void *addr); +usize dbg_toghidra(const void *addr); #endif #endif -- cgit v1.2.3