734e7b73df
ga_get_win_name() iterates over all elements in the arrays by checking the 'version' field is non-NULL. Since the arrays are guarded by a NULL terminating element, we don't need to specify their size: static char *ga_get_win_name(...) { ... const ga_matrix_lookup_t *table = WIN_VERSION_MATRIX[tbl_idx]; const ga_win_10_0_t *win_10_0_table = ... ... while (table->version != NULL) { ^^^^^^^^^^^^^^^ while (win_10_0_table->version != NULL) { ^^^^^^^^^^^^^^^ This will simplify maintenance when adding new entries to these arrays. Split WIN_VERSION_MATRIX into WIN_CLIENT_VERSION_MATRIX and WIN_SERVER_VERSION_MATRIX because multidimensional array must have bounds for all dimensions except the first. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20240222152835.72095-3-philmd@linaro.org> Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> Reviewed-by: Yan Vugenfirer <yvugenfi@redhat.com> Link: https://lore.kernel.org/r/20240304134532.28506-3-kkostiuk@redhat.com Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com> |
||
---|---|---|
.. | ||
installer | ||
vss-win32 | ||
channel-posix.c | ||
channel-win32.c | ||
channel.h | ||
commands-bsd.c | ||
commands-common.h | ||
commands-linux.c | ||
commands-posix-ssh.c | ||
commands-posix.c | ||
commands-win32.c | ||
commands.c | ||
cutils.c | ||
cutils.h | ||
guest-agent-command-state.c | ||
guest-agent-core.h | ||
main.c | ||
meson.build | ||
messages-win32.mc | ||
qapi-schema.json | ||
service-win32.c | ||
service-win32.h | ||
vss-win32.c | ||
vss-win32.h |