Skip to content

Commit 5584776

Browse files
committed
use curly braces for arrays in param printing
Too much Rust lately...
1 parent 8b6843d commit 5584776

File tree

8 files changed

+118
-118
lines changed

8 files changed

+118
-118
lines changed

scripts/templates/params.hpp.mako

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ from templates import helper as th
5757
%endif
5858
## can't iterate over 'void *'...
5959
%if th.param_traits.is_range(item) and "void*" not in itype:
60-
os << ".${iname} = [";
60+
os << ".${iname} = {";
6161
for (size_t i = ${th.param_traits.range_start(item)}; ${deref}(params${access}${pname}) != NULL && i < ${deref}params${access}${prefix + th.param_traits.range_end(item)}; ++i) {
6262
if (i != 0) {
6363
os << ", ";
@@ -66,7 +66,7 @@ from templates import helper as th
6666
(${deref}(params${access}${pname}))[i]
6767
</%call>
6868
}
69-
os << "]";
69+
os << "}";
7070
%elif typename is not None:
7171
os << ".${iname} = ";
7272
${x}_params::serializeTagged(os, ${deref}(params${access}${pname}), ${deref}(params${access}${prefix}${typename}), ${deref}(params${access}${prefix}${typename_size}));
@@ -162,7 +162,7 @@ template <typename T> inline void serializeTagged(std::ostream &os, const void *
162162
%if "char" in atype: ## print char* arrays as simple NULL-terminated strings
163163
serializePtr(os, tptr);
164164
%else:
165-
os << "[";
165+
os << "{";
166166
size_t nelems = size / sizeof(${atype});
167167
for (size_t i = 0; i < nelems; ++i) {
168168
if (i != 0) {
@@ -172,7 +172,7 @@ template <typename T> inline void serializeTagged(std::ostream &os, const void *
172172
tptr[i]
173173
</%call>
174174
}
175-
os << "]";
175+
os << "}";
176176
%endif
177177
%else:
178178
const ${vtype} *tptr = (const ${vtype} *)ptr;

0 commit comments

Comments
 (0)