qga/commands-win32: Do not set matrix_lookup_t/win_10_0_t arrays size
commit734e7b73dfcbb52ef093663cc31b7d5b9689aa86
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 4 Mar 2024 13:45:31 +0000 (4 15:45 +0200)
committerKonstantin Kostiuk <kkostiuk@redhat.com>
Mon, 11 Mar 2024 16:24:39 +0000 (11 18:24 +0200)
treefde512466ebda9da83ad85465b1ccc262f41c7f0
parent68bc26717ebf7b7b02f0a0984c78741aede623e1
qga/commands-win32: Do not set matrix_lookup_t/win_10_0_t arrays size

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>
qga/commands-win32.c