On 22/2/24 16:28, Philippe Mathieu-Daudé wrote:
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.

Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
  qga/commands-win32.c | 19 +++++++++----------
  1 file changed, 9 insertions(+), 10 deletions(-)


  typedef struct _ga_win_10_0_t {
      int first_build;
-    const char *version;
-    const char *version_id;
+    char const *version;
+    char const *version_id;

Oops, missed rebase.

  } ga_win_10_0_t;

Reply via email to