From patchwork Thu Sep 12 07:38:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 827819 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1143772wrc; Thu, 12 Sep 2024 00:47:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVgPvc9D1jOXGdQpme5LD/68ZdDfSfHlwmzpUuWOQev78LqMYjYsxCvVKa7bwPBBB37jeTarQ==@linaro.org X-Google-Smtp-Source: AGHT+IFvxm07bTuunU51pcLrUbJgBC/P2q1X0rIhlATa+B1KdCEUXEBPlpJt1gsStmbG+ywKabyE X-Received: by 2002:a05:690c:4c13:b0:6c1:2ea1:c24d with SMTP id 00721157ae682-6dbb6b4e371mr25590877b3.26.1726127275402; Thu, 12 Sep 2024 00:47:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726127275; cv=none; d=google.com; s=arc-20240605; b=DwwtVyass0cvS/td8cLWSclpccFmz7ALp0ezMIZBx1k5Ay3evK1koro5/7FOkwzP8k VUc70W7II5fXjgG/lzCASQnxl62G++yYMfiQK3VEtHsX214ShDb92lOLLDqp4YJ7fHOz GN/5Vf3OevdWIRjekZndybIUENAC6KVTyfbP+HXDeRNTe1Ol2X5zWz6Plju9OwlHC4kA HiQMscBRnC44Q2v90tKeKDj5qWKITRzYu8w+8xn3QdtygUZs+NYpo8jAF4e61fzoH5Tr OAXopcY7bkMISLyGV6f0FgYcK94/XGrztgWT/3APSP1Zfldb9BoJW2O2f4hphDHgzcJw mzaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=CoLCWKN35Kx1zze7qPnMX6nUM44hrew4lUqaYQU21Hw=; fh=9lXHm2cv0EOsvaESlQxkp+iopfNbpS2ZXLeBYSea/ko=; b=kFQ9NE8fjxBi+07jczqzeUN+Tpa/epVUVDSv9Se/AwcrFBzQ2FRAnJpnBU+D8YFmGg qPQJob2jwqS6WdUO7JTdSinPcjsjUXTiHO8S8/pnoujmDbePjHfgHiOOXlLco+Tb5vKo 0RsV+5ivRW01BCq2/YffGZOAfzRnV4I7ksD1Sj1LyUfEDHbMrB2UuiCU94uxwD6098Zh 3+mEoxJ8CwhWCwPSuWk0VNxiZYa/v3JGG7AAFJ5/f2gkiyc5V3g1YWb3I/3KMP6ohEgq kBiGbpN+vWlPFnJsr5dEcGoQMwFWjqv7lKbXW0tRS4XPs4nWzlU4k8RLwh3tt5+7If3r lcFQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pAsBEq4b; 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=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a9a79f0fbdsi1214439885a.200.2024.09.12.00.47.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Sep 2024 00:47:55 -0700 (PDT) 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=@linaro.org header.s=google header.b=pAsBEq4b; 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=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1soeRP-0004IK-Sh; Thu, 12 Sep 2024 03:40:36 -0400 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 1soeQl-0002Bn-3v for qemu-devel@nongnu.org; Thu, 12 Sep 2024 03:39:55 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1soeQh-0000Fl-6D for qemu-devel@nongnu.org; Thu, 12 Sep 2024 03:39:54 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-718da0821cbso489800b3a.0 for ; Thu, 12 Sep 2024 00:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726126790; x=1726731590; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CoLCWKN35Kx1zze7qPnMX6nUM44hrew4lUqaYQU21Hw=; b=pAsBEq4b8UHlcqgDE/aGlIQG53EMLWVVt5patEuCYe9hSeNcKbdDaHl0zoGrVheIw4 +3lCMI0tiyCKHQJhJm49Jqj+unO7IIX5iyp0gQLC4XdiUcT3WNDb0kbRe5FseMZr1M+/ R7m+vCBy0lCv2zVeHMQufOX+ie5ZUIoR6lHHo9uDI9QXyu4Cq6n1PCn9RYuMm1nLd0VB LaImzSF209IMJzDZcVuStF4v7BK75WjmDhjZi9ogkR4KWKVXTWHJUbwS5M6OXFS/SZ+6 C7IwfjHYU2xLdPHRmHdkJhd3xJOT7yYK2/tpnZvsaw10brLRXfU/1N7Xzvb5W2Ke5reA 54tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726126790; x=1726731590; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CoLCWKN35Kx1zze7qPnMX6nUM44hrew4lUqaYQU21Hw=; b=JSALdqR5Wet1uv0RgEMrMJp+thaAZ6GHv3fgAf+VroxJbJ90yFfemPi3SOMbMoTv2C c4hQLv8AbNmkA4m04AlC8BZ1pATi5VWPDs1tcK0ReE8rWqFhNbFHesu4lU/IbchU8+xk GCk2IZpbZppzJ3XsrdG1tm0cjQcdFAkAXnDqOFgJt8KamJenBXQq6gjoF4Sz4U+knCY3 Vmb95k54/RlOWuwO1EeVYrrrFNfb7E3HH2CLIANZXc1gONY7WRPoMcz1s/9l0Vk6zWzf 7RJLDln5eJSAl/TeY4/kw8gA4gfGI8YFbkrE81AW+xdD5SLQ+/DMFC17PiPXJuvAbzl9 WC5Q== X-Gm-Message-State: AOJu0YyXrtx0fzNXUZxvxyUD0Cc6QJRNF3ZPszeEAkIH030mDc8NtQM3 vZC+78LgzV4h0Oo8RAygt8I/iOfyZW9cIypohO9rNubVklNQZ3Oed9Iez/VxTexRya9pTiDQLXX G9Oo/gje9 X-Received: by 2002:aa7:8895:0:b0:718:da06:a4bf with SMTP id d2e1a72fcca58-71926067e21mr2772666b3a.2.1726126789771; Thu, 12 Sep 2024 00:39:49 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00::9633]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7db1fb9ad87sm983458a12.6.2024.09.12.00.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2024 00:39:49 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Jason Wang , =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier , Marcelo Tosatti , Nicholas Piggin , Klaus Jensen , WANG Xuerui , Halil Pasic , Rob Herring , Michael Rolnik , Zhao Liu , Peter Maydell , Richard Henderson , Fabiano Rosas , Corey Minyard , Keith Busch , Thomas Huth , "Maciej S. Szmigiero" , Harsh Prateek Bora , Kevin Wolf , Paolo Bonzini , Jesper Devantier , Hyman Huang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Palmer Dabbelt , qemu-s390x@nongnu.org, Laurent Vivier , qemu-riscv@nongnu.org, "Richard W.M. Jones" , Liu Zhiwei , Aurelien Jarno , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , kvm@vger.kernel.org, Christian Borntraeger , Akihiko Odaki , Daniel Henrique Barboza , Hanna Reitz , Ani Sinha , qemu-ppc@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Alistair Francis , Bin Meng , "Michael S. Tsirkin" , Helge Deller , Peter Xu , Daniel Henrique Barboza , Dmitry Fleytman , Nina Schoetterl-Glausch , Yanan Wang , qemu-arm@nongnu.org, Igor Mammedov , Jean-Christophe Dubois , Eric Farman , Sriram Yagnaraman , qemu-block@nongnu.org, Stefan Berger , Joel Stanley , Eduardo Habkost , David Gibson , Fam Zheng , Weiwei Li , Markus Armbruster , Pierrick Bouvier Subject: [PATCH v2 09/48] qobject: replace assert(0) with g_assert_not_reached() Date: Thu, 12 Sep 2024 00:38:42 -0700 Message-Id: <20240912073921.453203-10-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240912073921.453203-1-pierrick.bouvier@linaro.org> References: <20240912073921.453203-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 This patch is part of a series that moves towards a consistent use of g_assert_not_reached() rather than an ad hoc mix of different assertion mechanisms. Reviewed-by: Richard Henderson Reviewed-by: Kevin Wolf Signed-off-by: Pierrick Bouvier --- qobject/qlit.c | 2 +- qobject/qnum.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/qobject/qlit.c b/qobject/qlit.c index be8332136c2..a62865b6423 100644 --- a/qobject/qlit.c +++ b/qobject/qlit.c @@ -118,7 +118,7 @@ QObject *qobject_from_qlit(const QLitObject *qlit) case QTYPE_QBOOL: return QOBJECT(qbool_from_bool(qlit->value.qbool)); default: - assert(0); + g_assert_not_reached(); } return NULL; diff --git a/qobject/qnum.c b/qobject/qnum.c index 2bbeaedc7b4..2138b563a9f 100644 --- a/qobject/qnum.c +++ b/qobject/qnum.c @@ -85,7 +85,7 @@ bool qnum_get_try_int(const QNum *qn, int64_t *val) return false; } - assert(0); + g_assert_not_reached(); return false; } @@ -123,7 +123,7 @@ bool qnum_get_try_uint(const QNum *qn, uint64_t *val) return false; } - assert(0); + g_assert_not_reached(); return false; } @@ -156,7 +156,7 @@ double qnum_get_double(QNum *qn) return qn->u.dbl; } - assert(0); + g_assert_not_reached(); return 0.0; } @@ -172,7 +172,7 @@ char *qnum_to_string(QNum *qn) return g_strdup_printf("%.17g", qn->u.dbl); } - assert(0); + g_assert_not_reached(); return NULL; }