git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2453196)
Add type cast to foreach_internal's loop variable.
2024年10月15日 21:20:49 +0000 (16:20 -0500)
2024年10月15日 21:20:49 +0000 (16:20 -0500)
C++ requires explicitly casting void pointers to the appropriate
pointer type, which means the foreach_ptr macro cannot be used in
C++ code without this change.

Author: Jelte Fennema-Nio
Reviewed-by: Bruce Momjian
Discussion: https://postgr.es/m/CAGECzQSYG3QfHrc-rOk2KbnB9iJOd7Qu-Xii1s-GTA%3D3JFt49Q%40mail.gmail.com
Backpatch-through: 17


diff --git a/src/include/nodes/pg_list.h b/src/include/nodes/pg_list.h
index 52df93759f7a20b9493a3e8594f9f46c068f4aac..d131350e107468d8475fe35fcb95b9ae6b2ae765 100644 (file)
--- a/src/include/nodes/pg_list.h
+++ b/src/include/nodes/pg_list.h
@@ -485,7 +485,7 @@ for_each_cell_setup(const List *lst, const ListCell *initcell)
for (ForEachState var##__state = {(lst), 0}; \
(var##__state.l != NIL && \
var##__state.i < var##__state.l->length && \
- (var = func(&var##__state.l->elements[var##__state.i]), true)); \
+ (var = (type pointer) func(&var##__state.l->elements[var##__state.i]), true)); \
var##__state.i++)
/*
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /