summaryrefslogtreecommitdiffhomepage
path: root/src/portalcolours.c
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2024-08-03 23:40:31 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2024-08-23 20:37:37 +0100
commit83da606072ce272eb053d4e1497d77e647cfecae (patch)
tree71d0110881ff8685184c5f4ab720cc8d49c24678 /src/portalcolours.c
parentacbd30e0427b16f885f96aed59881ec04eff25bc (diff)
Revise syntax macros and add a ton of branch hints
My new programming style is branch hints. All non-confusing branches must be hinted when I can be bothered. It's faster, sometimes, maybe. Also, start trying to use more signed sizes in at least some of the places where it makes sense. Unsigned sizes are surprisingly error-prone!
Diffstat (limited to 'src/portalcolours.c')
-rw-r--r--src/portalcolours.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/portalcolours.c b/src/portalcolours.c
index 3167c0b..61d9cc7 100644
--- a/src/portalcolours.c
+++ b/src/portalcolours.c
@@ -24,6 +24,7 @@
#include "hexcolour.h"
#include "hook.h"
#include "intdefs.h"
+#include "langext.h"
#include "mem.h"
#include "os.h"
#include "ppmagic.h"
@@ -102,13 +103,13 @@ PREINIT {
INIT {
#ifdef _WIN32
- if (!find_UTIL_Portal_Color(clientlib)) {
+ if_cold (!find_UTIL_Portal_Color(clientlib)) {
errmsg_errorx("couldn't find UTIL_Portal_Color");
return false;
}
orig_UTIL_Portal_Color = (UTIL_Portal_Color_func)hook_inline(
(void *)orig_UTIL_Portal_Color, (void *)&hook_UTIL_Portal_Color);
- if (!orig_UTIL_Portal_Color) {
+ if_cold (!orig_UTIL_Portal_Color) {
errmsg_errorsys("couldn't hook UTIL_Portal_Color");
return false;
}
@@ -126,7 +127,7 @@ INIT {
}
END {
- if (!sst_userunloaded) return;
+ if_hot (!sst_userunloaded) return;
unhook_inline((void *)orig_UTIL_Portal_Color);
}