aboutsummaryrefslogtreecommitdiff
path: root/builtins/pointer.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-08 17:17:15 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-08 17:17:15 -0400
commitaeed1992e94c5ab6a5104a06a921101fbe8f40ed (patch)
tree8ba6dc531acefa0eedd330224f16f750496e8dbe /builtins/pointer.c
parentcf9d5b1619b9e5e886d2754f167046ff77d36abf (diff)
Fix nearly every GCC warning and add __attribute__((pure/const)) where
appropriate
Diffstat (limited to 'builtins/pointer.c')
-rw-r--r--builtins/pointer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtins/pointer.c b/builtins/pointer.c
index 66cd308a..0d89e8a6 100644
--- a/builtins/pointer.c
+++ b/builtins/pointer.c
@@ -79,13 +79,13 @@ public Text_t Pointer$as_text(const void *x, bool colorize, const TypeInfo *type
return text;
}
-public int32_t Pointer$compare(const void *x, const void *y, const TypeInfo *type) {
+PUREFUNC public int32_t Pointer$compare(const void *x, const void *y, const TypeInfo *type) {
(void)type;
const void *xp = *(const void**)x, *yp = *(const void**)y;
return (xp > yp) - (xp < yp);
}
-public bool Pointer$equal(const void *x, const void *y, const TypeInfo *type) {
+PUREFUNC public bool Pointer$equal(const void *x, const void *y, const TypeInfo *type) {
(void)type;
const void *xp = *(const void**)x, *yp = *(const void**)y;
return xp == yp;