Browse Source

Add const for dynstring-strlen

windows-imgui
Macoy Madson 9 months ago
parent
commit
e15913f4b9
  1. 3
      src/DynamicArray.cake

3
src/DynamicArray.cake

@ -87,6 +87,7 @@
;; Use mainly for signaling you expect to be able to resize etc. the array
(def-type-alias-global dynstring (* char))
(def-type-alias-global dynstring-const (* (const char)))
;; Returns the length of the string, not including the null terminator
(defun dynstring-printf (str (* dynstring) format (* (const char))
@ -134,7 +135,7 @@
(return (dynstring-strlen (deref str))))
;; dynarray-length includes the null terminator. This function removes it
(defun dynstring-strlen (str dynstring &return size_t)
(defun dynstring-strlen (str dynstring-const &return size_t)
(var length size_t (dynarray-length str))
(return (? (> length 0)
(- length 1)

Loading…
Cancel
Save