standardize brace placement in struct definitions

In a struct definitions, unlike functions, the prevailing style is for
the opening brace to go on the same line as the struct name, like so:

 struct foo {
	int bar;
	char *baz;
 };

Indeed, grepping for 'struct [a-z_]* {$' yields about 5 times as many
matches as 'struct [a-z_]*$'.

Linus sayeth:

 Heretic people all over the world have claimed that this inconsistency
 is ...  well ...  inconsistent, but all right-thinking people know that
 (a) K&R are _right_ and (b) K&R are right.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jonathan Nieder
2011-03-16 02:08:34 -05:00
committed by Junio C Hamano
parent c6c8d0b797
commit 9cba13ca5d
17 changed files with 44 additions and 88 deletions

View File

@ -21,8 +21,7 @@ static const char * const builtin_add_usage[] = {
static int patch_interactive, add_interactive, edit_interactive;
static int take_worktree_changes;
struct update_callback_data
{
struct update_callback_data {
int flags;
int add_errors;
};

View File

@ -1312,8 +1312,7 @@ static void pass_blame(struct scoreboard *sb, struct origin *origin, int opt)
/*
* Information on commits, used for output.
*/
struct commit_info
{
struct commit_info {
const char *author;
const char *author_mail;
unsigned long author_time;

View File

@ -40,8 +40,7 @@ enum work_type {WORK_SHA1, WORK_FILE};
* threads. The producer adds struct work_items to 'todo' and the
* consumers pick work items from the same array.
*/
struct work_item
{
struct work_item {
enum work_type type;
char *name;

View File

@ -13,8 +13,7 @@
static const char index_pack_usage[] =
"git index-pack [-v] [-o <index-file>] [ --keep | --keep=<msg> ] [--strict] (<pack-file> | --stdin [--fix-thin] [<pack-file>])";
struct object_entry
{
struct object_entry {
struct pack_idx_entry idx;
unsigned long size;
unsigned int hdr_size;
@ -44,8 +43,7 @@ struct base_data {
#define FLAG_LINK (1u<<20)
#define FLAG_CHECKED (1u<<21)
struct delta_entry
{
struct delta_entry {
union delta_base base;
int obj_no;
};