From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EC05E43037; Fri, 11 Aug 2023 21:22:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 60ADF4329B; Fri, 11 Aug 2023 21:21:17 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id E75264325A for ; Fri, 11 Aug 2023 21:21:01 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id DA93620FD0F9; Fri, 11 Aug 2023 12:21:00 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com DA93620FD0F9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1691781660; bh=Qt4M7foTuZNdNfBGNlV8vL2SK6gVrZbPMI4un3fZkD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l4yvNGjzWmksfelZtWVTKQS1cCKzEh5/hklUbkShpdn/S8Qmoyr2KKcciWts/YTq5 WtznhR7A94sZrIxJCv9x6/KpBLN1H2tlyYxOzO+45HpV4/GPExahyGWLkJbIaGVYZl 0HdZuqCS0xd9aRNRMicTyfn1cvuH7A661pN4KuCY= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , Konstantin Ananyev , Ciara Power , thomas@monjalon.net, david.marchand@redhat.com, mb@smartsharesystems.com, Tyler Retzlaff Subject: [PATCH v11 14/16] log: use standard ternary operator instead of GCC extension Date: Fri, 11 Aug 2023 12:20:56 -0700 Message-Id: <1691781658-32520-15-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1691781658-32520-1-git-send-email-roretzla@linux.microsoft.com> References: <1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com> <1691781658-32520-1-git-send-email-roretzla@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Use standard ternary operator instead of gcc extension. There is no concern of side-effects for this evaluation so allow the code to be portable. While here update the condition to compare default_log_stream directly against NULL. Signed-off-by: Tyler Retzlaff --- lib/log/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/log/log.c b/lib/log/log.c index 52c771f..b80725a 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -93,7 +93,7 @@ struct log_cur_msg { * of stderr, even if the application closes and * reopens it. */ - return default_log_stream ? : stderr; + return default_log_stream != NULL ? default_log_stream : stderr; } return f; } -- 1.8.3.1