fix const-ness of non-mutating iterator creation for maps

Sun, 21 May 2023 16:22:09 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 21 May 2023 16:22:09 +0200
changeset 710
2dd409ed056f
parent 709
1e8ba59e7911
child 711
71b2f3f63182

fix const-ness of non-mutating iterator creation for maps

src/cx/map.h file | annotate | diff | comparison | revisions
--- a/src/cx/map.h	Sun May 21 15:07:31 2023 +0200
+++ b/src/cx/map.h	Sun May 21 16:22:09 2023 +0200
@@ -215,7 +215,7 @@
  * @return an iterator for the currently stored values
  */
 __attribute__((__nonnull__, __warn_unused_result__))
-static inline CxIterator cxMapIteratorValues(CxMap *map) {
+static inline CxIterator cxMapIteratorValues(CxMap const *map) {
     return map->cl->iterator(map, CX_MAP_ITERATOR_VALUES);
 }
 
@@ -231,7 +231,7 @@
  * @return an iterator for the currently stored keys
  */
 __attribute__((__nonnull__, __warn_unused_result__))
-static inline CxIterator cxMapIteratorKeys(CxMap *map) {
+static inline CxIterator cxMapIteratorKeys(CxMap const *map) {
     return map->cl->iterator(map, CX_MAP_ITERATOR_KEYS);
 }
 
@@ -249,7 +249,7 @@
  * @see cxMapIteratorValues()
  */
 __attribute__((__nonnull__, __warn_unused_result__))
-static inline CxIterator cxMapIterator(CxMap *map) {
+static inline CxIterator cxMapIterator(CxMap const *map) {
     return map->cl->iterator(map, CX_MAP_ITERATOR_PAIRS);
 }
 

mercurial