diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-08 17:17:15 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-08 17:17:15 -0400 |
| commit | aeed1992e94c5ab6a5104a06a921101fbe8f40ed (patch) | |
| tree | 8ba6dc531acefa0eedd330224f16f750496e8dbe /builtins/c_string.c | |
| parent | cf9d5b1619b9e5e886d2754f167046ff77d36abf (diff) | |
Fix nearly every GCC warning and add __attribute__((pure/const)) where
appropriate
Diffstat (limited to 'builtins/c_string.c')
| -rw-r--r-- | builtins/c_string.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtins/c_string.c b/builtins/c_string.c index d916bfa9..3e3ef740 100644 --- a/builtins/c_string.c +++ b/builtins/c_string.c @@ -21,7 +21,7 @@ public Text_t CString$as_text(const void *c_string, bool colorize, const TypeInf return Text$concat(colorize ? Text("\x1b[34mCString\x1b[m(") : Text("CString("), Text$quoted(text, colorize), Text(")")); } -public int32_t CString$compare(const char **x, const char **y) +PUREFUNC public int32_t CString$compare(const char **x, const char **y) { if (x == y) return 0; @@ -32,12 +32,12 @@ public int32_t CString$compare(const char **x, const char **y) return strcmp(*x, *y); } -public bool CString$equal(const char **x, const char **y) +PUREFUNC public bool CString$equal(const char **x, const char **y) { return CString$compare(x, y) == 0; } -public uint64_t CString$hash(const char **c_str) +PUREFUNC public uint64_t CString$hash(const char **c_str) { if (!*c_str) return 0; return siphash24((void*)*c_str, strlen(*c_str)); |
