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:

committed by
Junio C Hamano

parent
c6c8d0b797
commit
9cba13ca5d
@ -166,8 +166,7 @@ Format of STDIN stream:
|
||||
#define DEPTH_BITS 13
|
||||
#define MAX_DEPTH ((1<<DEPTH_BITS)-1)
|
||||
|
||||
struct object_entry
|
||||
{
|
||||
struct object_entry {
|
||||
struct pack_idx_entry idx;
|
||||
struct object_entry *next;
|
||||
uint32_t type : TYPE_BITS,
|
||||
@ -175,16 +174,14 @@ struct object_entry
|
||||
depth : DEPTH_BITS;
|
||||
};
|
||||
|
||||
struct object_entry_pool
|
||||
{
|
||||
struct object_entry_pool {
|
||||
struct object_entry_pool *next_pool;
|
||||
struct object_entry *next_free;
|
||||
struct object_entry *end;
|
||||
struct object_entry entries[FLEX_ARRAY]; /* more */
|
||||
};
|
||||
|
||||
struct mark_set
|
||||
{
|
||||
struct mark_set {
|
||||
union {
|
||||
struct object_entry *marked[1024];
|
||||
struct mark_set *sets[1024];
|
||||
@ -192,57 +189,49 @@ struct mark_set
|
||||
unsigned int shift;
|
||||
};
|
||||
|
||||
struct last_object
|
||||
{
|
||||
struct last_object {
|
||||
struct strbuf data;
|
||||
off_t offset;
|
||||
unsigned int depth;
|
||||
unsigned no_swap : 1;
|
||||
};
|
||||
|
||||
struct mem_pool
|
||||
{
|
||||
struct mem_pool {
|
||||
struct mem_pool *next_pool;
|
||||
char *next_free;
|
||||
char *end;
|
||||
uintmax_t space[FLEX_ARRAY]; /* more */
|
||||
};
|
||||
|
||||
struct atom_str
|
||||
{
|
||||
struct atom_str {
|
||||
struct atom_str *next_atom;
|
||||
unsigned short str_len;
|
||||
char str_dat[FLEX_ARRAY]; /* more */
|
||||
};
|
||||
|
||||
struct tree_content;
|
||||
struct tree_entry
|
||||
{
|
||||
struct tree_entry {
|
||||
struct tree_content *tree;
|
||||
struct atom_str *name;
|
||||
struct tree_entry_ms
|
||||
{
|
||||
struct tree_entry_ms {
|
||||
uint16_t mode;
|
||||
unsigned char sha1[20];
|
||||
} versions[2];
|
||||
};
|
||||
|
||||
struct tree_content
|
||||
{
|
||||
struct tree_content {
|
||||
unsigned int entry_capacity; /* must match avail_tree_content */
|
||||
unsigned int entry_count;
|
||||
unsigned int delta_depth;
|
||||
struct tree_entry *entries[FLEX_ARRAY]; /* more */
|
||||
};
|
||||
|
||||
struct avail_tree_content
|
||||
{
|
||||
struct avail_tree_content {
|
||||
unsigned int entry_capacity; /* must match tree_content */
|
||||
struct avail_tree_content *next_avail;
|
||||
};
|
||||
|
||||
struct branch
|
||||
{
|
||||
struct branch {
|
||||
struct branch *table_next_branch;
|
||||
struct branch *active_next_branch;
|
||||
const char *name;
|
||||
@ -254,16 +243,14 @@ struct branch
|
||||
unsigned char sha1[20];
|
||||
};
|
||||
|
||||
struct tag
|
||||
{
|
||||
struct tag {
|
||||
struct tag *next_tag;
|
||||
const char *name;
|
||||
unsigned int pack_id;
|
||||
unsigned char sha1[20];
|
||||
};
|
||||
|
||||
struct hash_list
|
||||
{
|
||||
struct hash_list {
|
||||
struct hash_list *next;
|
||||
unsigned char sha1[20];
|
||||
};
|
||||
@ -274,8 +261,7 @@ typedef enum {
|
||||
WHENSPEC_NOW
|
||||
} whenspec_type;
|
||||
|
||||
struct recent_command
|
||||
{
|
||||
struct recent_command {
|
||||
struct recent_command *prev;
|
||||
struct recent_command *next;
|
||||
char *buf;
|
||||
|
Reference in New Issue
Block a user