{"thread":{"id":"19144","subject":"[PATCH] Fix a bunch of pointer declarations (codestyle)","startedAt":"2009-05-01T09:06:36Z","lastAt":"2009-05-01T22:59:57Z","messageCount":6,"participants":["Felipe Contreras","Stephen Boyd","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"112809","messageId":"1241168796-7222-1-git-send-email-felipe.contreras@gmail.com","threadId":"19144","inReplyTo":null,"subject":"[PATCH] Fix a bunch of pointer declarations (codestyle)","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2009-05-01T09:06:36Z","receivedAt":"2009-05-01T09:06:36Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Essentially; s/type* /type */ as per the coding guidelines.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n alias.c                                   |    4 +-\n alloc.c                                   |    2 +-\n attr.c                                    |    4 +-\n builtin-blame.c                           |    8 +++---\n builtin-checkout-index.c                  |    4 +-\n builtin-describe.c                        |    4 +-\n builtin-fetch-pack.c                      |    2 +-\n builtin-help.c                            |    6 ++--\n builtin-update-index.c                    |    6 ++--\n cache.h                                   |    2 +-\n combine-diff.c                            |    4 +-\n compat/mingw.c                            |    2 +-\n config.c                                  |   30 ++++++++++++++--------------\n contrib/convert-objects/convert-objects.c |    6 ++--\n diff-no-index.c                           |    2 +-\n diff.c                                    |    6 ++--\n dir.c                                     |    2 +-\n fast-import.c                             |   14 ++++++------\n git.c                                     |    8 +++---\n lockfile.c                                |    2 +-\n reflog-walk.c                             |    2 +-\n run-command.c                             |    2 +-\n server-info.c                             |    4 +-\n sha1_file.c                               |    2 +-\n wt-status.c                               |    2 +-\n 25 files changed, 65 insertions(+), 65 deletions(-)\n\ndiff --git a/alias.c b/alias.c\nindex ccb1108..e687fe5 100644\n--- a/alias.c\n+++ b/alias.c\n@@ -27,7 +27,7 @@ int split_cmdline(char *cmdline, const char ***argv)\n \tint src, dst, count = 0, size = 16;\n \tchar quoted = 0;\n \n-\t*argv = xmalloc(sizeof(char*) * size);\n+\t*argv = xmalloc(sizeof(char *) * size);\n \n \t/* split alias_string */\n \t(*argv)[count++] = cmdline;\n@@ -40,7 +40,7 @@ int split_cmdline(char *cmdline, const char ***argv)\n \t\t\t\t; /* skip */\n \t\t\tif (count >= size) {\n \t\t\t\tsize += 16;\n-\t\t\t\t*argv = xrealloc(*argv, sizeof(char*) * size);\n+\t\t\t\t*argv = xrealloc(*argv, sizeof(char *) * size);\n \t\t\t}\n \t\t\t(*argv)[count++] = cmdline + dst;\n \t\t} else if (!quoted && (c == '\\'' || c == '\"')) {\ndiff --git a/alloc.c b/alloc.c\nindex 216c23a..6ef6753 100644\n--- a/alloc.c\n+++ b/alloc.c\n@@ -57,7 +57,7 @@ DEFINE_ALLOCATOR(object, union any_object)\n #define SZ_FMT \"%zu\"\n #endif\n \n-static void report(const char* name, unsigned int count, size_t size)\n+static void report(const char *name, unsigned int count, size_t size)\n {\n     fprintf(stderr, \"%10s: %8u (\" SZ_FMT \" kB)\\n\", name, count, size);\n }\ndiff --git a/attr.c b/attr.c\nindex f1ca4f5..98eb636 100644\n--- a/attr.c\n+++ b/attr.c\n@@ -224,7 +224,7 @@ static struct match_attr *parse_attr_line(const char *line, const char *src,\n \t\tif (is_macro)\n \t\t\tres->u.attr = git_attr(name, namelen);\n \t\telse {\n-\t\t\tres->u.pattern = (char*)&(res->state[num_attr]);\n+\t\t\tres->u.pattern = (char *)&(res->state[num_attr]);\n \t\t\tmemcpy(res->u.pattern, name, namelen);\n \t\t\tres->u.pattern[namelen] = 0;\n \t\t}\n@@ -275,7 +275,7 @@ static void free_attr_elem(struct attr_stack *e)\n \t\t\t    setto == ATTR__UNKNOWN)\n \t\t\t\t;\n \t\t\telse\n-\t\t\t\tfree((char*) setto);\n+\t\t\t\tfree((char *) setto);\n \t\t}\n \t\tfree(a);\n \t}\ndiff --git a/builtin-blame.c b/builtin-blame.c\nindex 83141fc..cf74a92 100644\n--- a/builtin-blame.c\n+++ b/builtin-blame.c\n@@ -873,7 +873,7 @@ static void find_copy_in_blob(struct scoreboard *sb,\n \t * Prepare mmfile that contains only the lines in ent.\n \t */\n \tcp = nth_line(sb, ent->lno);\n-\tfile_o.ptr = (char*) cp;\n+\tfile_o.ptr = (char *) cp;\n \tcnt = ent->num_lines;\n \n \twhile (cnt && cp < sb->final_buf + sb->final_buf_size) {\n@@ -1704,7 +1704,7 @@ static int prepare_lines(struct scoreboard *sb)\n \twhile (len--) {\n \t\tif (bol) {\n \t\t\tsb->lineno = xrealloc(sb->lineno,\n-\t\t\t\t\t      sizeof(int* ) * (num + 1));\n+\t\t\t\t\t      sizeof(int *) * (num + 1));\n \t\t\tsb->lineno[num] = buf - sb->final_buf;\n \t\t\tbol = 0;\n \t\t}\n@@ -1714,7 +1714,7 @@ static int prepare_lines(struct scoreboard *sb)\n \t\t}\n \t}\n \tsb->lineno = xrealloc(sb->lineno,\n-\t\t\t      sizeof(int* ) * (num + incomplete + 1));\n+\t\t\t      sizeof(int *) * (num + incomplete + 1));\n \tsb->lineno[num + incomplete] = buf - sb->final_buf;\n \tsb->num_lines = num + incomplete;\n \treturn sb->num_lines;\n@@ -1889,7 +1889,7 @@ static const char *parse_loc(const char *spec,\n \t\treturn spec;\n \n \t/* it could be a regexp of form /.../ */\n-\tfor (term = (char*) spec + 1; *term && *term != '/'; term++) {\n+\tfor (term = (char *) spec + 1; *term && *term != '/'; term++) {\n \t\tif (*term == '\\\\')\n \t\t\tterm++;\n \t}\ndiff --git a/builtin-checkout-index.c b/builtin-checkout-index.c\nindex 0d534bc..afe35e2 100644\n--- a/builtin-checkout-index.c\n+++ b/builtin-checkout-index.c\n@@ -124,7 +124,7 @@ static int checkout_file(const char *name, int prefix_length)\n static void checkout_all(const char *prefix, int prefix_length)\n {\n \tint i, errs = 0;\n-\tstruct cache_entry* last_ce = NULL;\n+\tstruct cache_entry *last_ce = NULL;\n \n \tfor (i = 0; i < active_nr ; i++) {\n \t\tstruct cache_entry *ce = active_cache[i];\n@@ -278,7 +278,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)\n \t\tp = prefix_path(prefix, prefix_length, arg);\n \t\tcheckout_file(p, prefix_length);\n \t\tif (p < arg || p > arg + strlen(arg))\n-\t\t\tfree((char*)p);\n+\t\t\tfree((char *)p);\n \t}\n \n \tif (read_from_stdin) {\ndiff --git a/builtin-describe.c b/builtin-describe.c\nindex 3a007ed..63c6a19 100644\n--- a/builtin-describe.c\n+++ b/builtin-describe.c\n@@ -334,7 +334,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \t\tdie(\"--long is incompatible with --abbrev=0\");\n \n \tif (contains) {\n-\t\tconst char **args = xmalloc((7 + argc) * sizeof(char*));\n+\t\tconst char **args = xmalloc((7 + argc) * sizeof(char *));\n \t\tint i = 0;\n \t\targs[i++] = \"name-rev\";\n \t\targs[i++] = \"--name-only\";\n@@ -349,7 +349,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \t\t\t\targs[i++] = s;\n \t\t\t}\n \t\t}\n-\t\tmemcpy(args + i, argv, argc * sizeof(char*));\n+\t\tmemcpy(args + i, argv, argc * sizeof(char *));\n \t\targs[i + argc] = NULL;\n \t\treturn cmd_name_rev(i + argc, args, prefix);\n \t}\ndiff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c\nindex 5d134be..cbe5f20 100644\n--- a/builtin-fetch-pack.c\n+++ b/builtin-fetch-pack.c\n@@ -111,7 +111,7 @@ static void mark_common(struct commit *commit,\n   Get the next rev to send, ignoring the common.\n */\n \n-static const unsigned char* get_rev(void)\n+static const unsigned char *get_rev(void)\n {\n \tstruct commit *commit = NULL;\n \ndiff --git a/builtin-help.c b/builtin-help.c\nindex e7fbe9a..67dda3e 100644\n--- a/builtin-help.c\n+++ b/builtin-help.c\n@@ -114,7 +114,7 @@ static int check_emacsclient_version(void)\n \treturn 0;\n }\n \n-static void exec_woman_emacs(const char* path, const char *page)\n+static void exec_woman_emacs(const char *path, const char *page)\n {\n \tif (!check_emacsclient_version()) {\n \t\t/* This works only with emacsclient version >= 22. */\n@@ -128,7 +128,7 @@ static void exec_woman_emacs(const char* path, const char *page)\n \t}\n }\n \n-static void exec_man_konqueror(const char* path, const char *page)\n+static void exec_man_konqueror(const char *path, const char *page)\n {\n \tconst char *display = getenv(\"DISPLAY\");\n \tif (display && *display) {\n@@ -156,7 +156,7 @@ static void exec_man_konqueror(const char* path, const char *page)\n \t}\n }\n \n-static void exec_man_man(const char* path, const char *page)\n+static void exec_man_man(const char *path, const char *page)\n {\n \tif (!path)\n \t\tpath = \"man\";\ndiff --git a/builtin-update-index.c b/builtin-update-index.c\nindex 1fde893..92beaaf 100644\n--- a/builtin-update-index.c\n+++ b/builtin-update-index.c\n@@ -292,7 +292,7 @@ static void update_one(const char *path, const char *prefix, int prefix_length)\n \treport(\"add '%s'\", path);\n  free_return:\n \tif (p < path || p > path + strlen(path))\n-\t\tfree((char*)p);\n+\t\tfree((char *)p);\n }\n \n static void read_index_info(int line_termination)\n@@ -509,7 +509,7 @@ static int do_unresolve(int ac, const char **av,\n \t\tconst char *p = prefix_path(prefix, prefix_length, arg);\n \t\terr |= unresolve_one(p);\n \t\tif (p < arg || p > arg + strlen(arg))\n-\t\t\tfree((char*)p);\n+\t\t\tfree((char *)p);\n \t}\n \treturn err;\n }\n@@ -712,7 +712,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \t\tif (set_executable_bit)\n \t\t\tchmod_path(set_executable_bit, p);\n \t\tif (p < path || p > path + strlen(path))\n-\t\t\tfree((char*)p);\n+\t\t\tfree((char *)p);\n \t}\n \tif (read_from_stdin) {\n \t\tstruct strbuf buf = STRBUF_INIT, nbuf = STRBUF_INIT;\ndiff --git a/cache.h b/cache.h\nindex d0d48b4..b8503ad 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -846,7 +846,7 @@ extern struct packed_git *find_sha1_pack(const unsigned char *sha1,\n \n extern void pack_report(void);\n extern int open_pack_index(struct packed_git *);\n-extern unsigned char* use_pack(struct packed_git *, struct pack_window **, off_t, unsigned int *);\n+extern unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, unsigned int *);\n extern void close_pack_windows(struct packed_git *);\n extern void unuse_pack(struct pack_window **);\n extern void free_pack_by_name(const char *);\ndiff --git a/combine-diff.c b/combine-diff.c\nindex d210656..60d0367 100644\n--- a/combine-diff.c\n+++ b/combine-diff.c\n@@ -24,7 +24,7 @@ static struct combine_diff_path *intersect_paths(struct combine_diff_path *curr,\n \t\t\tpath = q->queue[i]->two->path;\n \t\t\tlen = strlen(path);\n \t\t\tp = xmalloc(combine_diff_path_size(num_parent, len));\n-\t\t\tp->path = (char*) &(p->parent[num_parent]);\n+\t\t\tp->path = (char *) &(p->parent[num_parent]);\n \t\t\tmemcpy(p->path, path, len);\n \t\t\tp->path[len] = 0;\n \t\t\tp->len = len;\n@@ -1063,7 +1063,7 @@ void diff_tree_combined_merge(const unsigned char *sha1,\n \tfor (parents = commit->parents, num_parent = 0;\n \t     parents;\n \t     parents = parents->next, num_parent++)\n-\t\thashcpy((unsigned char*)(parent + num_parent),\n+\t\thashcpy((unsigned char *)(parent + num_parent),\n \t\t\tparents->item->object.sha1);\n \tdiff_tree_combined(sha1, parent, num_parent, dense, rev);\n }\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 2a04701..cdeda1d 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -562,7 +562,7 @@ static char **get_path_split(void)\n \tif (!n)\n \t\treturn NULL;\n \n-\tpath = xmalloc((n+1)*sizeof(char*));\n+\tpath = xmalloc((n+1)*sizeof(char *));\n \tp = envpath;\n \ti = 0;\n \tdo {\ndiff --git a/config.c b/config.c\nindex f76a783..1682273 100644\n--- a/config.c\n+++ b/config.c\n@@ -724,16 +724,16 @@ int git_config(config_fn_t fn, void *data)\n \n static struct {\n \tint baselen;\n-\tchar* key;\n+\tchar *key;\n \tint do_not_match;\n-\tregex_t* value_regex;\n+\tregex_t *value_regex;\n \tint multi_replace;\n \tsize_t offset[MAX_MATCHES];\n \tenum { START, SECTION_SEEN, SECTION_END_SEEN, KEY_SEEN } state;\n \tint seen;\n } store;\n \n-static int matches(const char* key, const char* value)\n+static int matches(const char *key, const char *value)\n {\n \treturn !strcmp(key, store.key) &&\n \t\t(store.value_regex == NULL ||\n@@ -741,7 +741,7 @@ static int matches(const char* key, const char* value)\n \t\t  !regexec(store.value_regex, value, 0, NULL, 0)));\n }\n \n-static int store_aux(const char* key, const char* value, void *cb)\n+static int store_aux(const char *key, const char *value, void *cb)\n {\n \tconst char *ep;\n \tsize_t section_len;\n@@ -810,7 +810,7 @@ static int write_error(const char *filename)\n \treturn 4;\n }\n \n-static int store_write_section(int fd, const char* key)\n+static int store_write_section(int fd, const char *key)\n {\n \tconst char *dot;\n \tint i, success;\n@@ -835,7 +835,7 @@ static int store_write_section(int fd, const char* key)\n \treturn success;\n }\n \n-static int store_write_pair(int fd, const char* key, const char* value)\n+static int store_write_pair(int fd, const char *key, const char *value)\n {\n \tint i, success;\n \tint length = strlen(key + store.baselen + 1);\n@@ -883,8 +883,8 @@ static int store_write_pair(int fd, const char* key, const char* value)\n \treturn success;\n }\n \n-static ssize_t find_beginning_of_line(const char* contents, size_t size,\n-\tsize_t offset_, int* found_bracket)\n+static ssize_t find_beginning_of_line(const char *contents, size_t size,\n+\tsize_t offset_, int *found_bracket)\n {\n \tsize_t equal_offset = size, bracket_offset = size;\n \tssize_t offset;\n@@ -909,7 +909,7 @@ contline:\n \treturn offset;\n }\n \n-int git_config_set(const char* key, const char* value)\n+int git_config_set(const char *key, const char *value)\n {\n \treturn git_config_set_multivar(key, value, NULL, 0);\n }\n@@ -937,15 +937,15 @@ int git_config_set(const char* key, const char* value)\n  * - the config file is removed and the lock file rename()d to it.\n  *\n  */\n-int git_config_set_multivar(const char* key, const char* value,\n-\tconst char* value_regex, int multi_replace)\n+int git_config_set_multivar(const char *key, const char *value,\n+\tconst char *value_regex, int multi_replace)\n {\n \tint i, dot;\n \tint fd = -1, in_fd;\n \tint ret;\n-\tchar* config_filename;\n+\tchar *config_filename;\n \tstruct lock_file *lock = NULL;\n-\tconst char* last_dot = strrchr(key, '.');\n+\tconst char *last_dot = strrchr(key, '.');\n \n \tif (config_exclusive_filename)\n \t\tconfig_filename = xstrdup(config_exclusive_filename);\n@@ -1026,13 +1026,13 @@ int git_config_set_multivar(const char* key, const char* value,\n \t\t\tgoto out_free;\n \t\t}\n \n-\t\tstore.key = (char*)key;\n+\t\tstore.key = (char *)key;\n \t\tif (!store_write_section(fd, key) ||\n \t\t    !store_write_pair(fd, key, value))\n \t\t\tgoto write_err_out;\n \t} else {\n \t\tstruct stat st;\n-\t\tchar* contents;\n+\t\tchar *contents;\n \t\tsize_t contents_sz, copy_begin, copy_end;\n \t\tint i, new_line = 0;\n \ndiff --git a/contrib/convert-objects/convert-objects.c b/contrib/convert-objects/convert-objects.c\nindex 90e7900..f3b57bf 100644\n--- a/contrib/convert-objects/convert-objects.c\n+++ b/contrib/convert-objects/convert-objects.c\n@@ -59,7 +59,7 @@ static void convert_ascii_sha1(void *buffer)\n \tstruct entry *entry;\n \n \tif (get_sha1_hex(buffer, sha1))\n-\t\tdie(\"expected sha1, got '%s'\", (char*) buffer);\n+\t\tdie(\"expected sha1, got '%s'\", (char *) buffer);\n \tentry = convert_entry(sha1);\n \tmemcpy(buffer, sha1_to_hex(entry->new_sha1), 40);\n }\n@@ -100,7 +100,7 @@ static int write_subdirectory(void *buffer, unsigned long size, const char *base\n \t\tif (!slash) {\n \t\t\tnewlen += sprintf(new + newlen, \"%o %s\", mode, path);\n \t\t\tnew[newlen++] = '\\0';\n-\t\t\thashcpy((unsigned char*)new + newlen, (unsigned char *) buffer + len - 20);\n+\t\t\thashcpy((unsigned char *)new + newlen, (unsigned char *) buffer + len - 20);\n \t\t\tnewlen += 20;\n \n \t\t\tused += len;\n@@ -271,7 +271,7 @@ static void convert_commit(void *buffer, unsigned long size, unsigned char *resu\n \tunsigned long orig_size = size;\n \n \tif (memcmp(buffer, \"tree \", 5))\n-\t\tdie(\"Bad commit '%s'\", (char*) buffer);\n+\t\tdie(\"Bad commit '%s'\", (char *) buffer);\n \tconvert_ascii_sha1((char *) buffer + 5);\n \tbuffer = (char *) buffer + 46;    /* \"tree \" + \"hex sha1\" + \"\\n\" */\n \twhile (!memcmp(buffer, \"parent \", 7)) {\ndiff --git a/diff-no-index.c b/diff-no-index.c\nindex 42c1dd8..4ebc1db 100644\n--- a/diff-no-index.c\n+++ b/diff-no-index.c\n@@ -233,7 +233,7 @@ void diff_no_index(struct rev_info *revs,\n \tif (prefix) {\n \t\tint len = strlen(prefix);\n \n-\t\trevs->diffopt.paths = xcalloc(2, sizeof(char*));\n+\t\trevs->diffopt.paths = xcalloc(2, sizeof(char *));\n \t\tfor (i = 0; i < 2; i++) {\n \t\t\tconst char *p = argv[argc - 2 + i];\n \t\t\t/*\ndiff --git a/diff.c b/diff.c\nindex 3ac7168..78140e7 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -876,7 +876,7 @@ static void fill_print_name(struct diffstat_file *file)\n \tfile->print_name = pname;\n }\n \n-static void show_stats(struct diffstat_t* data, struct diff_options *options)\n+static void show_stats(struct diffstat_t *data, struct diff_options *options)\n {\n \tint i, len, add, del, adds = 0, dels = 0;\n \tint max_change = 0, max_len = 0;\n@@ -1025,7 +1025,7 @@ static void show_shortstats(struct diffstat_t* data, struct diff_options *option\n \t       total_files, adds, dels);\n }\n \n-static void show_numstat(struct diffstat_t* data, struct diff_options *options)\n+static void show_numstat(struct diffstat_t *data, struct diff_options *options)\n {\n \tint i;\n \ndiff --git a/dir.c b/dir.c\nindex c91ebfb..15677da 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -156,7 +156,7 @@ void add_exclude(const char *string, const char *base,\n \tif (len && string[len - 1] == '/') {\n \t\tchar *s;\n \t\tx = xmalloc(sizeof(*x) + len);\n-\t\ts = (char*)(x+1);\n+\t\ts = (char *)(x+1);\n \t\tmemcpy(s, string, len - 1);\n \t\ts[len - 1] = '\\0';\n \t\tstring = s;\ndiff --git a/fast-import.c b/fast-import.c\nindex 8d959af..e9d23ff 100644\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -212,7 +212,7 @@ struct tree_content;\n struct tree_entry\n {\n \tstruct tree_content *tree;\n-\tstruct atom_str* name;\n+\tstruct atom_str *name;\n \tstruct tree_entry_ms\n \t{\n \t\tuint16_t mode;\n@@ -313,7 +313,7 @@ static unsigned int object_entry_alloc = 5000;\n static struct object_entry_pool *blocks;\n static struct object_entry *object_table[1 << 16];\n static struct mark_set *marks;\n-static const char* mark_file;\n+static const char *mark_file;\n \n /* Our last blob */\n static struct last_object last_blob = { STRBUF_INIT, 0, 0, 0 };\n@@ -672,7 +672,7 @@ static struct branch *lookup_branch(const char *name)\n static struct branch *new_branch(const char *name)\n {\n \tunsigned int hc = hc_str(name, strlen(name)) % branch_table_sz;\n-\tstruct branch* b = lookup_branch(name);\n+\tstruct branch *b = lookup_branch(name);\n \n \tif (b)\n \t\tdie(\"Invalid attempt to create duplicate branch: %s\", name);\n@@ -1035,7 +1035,7 @@ static int store_object(\n \tgit_SHA_CTX c;\n \tz_stream s;\n \n-\thdrlen = sprintf((char*)hdr,\"%s %lu\", typename(type),\n+\thdrlen = sprintf((char *)hdr,\"%s %lu\", typename(type),\n \t\t(unsigned long)dat->len) + 1;\n \tgit_SHA1_Init(&c);\n \tgit_SHA1_Update(&c, hdr, hdrlen);\n@@ -1217,7 +1217,7 @@ static const char *get_mode(const char *str, uint16_t *modep)\n \n static void load_tree(struct tree_entry *root)\n {\n-\tunsigned char* sha1 = root->versions[1].sha1;\n+\tunsigned char *sha1 = root->versions[1].sha1;\n \tstruct object_entry *myoe;\n \tstruct tree_content *t;\n \tunsigned long size;\n@@ -1258,8 +1258,8 @@ static void load_tree(struct tree_entry *root)\n \t\te->versions[0].mode = e->versions[1].mode;\n \t\te->name = to_atom(c, strlen(c));\n \t\tc += e->name->str_len + 1;\n-\t\thashcpy(e->versions[0].sha1, (unsigned char*)c);\n-\t\thashcpy(e->versions[1].sha1, (unsigned char*)c);\n+\t\thashcpy(e->versions[0].sha1, (unsigned char *)c);\n+\t\thashcpy(e->versions[1].sha1, (unsigned char *)c);\n \t\tc += 20;\n \t}\n \tfree(buf);\ndiff --git a/git.c b/git.c\nindex cc5aaa7..5a00726 100644\n--- a/git.c\n+++ b/git.c\n@@ -47,7 +47,7 @@ static void commit_pager_choice(void) {\n \t}\n }\n \n-static int handle_options(const char*** argv, int* argc, int* envchanged)\n+static int handle_options(const char ***argv, int *argc, int *envchanged)\n {\n \tint handled = 0;\n \n@@ -136,7 +136,7 @@ static int handle_alias(int *argcp, const char ***argv)\n \tint envchanged = 0, ret = 0, saved_errno = errno;\n \tconst char *subdir;\n \tint count, option_count;\n-\tconst char** new_argv;\n+\tconst char **new_argv;\n \tconst char *alias_command;\n \tchar *alias_string;\n \tint unused_nongit;\n@@ -187,10 +187,10 @@ static int handle_alias(int *argcp, const char ***argv)\n \t\t\t\t  \"trace: alias expansion: %s =>\",\n \t\t\t\t  alias_command);\n \n-\t\tnew_argv = xrealloc(new_argv, sizeof(char*) *\n+\t\tnew_argv = xrealloc(new_argv, sizeof(char *) *\n \t\t\t\t    (count + *argcp + 1));\n \t\t/* insert after command name */\n-\t\tmemcpy(new_argv + count, *argv + 1, sizeof(char*) * *argcp);\n+\t\tmemcpy(new_argv + count, *argv + 1, sizeof(char *) * *argcp);\n \t\tnew_argv[count+*argcp] = NULL;\n \n \t\t*argv = new_argv;\ndiff --git a/lockfile.c b/lockfile.c\nindex 3dbb2d1..828d19f 100644\n--- a/lockfile.c\n+++ b/lockfile.c\n@@ -109,7 +109,7 @@ static char *resolve_symlink(char *p, size_t s)\n \t\t\t * link is a relative path, so I must replace the\n \t\t\t * last element of p with it.\n \t\t\t */\n-\t\t\tchar *r = (char*)last_path_elm(p);\n+\t\t\tchar *r = (char *)last_path_elm(p);\n \t\t\tif (r - p + link_len < s)\n \t\t\t\tstrcpy(r, link);\n \t\t\telse {\ndiff --git a/reflog-walk.c b/reflog-walk.c\nindex fd065f4..5623ea6 100644\n--- a/reflog-walk.c\n+++ b/reflog-walk.c\n@@ -241,7 +241,7 @@ void fake_reflog_parent(struct reflog_walk_info *info, struct commit *commit)\n \tcommit->object.flags &= ~(ADDED | SEEN | SHOWN);\n }\n \n-void show_reflog_message(struct reflog_walk_info* info, int oneline,\n+void show_reflog_message(struct reflog_walk_info *info, int oneline,\n \tenum date_mode dmode)\n {\n \tif (info && info->last_commit_reflog) {\ndiff --git a/run-command.c b/run-command.c\nindex b05c734..eb2efc3 100644\n--- a/run-command.c\n+++ b/run-command.c\n@@ -106,7 +106,7 @@ int start_command(struct child_process *cmd)\n \t\tif (cmd->env) {\n \t\t\tfor (; *cmd->env; cmd->env++) {\n \t\t\t\tif (strchr(*cmd->env, '='))\n-\t\t\t\t\tputenv((char*)*cmd->env);\n+\t\t\t\t\tputenv((char *)*cmd->env);\n \t\t\t\telse\n \t\t\t\t\tunsetenv(*cmd->env);\n \t\t\t}\ndiff --git a/server-info.c b/server-info.c\nindex 66b0d9d..906ce5b 100644\n--- a/server-info.c\n+++ b/server-info.c\n@@ -132,8 +132,8 @@ static int read_pack_info_file(const char *infofile)\n \n static int compare_info(const void *a_, const void *b_)\n {\n-\tstruct pack_info * const* a = a_;\n-\tstruct pack_info * const* b = b_;\n+\tstruct pack_info *const *a = a_;\n+\tstruct pack_info *const *b = b_;\n \n \tif (0 <= (*a)->old_num && 0 <= (*b)->old_num)\n \t\t/* Keep the order in the original */\ndiff --git a/sha1_file.c b/sha1_file.c\nindex f708cf4..28bd908 100644\n--- a/sha1_file.c\n+++ b/sha1_file.c\n@@ -791,7 +791,7 @@ static int in_window(struct pack_window *win, off_t offset)\n \t\t&& (offset + 20) <= (win_off + win->len);\n }\n \n-unsigned char* use_pack(struct packed_git *p,\n+unsigned char *use_pack(struct packed_git *p,\n \t\tstruct pack_window **w_cursor,\n \t\toff_t offset,\n \t\tunsigned int *left)\ndiff --git a/wt-status.c b/wt-status.c\nindex 929b00f..1b6df45 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -40,7 +40,7 @@ static int parse_status_slot(const char *var, int offset)\n \tdie(\"bad config variable '%s'\", var);\n }\n \n-static const char* color(int slot)\n+static const char *color(int slot)\n {\n \treturn wt_status_use_color > 0 ? wt_status_colors[slot] : \"\";\n }\n-- \n1.6.3.rc3.13.g195b.dirty\n"},{"id":"112810","messageId":"94a0d4530905010207r2da4157cpc6babd530e91f83@mail.gmail.com","threadId":"19144","inReplyTo":"1241168796-7222-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH] Fix a bunch of pointer declarations (codestyle)","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2009-05-01T09:07:38Z","receivedAt":"2009-05-01T09:07:38Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Fri, May 1, 2009 at 12:06 PM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n> Essentially; s/type* /type */ as per the coding guidelines.\n\nFTR, I've made sure this patch applies cleanly on master, next and pu.\n\n-- \nFelipe Contreras\n"},{"id":"112835","messageId":"780e0a6b0905011220g42d9784dp186cc7ff7669081e@mail.gmail.com","threadId":"19144","inReplyTo":"1241168796-7222-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH] Fix a bunch of pointer declarations (codestyle)","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-05-01T19:20:08Z","receivedAt":"2009-05-01T19:20:08Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On Fri, May 1, 2009 at 2:06 AM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n>\n> -       *argv = xmalloc(sizeof(char*) * size);\n> +       *argv = xmalloc(sizeof(char *) * size);\n>\n\nI don't think this is what the coding guidelines is talking about. A\npointer isn't being declared here plus there isn't any variable the\nstar should be sticking to.\n"},{"id":"112838","messageId":"20090501203910.GA15549@coredump.intra.peff.net","threadId":"19144","inReplyTo":"780e0a6b0905011220g42d9784dp186cc7ff7669081e@mail.gmail.com","subject":"Re: [PATCH] Fix a bunch of pointer declarations (codestyle)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-05-01T20:39:10Z","receivedAt":"2009-05-01T20:39:10Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 01, 2009 at 12:20:08PM -0700, Stephen Boyd wrote:\n\n> On Fri, May 1, 2009 at 2:06 AM, Felipe Contreras\n> <felipe.contreras@gmail.com> wrote:\n> >\n> > -       *argv = xmalloc(sizeof(char*) * size);\n> > +       *argv = xmalloc(sizeof(char *) * size);\n> >\n> \n> I don't think this is what the coding guidelines is talking about. A\n> pointer isn't being declared here plus there isn't any variable the\n> star should be sticking to.\n\nBesides that, don't we usually prefer sizeof() on the actual variable\ninstead of the type, which is less error prone? IOW,\n\n  *argv = xmalloc(sizeof(**argv) * size);\n\n-Peff\n"},{"id":"112846","messageId":"7vmy9wv49n.fsf@gitster.siamese.dyndns.org","threadId":"19144","inReplyTo":"1241168796-7222-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH] Fix a bunch of pointer declarations (codestyle)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-01T22:37:24Z","receivedAt":"2009-05-01T22:37:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> Essentially; s/type* /type */ as per the coding guidelines.\n\nNice.  The nicest part is that the resulting binary does not change with\nor without this patch ;-).\n"},{"id":"112849","messageId":"7veiv8v382.fsf@gitster.siamese.dyndns.org","threadId":"19144","inReplyTo":"20090501203910.GA15549@coredump.intra.peff.net","subject":"Re: [PATCH] Fix a bunch of pointer declarations (codestyle)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-01T22:59:57Z","receivedAt":"2009-05-01T22:59:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Fri, May 01, 2009 at 12:20:08PM -0700, Stephen Boyd wrote:\n>\n>> On Fri, May 1, 2009 at 2:06 AM, Felipe Contreras\n>> <felipe.contreras@gmail.com> wrote:\n>> >\n>> > -       *argv = xmalloc(sizeof(char*) * size);\n>> > +       *argv = xmalloc(sizeof(char *) * size);\n>> >\n>> \n>> I don't think this is what the coding guidelines is talking about. A\n>> pointer isn't being declared here plus there isn't any variable the\n>> star should be sticking to.\n\nI think either way is fine although I personally prefer the way the patch\ndid.  The \"prefer sizeof(var) over sizeof(type)\" principle is good, but\nthat should be a follow-up patch, as it is very likely such a conversion\nwill introduce a silly mistake, perhaps like this one.\n\n> Besides that, don't we usually prefer sizeof() on the actual variable\n> instead of the type, which is less error prone? IOW,\n>\n>   *argv = xmalloc(sizeof(**argv) * size);\n"}]}