From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id A06F61F8C8 for ; Mon, 27 Sep 2021 02:28:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232360AbhI0C3T convert rfc822-to-8bit (ORCPT ); Sun, 26 Sep 2021 22:29:19 -0400 Received: from mail-ed1-f50.google.com ([209.85.208.50]:33391 "EHLO mail-ed1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbhI0C3T (ORCPT ); Sun, 26 Sep 2021 22:29:19 -0400 Received: by mail-ed1-f50.google.com with SMTP id b26so14436115edt.0 for ; Sun, 26 Sep 2021 19:27:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=yXc1Y+eRWg3JTnJM+hZzveV7uf8nnxMU6y/0fH4fY/g=; b=VZhcAhLWHLlvTsfPIZyPaSTHmgCNOjcBUMzXz7fKL4//iFoR1H6v0vMNbCxFVzy0Wo N0kGCuh5+gzaF/xqVtnYWmioH3t43mXvTrfyCG1NFbUlqiU6FXlTLJ4jA7Q1ZUTMxVb6 EB2YkcKw1fRcHS9SXMEfOenDWjPL/ERkMwNa88k9LdNfyato1Uai8bj+lmhzIGFZhNsw tSGj1rkpYcWVUICSHF4I6EcGsnlzlZC22XiJwA/Sw9FJS/mFO+oavotC3XtEOma2Vfiu cD0VPG/dXYuUi+p2ERMEEMSqHyHZ+SHaSbvsSd8Z4NrGOtcyeGslHd8/IhPWo59JVYjI YaaQ== X-Gm-Message-State: AOAM530lfqQdJYwvfl29E4XUB0POX71BQ2WkAU1z8NA06lPNHMGbWMMT dDhePvYF8fwa9j0WqS1XJM6ENn7ruqbl6z4mIaY= X-Google-Smtp-Source: ABdhPJwObb3uMOWzdkcOGw39NkMBBylvYt0rCKAYUgsNh34jUgA6AX37aA/OQVlw/s1kLsh9VRLZiNGDL6tg/ESo4nU= X-Received: by 2002:a50:e0c8:: with SMTP id j8mr20292553edl.283.1632709661018; Sun, 26 Sep 2021 19:27:41 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Eric Sunshine Date: Sun, 26 Sep 2021 22:27:30 -0400 Message-ID: Subject: Re: [PATCH 2/5] *.[ch] *_INIT macros: use { 0 } for a "zero out" idiom To: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Cc: Git List , Junio C Hamano , Jeff King , =?UTF-8?Q?Martin_=C3=85gren?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Sun, Sep 26, 2021 at 8:40 PM Ævar Arnfjörð Bjarmason wrote: > In C it isn't required to specify that all members of a struct are > zero'd out to 0, NULL or '\0', just providing a "{ 0 }" will > accomplish that. > > Let's also change change code that provided N zero'd fields to just s/change change/change/ > provide one, and change e.g. "{ NULL }" to "{ 0 }" for > consistency. I.e. even if the first member is a pointer let's use "0" > instead of "NULL". The point of using "0" consistently is to pick one, > and to not have the reader wonder why we're not using the same pattern > everywhere. > > Signed-off-by: Ævar Arnfjörð Bjarmason