* gh-125207: Use {0} array initializers
* Simplify, as suggested in PR
* Revert change to explicitly specify length
// Loop once to find the total compiled size:
size_t code_size = 0;
size_t data_size = 0;
- jit_state state = {};
+ jit_state state = {0};
group = &trampoline;
code_size += group->code_size;
data_size += group->data_size;
word = bitmask & ((1 << 32) - 1)
trampoline_mask.append(f"{word:#04x}")
bitmask >>= 32
- return "{" + ", ".join(trampoline_mask) + "}"
+ return "{" + (", ".join(trampoline_mask) or "0") + "}"
def as_c(self, opname: str) -> str:
"""Dump this hole as a StencilGroup initializer."""
yield "};"
yield ""
yield f"static const void * const symbols_map[{max(len(symbols), 1)}] = {{"
- for symbol, ordinal in symbols.items():
- yield f" [{ordinal}] = &{symbol},"
+ if symbols:
+ for symbol, ordinal in symbols.items():
+ yield f" [{ordinal}] = &{symbol},"
+ else:
+ yield " 0"
yield "};"