From aeed1992e94c5ab6a5104a06a921101fbe8f40ed Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 8 Sep 2024 17:17:15 -0400 Subject: Fix nearly every GCC warning and add __attribute__((pure/const)) where appropriate --- builtins/pointer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'builtins/pointer.c') 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; -- cgit v1.2.3