fix required cast if compiled with C++

Sat, 16 Apr 2022 17:28:36 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 16 Apr 2022 17:28:36 +0200
changeset 516
7bcea73303ce
parent 515
6d3909bf1609
child 517
b3baaf9b7e3c

fix required cast if compiled with C++

src/cx/iterator.h file | annotate | diff | comparison | revisions
--- a/src/cx/iterator.h	Sat Apr 16 14:47:27 2022 +0200
+++ b/src/cx/iterator.h	Sat Apr 16 17:28:36 2022 +0200
@@ -138,6 +138,6 @@
  * @param iter the iterator
  */
 #define cx_foreach(type, elem, iter) \
-for (type elem; cxIteratorValid(&iter) && (elem = cxIteratorCurrent(&iter)) != NULL ; cxIteratorNext(&iter)) // NOLINT(bugprone-macro-parentheses)
+for (type elem; cxIteratorValid(&iter) && (elem = (type)cxIteratorCurrent(&iter)) != NULL ; cxIteratorNext(&iter)) // NOLINT(bugprone-macro-parentheses)
 
 #endif /* UCX_ITERATOR_H */

mercurial