*.[ch] *_INIT macros: use { 0 } for a "zero out" idiom
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 code that provided N zero'd fields to just 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 <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
9d444d9ee0
commit
9865b6e6a4
@ -371,7 +371,7 @@ struct object_info {
|
||||
* Initializer for a "struct object_info" that wants no items. You may
|
||||
* also memset() the memory to all-zeroes.
|
||||
*/
|
||||
#define OBJECT_INFO_INIT {NULL}
|
||||
#define OBJECT_INFO_INIT { 0 }
|
||||
|
||||
/* Invoke lookup_replace_object() on the given hash */
|
||||
#define OBJECT_INFO_LOOKUP_REPLACE 1
|
||||
|
Reference in New Issue
Block a user