From patchwork Mon Mar 4 13:45:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Konstantin Kostiuk X-Patchwork-Id: 777754 Delivered-To: patch@linaro.org Received: by 2002:a5d:4b84:0:b0:33d:f458:43ce with SMTP id b4csp521576wrt; Mon, 4 Mar 2024 05:46:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWeEHaBZzS1uw98265WCPqvgl2viaXT7S5Tv6eINpGnHW67vmsrUcq4CiD6WA050xb7gF3D4dGOy+YcUB9lVIwq X-Google-Smtp-Source: AGHT+IHc65TX7e1XmUDyO+cCDJv35NLtxtbDldzJAKq1vg3o3G6IJQimrl3LEJul/AJ5aAxYOINF X-Received: by 2002:ae9:c20a:0:b0:787:ec28:9c12 with SMTP id j10-20020ae9c20a000000b00787ec289c12mr9996059qkg.56.1709560002818; Mon, 04 Mar 2024 05:46:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709560002; cv=none; d=google.com; s=arc-20160816; b=wha7UaAVbe/odfZTTj5kYsC/zK6zOo16z1kw6LSBAdiiZ84FVaGCBrnP8VNWWiSYGw ldVBPyx7FDdDGT7J2kgW8kCfJvXmtl5zDM6waKF64SoksGpKoZlL9yx0I/wqgGUQzElP KX4CG36RRUQma09GCT4IF3DytkxQdgq59M9IKGjZDnAT3SwFvlFAG0m9ls7XOhB3+Afy QJI6ZaojW0DImVtSBF9ks3XJQtH4JJRwaKdBa5IRPGKoBadkzM/2JQfvwf7HiaJHwgXu BOu0UTkT051TELGnpI8Yg4kg7FmkXQOVd7OzPU8e2cwrp19yVV9h/pXFH9IRPNPyXaQK jwig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZSwkEkSW6CtLjOsJilX8J3bkrv/9gWdnkPWWOnvuipw=; fh=HMmCulo2CQAUhcaUPQyxE7Qn8ZYkXN50aXqcPkPUXdo=; b=gZZZmsErQCCQaEzL3110MWZrEFgtod6TbIsM3IKIIaC215Pnd2p75JDpI0bkdqpXGF NcbvcJL05lNpOCVtcPG3MQdW/MtS5SZgRU7wRtWDZyiW4o/+kveQRgr2O3fhz2YFFD4P gzSbnlxgMori1y9U/C6OnaMxwl2wjAKaIri0TzF6N+NR6g5UEFxkofIYFNjTlvxCQV4I FsHEVHIZbBMkOF+oSz7ThDKpZA3mrQfxPENrIY1vII+zHqvJoxCW0v9qg4rW5KkgUtZI qCNzZViJtMPjgEVNugUinAY8uqf8005M4haw+0/AUf1CLNMXGRyFn7UUH578zY4jU5Ze SlCw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="V/Ng13tp"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bq7-20020a05620a468700b007882b1c018fsi1700471qkb.46.2024.03.04.05.46.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Mar 2024 05:46:42 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="V/Ng13tp"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rh8df-0000Zv-AW; Mon, 04 Mar 2024 08:45:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rh8dU-0000ZQ-Ux for qemu-devel@nongnu.org; Mon, 04 Mar 2024 08:45:45 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rh8dQ-0000ue-9A for qemu-devel@nongnu.org; Mon, 04 Mar 2024 08:45:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709559939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZSwkEkSW6CtLjOsJilX8J3bkrv/9gWdnkPWWOnvuipw=; b=V/Ng13tpGtR5/TYY08yb/yDAptT1Si8IGHBbpPWYdtFEj+PxF5ajn8nZJw1tzE8PJK5wWv HmhbiMv9Vk/NuEh8SE3FvHGfBBDCyNarQZyNzfDwveCn+/71LHMG1HXccQd2KmgMTS3QA0 pBI/wpB8340E3XJIJSYvJbHL1ZAy9ps= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-678-F5Le5QRLO3WHRtP-MBGbeQ-1; Mon, 04 Mar 2024 08:45:36 -0500 X-MC-Unique: F5Le5QRLO3WHRtP-MBGbeQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 05BD83C0F232; Mon, 4 Mar 2024 13:45:36 +0000 (UTC) Received: from srv1.redhat.com (unknown [10.45.226.165]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F193624D; Mon, 4 Mar 2024 13:45:34 +0000 (UTC) From: Konstantin Kostiuk To: qemu-devel@nongnu.org Cc: Dehan Meng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Roth , Yan Vugenfirer Subject: [PATCH v4 1/3] qga/commands-win32: Declare const qualifier before type Date: Mon, 4 Mar 2024 15:45:30 +0200 Message-ID: <20240304134532.28506-2-kkostiuk@redhat.com> In-Reply-To: <20240304134532.28506-1-kkostiuk@redhat.com> References: <20240304134532.28506-1-kkostiuk@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 Received-SPF: pass client-ip=170.10.133.124; envelope-from=kkostiuk@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.571, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 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é Message-ID: <20240222152835.72095-2-philmd@linaro.org> Reviewed-by: Konstantin Kostiuk Signed-off-by: Konstantin Kostiuk Reviewed-by: Yan Vugenfirer --- qga/commands-win32.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) -- 2.44.0 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) {