Yes, I used to think "const VMStateDescription *[]" was right, but when I search similar expressions, most of all are "xxx * []". Such as: fsdev/qemu-fsdev.c:54: .opts = (const char * []) hw/intc/s390_flic_kvm.c:567: .subsections = (const VMStateDescription * []) ...
So, I keep the same style. Should I change it to "const VMStateDescription *[]"? On 2020/10/19 16:24, Markus Armbruster wrote: > "Dr. David Alan Gilbert" <dgilb...@redhat.com> writes: > >> * Bihong Yu (yubih...@huawei.com) wrote: >>> Signed-off-by: Bihong Yu <yubih...@huawei.com> >>> Reviewed-by: Chuan Zheng <zhengch...@huawei.com> >> >> Yes that's OK, I'm a bit sturprised we need the space afte rthe * in the >> VMStateDescription case, I wouldn't necessarily go and change them all. > > We don't: it's not the binary multiplication operator *, where we want a > space on both sides, it's a pointer declarator, where we want a space on > the left only. > > Example: > > int *pa, *pb, *pc; > *pa = *pb * *pc; > > Note the space on both side of binary operator * (multiplication), but > only on the left side of the pointer declarator's * and the unary > operator * (indirection). > >> Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> > [...] >>> diff --git a/migration/savevm.c b/migration/savevm.c >>> index d2e141f..9e95df1 100644 >>> --- a/migration/savevm.c >>> +++ b/migration/savevm.c >>> @@ -521,7 +521,7 @@ static const VMStateDescription vmstate_configuration = >>> { >>> VMSTATE_VBUFFER_ALLOC_UINT32(name, SaveState, 0, NULL, len), >>> VMSTATE_END_OF_LIST() >>> }, >>> - .subsections = (const VMStateDescription*[]) { >>> + .subsections = (const VMStateDescription * []) { >>> &vmstate_target_page_bits, >>> &vmstate_capabilites, >>> &vmstate_uuid, > > Should be > > .subsections = (const VMStateDescription *[]) { > > [...] > > . >