From patchwork Mon Apr 27 14:22:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= X-Patchwork-Id: 11512343 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9E5FD1667 for ; Mon, 27 Apr 2020 14:22:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86743206BF for ; Mon, 27 Apr 2020 14:22:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ceJRjT7W" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728039AbgD0OWw (ORCPT ); Mon, 27 Apr 2020 10:22:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727073AbgD0OWw (ORCPT ); Mon, 27 Apr 2020 10:22:52 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 309EAC0610D5 for ; Mon, 27 Apr 2020 07:22:52 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id a31so5615985pje.1 for ; Mon, 27 Apr 2020 07:22:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eA+O4sddYdP5GMNRX+j0xbuvsli0tMVBLdUsgqzMRGI=; b=ceJRjT7WubZe8b4OKf6tdou40kDqGQ7soYyQNj2ZioTJZGQXpaseShzdjvy56oADNJ hwzhgZRVodZHUxsMNya7gvfFq91lto9aUIgPq+BSiyR/iUF2OKSbeTBsO/g2j4AIgA4Q 2gX9qsPjmlF2jeAFnnNsjMMz+f0bxzlewNiQw7OuBT+fG+Vg/wPge/NpPE1/XegiIev4 u4FVb2anmzAeyOPJ1b4/9aEoawORTu4znWotJBHjySlfmMqpcDL9oZzfGHveG99PpoBd 5ovtW41qAWCsz5dx8fsYLKKC80/g4xlcvkM7HCc6Hw/jKK2vhdksmxG8OvlptAX+JV8/ kUig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eA+O4sddYdP5GMNRX+j0xbuvsli0tMVBLdUsgqzMRGI=; b=LRCv/R73tpveEdjXcGkBRirEd3oQ9UE8prNyCNr1CFKzdeMd4A7Tj2HL0/B2z6AR3x BVFuLKf0il8natpoYlpAUeeQB18sMEyTHmPVh1rwp9NGJQIQflweINanLVTJ0p9ztSb1 xtyqXOEe5drhmHxzuY8WFNu+/1laJX6DnDrztSGPP87V18kcsvx9Ksz3xZJvQ52dMBFu 04EZVC+C8D2bnnVwXwtEvpyww8Y6hFhB8dnibMu5Y+CkJ+8vjtFn+Xqo0hV0oN/jJPCH c1BiuAX6Y26Mw33sSGrihN2Xf45w/lzeFg87/wDPQ6L86thojL5mFakEAyV2ltfYl7vk 1bew== X-Gm-Message-State: AGi0PuYmA4kQq7WZDH5D8/fNEdRaxPfXEKhBtQb4JqUF7WRsHHzNwNRc Oz8tZz8YoNKYaCJTVCUb8tmcYUWA X-Google-Smtp-Source: APiQypJNqAYb0L58qY+0cyJlH9sdbjdL9HVJlsVCsa2292muOt+zjBCgslcggkW9oyz779/UfkbEzg== X-Received: by 2002:a17:902:bd09:: with SMTP id p9mr11156288pls.214.1587997371524; Mon, 27 Apr 2020 07:22:51 -0700 (PDT) Received: from localhost.localdomain ([2402:800:6374:bf12:8518:c5e6:e4cc:3967]) by smtp.gmail.com with ESMTPSA id c1sm12589602pfc.94.2020.04.27.07.22.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Apr 2020 07:22:50 -0700 (PDT) From: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= To: git@vger.kernel.org Cc: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= , Ramsay Jones , Johannes Schindelin , Junio C Hamano , Jeff King Subject: [PATCH v3 1/4] test-parse-pathspec-file.c: s/0/NULL/ for pointer type Date: Mon, 27 Apr 2020 21:22:34 +0700 Message-Id: X-Mailer: git-send-email 2.26.2.526.g744177e7f7 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Signed-off-by: Đoàn Trần Công Danh --- Notes: struct foo val = { 0 }; should be taken as idiom for zero-ing structured data. I think this should be written to CodingGuideline. I'll prepare a patch for this addition t/helper/test-parse-pathspec-file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/helper/test-parse-pathspec-file.c b/t/helper/test-parse-pathspec-file.c index 02f4ccfd2a..b3e08cef4b 100644 --- a/t/helper/test-parse-pathspec-file.c +++ b/t/helper/test-parse-pathspec-file.c @@ -6,7 +6,7 @@ int cmd__parse_pathspec_file(int argc, const char **argv) { struct pathspec pathspec; - const char *pathspec_from_file = 0; + const char *pathspec_from_file = NULL; int pathspec_file_nul = 0, i; static const char *const usage[] = { @@ -20,9 +20,9 @@ int cmd__parse_pathspec_file(int argc, const char **argv) OPT_END() }; - parse_options(argc, argv, 0, options, usage, 0); + parse_options(argc, argv, NULL, options, usage, 0); - parse_pathspec_file(&pathspec, 0, 0, 0, pathspec_from_file, + parse_pathspec_file(&pathspec, 0, 0, NULL, pathspec_from_file, pathspec_file_nul); for (i = 0; i < pathspec.nr; i++) From patchwork Mon Apr 27 14:22:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= X-Patchwork-Id: 11512347 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D1D71392 for ; Mon, 27 Apr 2020 14:22:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6438C206CD for ; Mon, 27 Apr 2020 14:22:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="I8+LTqZ9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728047AbgD0OWz (ORCPT ); Mon, 27 Apr 2020 10:22:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727073AbgD0OWy (ORCPT ); Mon, 27 Apr 2020 10:22:54 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD14DC0610D5 for ; Mon, 27 Apr 2020 07:22:54 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id t40so7504182pjb.3 for ; Mon, 27 Apr 2020 07:22:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CtXBhjs4qdPp2GeR3HzOaMcDeUQRRg1PDZ3PhvkAYR8=; b=I8+LTqZ9r0/O42X2gPb4Dxy9jVeDnMcY8ecv3JBRPwIOZ7ZhyYgTx1SQIgcAeHDamN s1LWjbEl/1O0zWMKj27SNeCkQLkxGOwAjxro6dE3PPXwWdtwUm4JD73u6ulu0JkvMXdS 2VBQ4/B3Et2TI1gVB9V5R7G+o58dj0jcQhHka77nQ+y8CwuAWXxx3W1MwLuT+xQKE9nc 3TkqCZ1DCV59hEBjxp++Nd8PXnjK1HIYgCHBGEIIb3qRcGKVRMMK9DVkmOM27pX2BHSh YRKzIESQbYIp2iRZaAxgXhViDFbtiXiXWr5GVRo4aUw49Ye90vDVaD5vnf9H961kISJv IAzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CtXBhjs4qdPp2GeR3HzOaMcDeUQRRg1PDZ3PhvkAYR8=; b=c9zsxZIqxeCQwqyq8cAiZlXFkTMaDOYmmAPQD4nWzK/huxHHpNNfyEO8uPnmXmwe9j GY1Pq+wKqslH4teWEna9mJshcNP1ODBqR+Rj5rIoFdNn6H4MrArSo24CQ8o7rWPFR/av +WnXgjFOkX/mgW0Bd3ReH7Vjwllvy5sSgaBeyRqVtDgGIPL9QZWMho+kRsjy95Bj9EV1 fzc8NpA8xXVqwQeB+YvCL27r9OyiI7j7o9zhgvo/sDXskZFhUIUQ4nAYvr+tQLIL1igt hNF8rjeCthjAQ+oNLFA7oaI8AwcGWfCPhm3Nwy4goLJjpyVNV/vw30Bw0sg2PB8crVBk FxvQ== X-Gm-Message-State: AGi0Puai+i5bU98YN+ET8qVBVv05ErYkY4vZKazZ0nS5evMX3T/V3cOj iFRCjZ6FrkQvZfPy2/f6SfXmPRUc X-Google-Smtp-Source: APiQypLVm9h3gGTbwCIdrTPZi27nfTQ6vDYvo3h89tdkJkFR1hsfi//RwaFJbkvI1Di2iZO46mkYyA== X-Received: by 2002:a17:902:6114:: with SMTP id t20mr11878806plj.324.1587997374170; Mon, 27 Apr 2020 07:22:54 -0700 (PDT) Received: from localhost.localdomain ([2402:800:6374:bf12:8518:c5e6:e4cc:3967]) by smtp.gmail.com with ESMTPSA id c1sm12589602pfc.94.2020.04.27.07.22.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Apr 2020 07:22:53 -0700 (PDT) From: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= To: git@vger.kernel.org Cc: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= , Ramsay Jones , Johannes Schindelin , Junio C Hamano , Jeff King Subject: [PATCH v3 2/4] compat/regex: move stdlib.h up in inclusion chain Date: Mon, 27 Apr 2020 21:22:35 +0700 Message-Id: <8d18c53bc813865a652be148afd2292d75e1b635.1587996766.git.congdanhqx@gmail.com> X-Mailer: git-send-email 2.26.2.526.g744177e7f7 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In Linux with musl libc, we have this inclusion chain: compat/regex/regex.c:69 `-> compat/regex/regex_internal.h `-> /usr/include/stdlib.h `-> /usr/include/features.h `-> /usr/include/alloca.h In that inclusion chain, `` claims it's _BSD_SOURCE compatible when it's NOT asked to be either {_POSIX,_GNU,_XOPEN,_BSD}_SOURCE, or __STRICT_ANSI__. And, `` will include `` to be compatible with software written for GNU and BSD. Thus, redefine `alloca` macro, which was defined before at compat/regex/regex.c:66. Considering this is only compat code, we've taken from other project, it's not our business to decide which source should we adhere to. Include `` early to prevent the redefinition of alloca. This also remove a potential warning about alloca not defined on: #undef alloca Helped-by: Ramsay Jones Signed-off-by: Đoàn Trần Công Danh Signed-off-by: Ramsay Jones --- Notes: There is another warning about un-match declaration and definition of re_string_context_at. It's arguably, a bug in sparse itself. Consider that there's a fix for it in their development version already, and, we expect they'll fix the zero-ing pattern in 1/? before enable it again. There're no point to change that pair of declaration/definition. This patch is technically Ramsay's work. Since is likely unportable, my patch will be likely unusable. I took Ramsay's work and write the commit message instead. I would love to see Ramsay's SoB on reply to this patch. compat/regex/regex.c | 1 + compat/regex/regex_internal.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/compat/regex/regex.c b/compat/regex/regex.c index f3e03a9eab..e6f4a5d177 100644 --- a/compat/regex/regex.c +++ b/compat/regex/regex.c @@ -60,6 +60,7 @@ #undefs RE_DUP_MAX and sets it to the right value. */ #include #include +#include #ifdef GAWK #undef alloca diff --git a/compat/regex/regex_internal.h b/compat/regex/regex_internal.h index 3ee8aae59d..0bad8b841e 100644 --- a/compat/regex/regex_internal.h +++ b/compat/regex/regex_internal.h @@ -23,7 +23,6 @@ #include #include #include -#include #include #if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC From patchwork Mon Apr 27 14:22:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= X-Patchwork-Id: 11512349 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0D2DE1392 for ; Mon, 27 Apr 2020 14:22:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E88C7206BF for ; Mon, 27 Apr 2020 14:22:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="I46Ziqv8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728058AbgD0OW6 (ORCPT ); Mon, 27 Apr 2020 10:22:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727073AbgD0OW5 (ORCPT ); Mon, 27 Apr 2020 10:22:57 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 666E8C0610D5 for ; Mon, 27 Apr 2020 07:22:57 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id t9so7587157pjw.0 for ; Mon, 27 Apr 2020 07:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=j1L11PcE6Ew+R56eB2hiiV0LfYWd5vVO/ImVb8TcPHg=; b=I46Ziqv82I79/B/e38H99sMl3G7iF5pQfDPv2QLK+9JW8H4vvuKvyDYjrDTexYvHbX EWqI012338fhg08HIN5DRDSBB2VZYerBzuhYMom9Awg3JhR/v+JlaSFunOeOv3rmMjMd UNZcinIwhk4NWrObhudNkbjnjgCyC1LuMVZW6ISbjzNrGWEvk3jB8V69e7sgWQgFxRyo LTaQs5B1gQO9WcjrPz6iyoBckWKaAo4gVZaUVShepmYvHPHAJxgh5ZmldMLaCo1gp0/z kV5VZHsHFGaMQrFNqSUNF5bkSaJEPxdQ4BBlBU7+0oG6+p/sE8O/KDyhZQz16Ym8/M9Z /M7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=j1L11PcE6Ew+R56eB2hiiV0LfYWd5vVO/ImVb8TcPHg=; b=s/SZcOp1aQqbfDwomv7Qv2IeTqfgseHcy2xHXIxkX8sDSQemO5ZeqtxvOSaq60JsUk cIheBwMDdK3U6fFXAy5fVSDe9979Tqq4WK9Iwj/KunC6uzmGf6bIK9NPZJAG2cAhI7yM GwXQgvOCJYuZMioD5Tzh5x42vUOc3ARbnpbe93z28NoeT2gZy21/K22zj058lBmv3TWi NOk6wfyffFhZ4TsP1e5D7Qx3xNMhOWk1QUvdcIlT/0RIyhYcbaEaBJa9oPaebYhnvqQZ d9DVlQLJmniWnzJRfK+mkGcUftxEwsqewNXcKA0NHzvc+SQgjPy6UMiA99BZlZOEKBfF 6Qtw== X-Gm-Message-State: AGi0PuY7wkvd6aPCU8P0l/aEhWlTXa436nAj550i9fABuFk6C8EOY92J qWik9tYb9ek5pAqgHPLy19jr+Hv2 X-Google-Smtp-Source: APiQypI/7Ocl7e1w1kO5zPmMkZ6/DMh+UEKc8828Wp6U6T0oUR/jnrWHbqsdh/fhuEjYg1tvapt2Jg== X-Received: by 2002:a17:902:8305:: with SMTP id bd5mr22387410plb.114.1587997376809; Mon, 27 Apr 2020 07:22:56 -0700 (PDT) Received: from localhost.localdomain ([2402:800:6374:bf12:8518:c5e6:e4cc:3967]) by smtp.gmail.com with ESMTPSA id c1sm12589602pfc.94.2020.04.27.07.22.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Apr 2020 07:22:56 -0700 (PDT) From: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= To: git@vger.kernel.org Cc: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= , Ramsay Jones , Johannes Schindelin , Junio C Hamano , Jeff King Subject: [PATCH v3 3/4] graph.c: limit linkage of internal variable Date: Mon, 27 Apr 2020 21:22:36 +0700 Message-Id: <4e7580e1d1d844d0ed65e419fc039008740c4b7b.1587996766.git.congdanhqx@gmail.com> X-Mailer: git-send-email 2.26.2.526.g744177e7f7 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Signed-off-by: Đoàn Trần Công Danh --- graph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graph.c b/graph.c index 4fb25ad464..4cd9915075 100644 --- a/graph.c +++ b/graph.c @@ -1055,7 +1055,7 @@ static void graph_output_commit_line(struct git_graph *graph, struct graph_line graph_update_state(graph, GRAPH_COLLAPSING); } -const char merge_chars[] = {'/', '|', '\\'}; +static const char merge_chars[] = {'/', '|', '\\'}; static void graph_output_post_merge_line(struct git_graph *graph, struct graph_line *line) { From patchwork Mon Apr 27 14:22:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= X-Patchwork-Id: 11512351 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D49ED92A for ; Mon, 27 Apr 2020 14:23:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD3D4206CD for ; Mon, 27 Apr 2020 14:23:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hPEI0ld3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728064AbgD0OXB (ORCPT ); Mon, 27 Apr 2020 10:23:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727073AbgD0OXA (ORCPT ); Mon, 27 Apr 2020 10:23:00 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 613F2C0610D5 for ; Mon, 27 Apr 2020 07:23:00 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id a5so7579024pjh.2 for ; Mon, 27 Apr 2020 07:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1hYkfd0yPcvYslNgBt1AP5LqF9tJ+DGQKIb29SkvhF8=; b=hPEI0ld3PE+KwzcMYsJWvvAp0oT1yVIvx1xdIJDLnJqa3PEviQxf5fBhLilHO/EdgY nndWkOudE9IMXprkJE1wfV7BKX+Yp58JlabW4bgeMxd37+h8v2zTU6nAp092gotNiBEI hCnpkElgtvQu2rNG+EBJGbt9iEbgfBSPj9e0T3FVehNyBBtuJDGgkUTWIJ/ZseYTlGif 16CM/4wYMbjuSJreGwpIUIu62ztv1hg3xExvqzrIzFRisuVtDGOCZsbc2ihCgRHjC7ou OO7mYVn9uD6DxV9WHBDUdybu1vHwRKakDhbhtL2dugYtHa/ZDQt+hbCTYA3x8Trw76eN /Z/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1hYkfd0yPcvYslNgBt1AP5LqF9tJ+DGQKIb29SkvhF8=; b=iPTLYb1hOrEs2JDab01XMD3PD/rzRTcrmZeClfXywOKBuGexJYBVQqXK6pkQL0s3VL lyycdFB15TeWFdJ2NgejxG6FQyvRhWF3gTNjOBxdIgx/Zjon4yfD1fT8TJQXhpyPPOOu PgdZKT/29YZhb1NaLmuFJI1uq8bmDe1y2lu0XCRjsTrG6xp0XOdQJqQcosmPTR4Y+TNR ZR+DEaGJCT5BNmQnQygq9HWPcmGlw5SVQIxJcfDLTSQ+NVTk7TjEqSMEVYSPTA44o2C+ A8e9aAZ2u3hQgFs4TRJHva0vxjYi8gJxPzJMr/Vg16akgJPXMST3ygKbRVK5B18XQl3J 5iiw== X-Gm-Message-State: AGi0PubqlSBZ2e1IbR4LqbeW+mfeW4n3l6cqxI4Y3pBAzFqdvVtrhTan hkaArblD+deKginbf2ZUp0+Umg39 X-Google-Smtp-Source: APiQypLEmBZj0j1syeX+FfwI9fvD9RTlcrejODhP04UtwEntjcml06PL9Pb6WEQrOPLEpnxW53iZ3w== X-Received: by 2002:a17:90a:2401:: with SMTP id h1mr24420919pje.1.1587997379712; Mon, 27 Apr 2020 07:22:59 -0700 (PDT) Received: from localhost.localdomain ([2402:800:6374:bf12:8518:c5e6:e4cc:3967]) by smtp.gmail.com with ESMTPSA id c1sm12589602pfc.94.2020.04.27.07.22.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Apr 2020 07:22:59 -0700 (PDT) From: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= To: git@vger.kernel.org Cc: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= , Ramsay Jones , Johannes Schindelin , Junio C Hamano , Jeff King Subject: [PATCH v3 4/4] progress.c: silence cgcc suggestion about internal linkage Date: Mon, 27 Apr 2020 21:22:37 +0700 Message-Id: X-Mailer: git-send-email 2.26.2.526.g744177e7f7 In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Signed-off-by: Đoàn Trần Công Danh --- Notes: Unify all declaration together and keep them under an ifdef. With the hope that no other static analysis tools complain. progress.c | 2 +- progress.h | 8 ++++++++ t/helper/test-progress.c | 9 +-------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/progress.c b/progress.c index 19805ac646..75633e9c5e 100644 --- a/progress.c +++ b/progress.c @@ -8,6 +8,7 @@ * published by the Free Software Foundation. */ +#define GIT_TEST_PROGRESS_ONLY #include "cache.h" #include "gettext.h" #include "progress.h" @@ -52,7 +53,6 @@ static volatile sig_atomic_t progress_update; */ int progress_testing; uint64_t progress_test_ns = 0; -void progress_test_force_update(void); /* To silence -Wmissing-prototypes */ void progress_test_force_update(void) { progress_update = 1; diff --git a/progress.h b/progress.h index 847338911f..f1913acf73 100644 --- a/progress.h +++ b/progress.h @@ -3,6 +3,14 @@ struct progress; +#ifdef GIT_TEST_PROGRESS_ONLY + +extern int progress_testing; +extern uint64_t progress_test_ns; +void progress_test_force_update(void); + +#endif + void display_throughput(struct progress *progress, uint64_t total); void display_progress(struct progress *progress, uint64_t n); struct progress *start_progress(const char *title, uint64_t total); diff --git a/t/helper/test-progress.c b/t/helper/test-progress.c index 42b96cb103..5d05cbe789 100644 --- a/t/helper/test-progress.c +++ b/t/helper/test-progress.c @@ -13,20 +13,13 @@ * * See 't0500-progress-display.sh' for examples. */ +#define GIT_TEST_PROGRESS_ONLY #include "test-tool.h" #include "gettext.h" #include "parse-options.h" #include "progress.h" #include "strbuf.h" -/* - * These are defined in 'progress.c', but are not exposed in 'progress.h', - * because they are exclusively for testing. - */ -extern int progress_testing; -extern uint64_t progress_test_ns; -void progress_test_force_update(void); - int cmd__progress(int argc, const char **argv) { int total = 0;