From: Yan Vugenfirer <yvugenfi@redhat.com>
To: Konstantin Kostiuk <kkostiuk@redhat.com>
Cc: qemu-devel@nongnu.org, "Dehan Meng" <demeng@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Michael Roth" <michael.roth@amd.com>
Subject: Re: [PATCH v4 1/3] qga/commands-win32: Declare const qualifier before type
Date: Tue, 5 Mar 2024 09:49:51 +0200 [thread overview]
Message-ID: <CAGoVJZyurMK+U2thF9tJntgg1v0FGsFcZHXb7-S-qqNe0Ny22A@mail.gmail.com> (raw)
In-Reply-To: <20240304134532.28506-2-kkostiuk@redhat.com>
On Mon, Mar 4, 2024 at 3:45 PM Konstantin Kostiuk <kkostiuk@redhat.com> wrote:
>
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
>
> Most of the code base use the 'const' qualifier *before*
> the type being qualified. Use the same style to unify.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Message-ID: <20240222152835.72095-2-philmd@linaro.org>
> Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
> Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
>
> ---
> qga/commands-win32.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/qga/commands-win32.c b/qga/commands-win32.c
> index a1015757d8..79b5a580c9 100644
> --- a/qga/commands-win32.c
> +++ b/qga/commands-win32.c
> @@ -2120,11 +2120,11 @@ GuestUserList *qmp_guest_get_users(Error **errp)
> typedef struct _ga_matrix_lookup_t {
> int major;
> int minor;
> - char const *version;
> - char const *version_id;
> + const char *version;
> + const char *version_id;
> } ga_matrix_lookup_t;
>
> -static ga_matrix_lookup_t const WIN_VERSION_MATRIX[2][7] = {
> +static const ga_matrix_lookup_t WIN_VERSION_MATRIX[2][7] = {
> {
> /* Desktop editions */
> { 5, 0, "Microsoft Windows 2000", "2000"},
> @@ -2148,18 +2148,18 @@ static ga_matrix_lookup_t const WIN_VERSION_MATRIX[2][7] = {
>
> typedef struct _ga_win_10_0_t {
> int first_build;
> - char const *version;
> - char const *version_id;
> + const char *version;
> + const char *version_id;
> } ga_win_10_0_t;
>
> -static ga_win_10_0_t const WIN_10_0_SERVER_VERSION_MATRIX[4] = {
> +static const ga_win_10_0_t WIN_10_0_SERVER_VERSION_MATRIX[4] = {
> {14393, "Microsoft Windows Server 2016", "2016"},
> {17763, "Microsoft Windows Server 2019", "2019"},
> {20344, "Microsoft Windows Server 2022", "2022"},
> {0, 0}
> };
>
> -static ga_win_10_0_t const WIN_10_0_CLIENT_VERSION_MATRIX[3] = {
> +static const ga_win_10_0_t WIN_10_0_CLIENT_VERSION_MATRIX[3] = {
> {10240, "Microsoft Windows 10", "10"},
> {22000, "Microsoft Windows 11", "11"},
> {0, 0}
> @@ -2185,16 +2185,16 @@ static void ga_get_win_version(RTL_OSVERSIONINFOEXW *info, Error **errp)
> return;
> }
>
> -static char *ga_get_win_name(OSVERSIONINFOEXW const *os_version, bool id)
> +static char *ga_get_win_name(const OSVERSIONINFOEXW *os_version, bool id)
> {
> DWORD major = os_version->dwMajorVersion;
> DWORD minor = os_version->dwMinorVersion;
> DWORD build = os_version->dwBuildNumber;
> int tbl_idx = (os_version->wProductType != VER_NT_WORKSTATION);
> - ga_matrix_lookup_t const *table = WIN_VERSION_MATRIX[tbl_idx];
> - ga_win_10_0_t const *win_10_0_table = tbl_idx ?
> + const ga_matrix_lookup_t *table = WIN_VERSION_MATRIX[tbl_idx];
> + const ga_win_10_0_t *win_10_0_table = tbl_idx ?
> WIN_10_0_SERVER_VERSION_MATRIX : WIN_10_0_CLIENT_VERSION_MATRIX;
> - ga_win_10_0_t const *win_10_0_version = NULL;
> + const ga_win_10_0_t *win_10_0_version = NULL;
> while (table->version != NULL) {
> if (major == 10 && minor == 0) {
> while (win_10_0_table->version != NULL) {
> --
> 2.44.0
>
Reviewed-by: Yan Vugenfirer <yvugenfi@redhat.com>
next prev parent reply other threads:[~2024-03-05 7:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-04 13:45 [PATCH v4 0/3] qga/commands-win32: Style cleanups before adding Windows Server 2025 Konstantin Kostiuk
2024-03-04 13:45 ` [PATCH v4 1/3] qga/commands-win32: Declare const qualifier before type Konstantin Kostiuk
2024-03-05 7:49 ` Yan Vugenfirer [this message]
2024-03-04 13:45 ` [PATCH v4 2/3] qga/commands-win32: Do not set matrix_lookup_t/win_10_0_t arrays size Konstantin Kostiuk
2024-03-05 7:50 ` Yan Vugenfirer
2024-03-04 13:45 ` [PATCH v4 3/3] qga-win: Add support of Windows Server 2025 in get-osinfo command Konstantin Kostiuk
2024-03-05 7:50 ` Yan Vugenfirer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGoVJZyurMK+U2thF9tJntgg1v0FGsFcZHXb7-S-qqNe0Ny22A@mail.gmail.com \
--to=yvugenfi@redhat.com \
--cc=demeng@redhat.com \
--cc=kkostiuk@redhat.com \
--cc=michael.roth@amd.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).