summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 75b4406)
raw | patch | inline | side by side (parent: 75b4406)
author | Felipe Contreras <felipe.contreras@gmail.com> | |
Fri, 1 May 2009 09:06:36 +0000 (12:06 +0300) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 1 May 2009 22:17:31 +0000 (15:17 -0700) |
Essentially; s/type* /type */ as per the coding guidelines.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
25 files changed:
alias.c | patch | blob | history | |
alloc.c | patch | blob | history | |
attr.c | patch | blob | history | |
builtin-blame.c | patch | blob | history | |
builtin-checkout-index.c | patch | blob | history | |
builtin-describe.c | patch | blob | history | |
builtin-fetch-pack.c | patch | blob | history | |
builtin-help.c | patch | blob | history | |
builtin-update-index.c | patch | blob | history | |
cache.h | patch | blob | history | |
combine-diff.c | patch | blob | history | |
compat/mingw.c | patch | blob | history | |
config.c | patch | blob | history | |
contrib/convert-objects/convert-objects.c | patch | blob | history | |
diff-no-index.c | patch | blob | history | |
diff.c | patch | blob | history | |
dir.c | patch | blob | history | |
fast-import.c | patch | blob | history | |
git.c | patch | blob | history | |
lockfile.c | patch | blob | history | |
reflog-walk.c | patch | blob | history | |
run-command.c | patch | blob | history | |
server-info.c | patch | blob | history | |
sha1_file.c | patch | blob | history | |
wt-status.c | patch | blob | history |
index ccb1108c94436035d0da8b1d6f08f859b68294a3..e687fe54c1ce2a435e8f0d7806db231c06f998eb 100644 (file)
--- a/alias.c
+++ b/alias.c
int src, dst, count = 0, size = 16;
char quoted = 0;
- *argv = xmalloc(sizeof(char*) * size);
+ *argv = xmalloc(sizeof(char *) * size);
/* split alias_string */
(*argv)[count++] = cmdline;
; /* skip */
if (count >= size) {
size += 16;
- *argv = xrealloc(*argv, sizeof(char*) * size);
+ *argv = xrealloc(*argv, sizeof(char *) * size);
}
(*argv)[count++] = cmdline + dst;
} else if (!quoted && (c == '\'' || c == '"')) {
index 216c23a6f854c614d38c743cd7687a37f304161b..6ef6753d180afad29bc335854150c824b9de8a18 100644 (file)
--- a/alloc.c
+++ b/alloc.c
#define SZ_FMT "%zu"
#endif
-static void report(const char* name, unsigned int count, size_t size)
+static void report(const char *name, unsigned int count, size_t size)
{
fprintf(stderr, "%10s: %8u (" SZ_FMT " kB)\n", name, count, size);
}
index f1ca4f58599c14c98473f3638a3d0d6eed2aafaa..98eb636f13d314c20e18e646c074e2511b3c891c 100644 (file)
--- a/attr.c
+++ b/attr.c
if (is_macro)
res->u.attr = git_attr(name, namelen);
else {
- res->u.pattern = (char*)&(res->state[num_attr]);
+ res->u.pattern = (char *)&(res->state[num_attr]);
memcpy(res->u.pattern, name, namelen);
res->u.pattern[namelen] = 0;
}
setto == ATTR__UNKNOWN)
;
else
- free((char*) setto);
+ free((char *) setto);
}
free(a);
}
diff --git a/builtin-blame.c b/builtin-blame.c
index 83141fc84e22ad4852f255fa1ad453cc125a3255..cf74a926149668b7e67544aecd46a0e05d4f59d9 100644 (file)
--- a/builtin-blame.c
+++ b/builtin-blame.c
* Prepare mmfile that contains only the lines in ent.
*/
cp = nth_line(sb, ent->lno);
- file_o.ptr = (char*) cp;
+ file_o.ptr = (char *) cp;
cnt = ent->num_lines;
while (cnt && cp < sb->final_buf + sb->final_buf_size) {
while (len--) {
if (bol) {
sb->lineno = xrealloc(sb->lineno,
- sizeof(int* ) * (num + 1));
+ sizeof(int *) * (num + 1));
sb->lineno[num] = buf - sb->final_buf;
bol = 0;
}
}
}
sb->lineno = xrealloc(sb->lineno,
- sizeof(int* ) * (num + incomplete + 1));
+ sizeof(int *) * (num + incomplete + 1));
sb->lineno[num + incomplete] = buf - sb->final_buf;
sb->num_lines = num + incomplete;
return sb->num_lines;
return spec;
/* it could be a regexp of form /.../ */
- for (term = (char*) spec + 1; *term && *term != '/'; term++) {
+ for (term = (char *) spec + 1; *term && *term != '/'; term++) {
if (*term == '\\')
term++;
}
index 0d534bc023a1a3367bdf19f6450ce17e627959f0..afe35e246c5ab2b262683308def787c6abce2a83 100644 (file)
--- a/builtin-checkout-index.c
+++ b/builtin-checkout-index.c
static void checkout_all(const char *prefix, int prefix_length)
{
int i, errs = 0;
- struct cache_entry* last_ce = NULL;
+ struct cache_entry *last_ce = NULL;
for (i = 0; i < active_nr ; i++) {
struct cache_entry *ce = active_cache[i];
p = prefix_path(prefix, prefix_length, arg);
checkout_file(p, prefix_length);
if (p < arg || p > arg + strlen(arg))
- free((char*)p);
+ free((char *)p);
}
if (read_from_stdin) {
diff --git a/builtin-describe.c b/builtin-describe.c
index 3a007ed1cafcab82f466d355b63e416b06eb8864..63c6a19da5b38bc7c00c624c080ba0afbb10ff8a 100644 (file)
--- a/builtin-describe.c
+++ b/builtin-describe.c
die("--long is incompatible with --abbrev=0");
if (contains) {
- const char **args = xmalloc((7 + argc) * sizeof(char*));
+ const char **args = xmalloc((7 + argc) * sizeof(char *));
int i = 0;
args[i++] = "name-rev";
args[i++] = "--name-only";
args[i++] = s;
}
}
- memcpy(args + i, argv, argc * sizeof(char*));
+ memcpy(args + i, argv, argc * sizeof(char *));
args[i + argc] = NULL;
return cmd_name_rev(i + argc, args, prefix);
}
diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c
index 5d134be47c85019dd66aed742eb845f6245cbf4d..cbe5f206f5baab9868bc70028262aee611fba3f9 100644 (file)
--- a/builtin-fetch-pack.c
+++ b/builtin-fetch-pack.c
Get the next rev to send, ignoring the common.
*/
-static const unsigned char* get_rev(void)
+static const unsigned char *get_rev(void)
{
struct commit *commit = NULL;
diff --git a/builtin-help.c b/builtin-help.c
index e7fbe9af633d23fa55b14751190e6dd5d9e5d762..67dda3e6e63c9130a6f1e1c94cb35e519d765a95 100644 (file)
--- a/builtin-help.c
+++ b/builtin-help.c
return 0;
}
-static void exec_woman_emacs(const char* path, const char *page)
+static void exec_woman_emacs(const char *path, const char *page)
{
if (!check_emacsclient_version()) {
/* This works only with emacsclient version >= 22. */
}
}
-static void exec_man_konqueror(const char* path, const char *page)
+static void exec_man_konqueror(const char *path, const char *page)
{
const char *display = getenv("DISPLAY");
if (display && *display) {
}
}
-static void exec_man_man(const char* path, const char *page)
+static void exec_man_man(const char *path, const char *page)
{
if (!path)
path = "man";
diff --git a/builtin-update-index.c b/builtin-update-index.c
index 1fde893cfa9f6318ae1e9958b2f61159b01c7c6a..92beaaf4b3ca5520a9af27bde7f15dda46d80197 100644 (file)
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
report("add '%s'", path);
free_return:
if (p < path || p > path + strlen(path))
- free((char*)p);
+ free((char *)p);
}
static void read_index_info(int line_termination)
const char *p = prefix_path(prefix, prefix_length, arg);
err |= unresolve_one(p);
if (p < arg || p > arg + strlen(arg))
- free((char*)p);
+ free((char *)p);
}
return err;
}
if (set_executable_bit)
chmod_path(set_executable_bit, p);
if (p < path || p > path + strlen(path))
- free((char*)p);
+ free((char *)p);
}
if (read_from_stdin) {
struct strbuf buf = STRBUF_INIT, nbuf = STRBUF_INIT;
index d0d48b4c88b8f359be7c271dbe7ef8f816999960..b8503ad91c3b13ccaf87a6f596d13918f7ae114b 100644 (file)
--- a/cache.h
+++ b/cache.h
extern void pack_report(void);
extern int open_pack_index(struct packed_git *);
-extern unsigned char* use_pack(struct packed_git *, struct pack_window **, off_t, unsigned int *);
+extern unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, unsigned int *);
extern void close_pack_windows(struct packed_git *);
extern void unuse_pack(struct pack_window **);
extern void free_pack_by_name(const char *);
diff --git a/combine-diff.c b/combine-diff.c
index d210656861dcd6568e1228f39dff042ab374a584..60d03676bbd0dba7be79c7098d7cae553962ca98 100644 (file)
--- a/combine-diff.c
+++ b/combine-diff.c
path = q->queue[i]->two->path;
len = strlen(path);
p = xmalloc(combine_diff_path_size(num_parent, len));
- p->path = (char*) &(p->parent[num_parent]);
+ p->path = (char *) &(p->parent[num_parent]);
memcpy(p->path, path, len);
p->path[len] = 0;
p->len = len;
for (parents = commit->parents, num_parent = 0;
parents;
parents = parents->next, num_parent++)
- hashcpy((unsigned char*)(parent + num_parent),
+ hashcpy((unsigned char *)(parent + num_parent),
parents->item->object.sha1);
diff_tree_combined(sha1, parent, num_parent, dense, rev);
}
diff --git a/compat/mingw.c b/compat/mingw.c
index 2a047019e819740b0208bcaa9c18999c68d1c89c..cdeda1d9859fd545950e0c39ee7de3c9dc09bb07 100644 (file)
--- a/compat/mingw.c
+++ b/compat/mingw.c
if (!n)
return NULL;
- path = xmalloc((n+1)*sizeof(char*));
+ path = xmalloc((n+1)*sizeof(char *));
p = envpath;
i = 0;
do {
diff --git a/config.c b/config.c
index f76a78311e50310c02ebb30e3fc8b211ee41e562..1682273c12ab042d73fa32caf30d18fb13ef85e3 100644 (file)
--- a/config.c
+++ b/config.c
static struct {
int baselen;
- char* key;
+ char *key;
int do_not_match;
- regex_t* value_regex;
+ regex_t *value_regex;
int multi_replace;
size_t offset[MAX_MATCHES];
enum { START, SECTION_SEEN, SECTION_END_SEEN, KEY_SEEN } state;
int seen;
} store;
-static int matches(const char* key, const char* value)
+static int matches(const char *key, const char *value)
{
return !strcmp(key, store.key) &&
(store.value_regex == NULL ||
!regexec(store.value_regex, value, 0, NULL, 0)));
}
-static int store_aux(const char* key, const char* value, void *cb)
+static int store_aux(const char *key, const char *value, void *cb)
{
const char *ep;
size_t section_len;
return 4;
}
-static int store_write_section(int fd, const char* key)
+static int store_write_section(int fd, const char *key)
{
const char *dot;
int i, success;
return success;
}
-static int store_write_pair(int fd, const char* key, const char* value)
+static int store_write_pair(int fd, const char *key, const char *value)
{
int i, success;
int length = strlen(key + store.baselen + 1);
return success;
}
-static ssize_t find_beginning_of_line(const char* contents, size_t size,
- size_t offset_, int* found_bracket)
+static ssize_t find_beginning_of_line(const char *contents, size_t size,
+ size_t offset_, int *found_bracket)
{
size_t equal_offset = size, bracket_offset = size;
ssize_t offset;
return offset;
}
-int git_config_set(const char* key, const char* value)
+int git_config_set(const char *key, const char *value)
{
return git_config_set_multivar(key, value, NULL, 0);
}
* - the config file is removed and the lock file rename()d to it.
*
*/
-int git_config_set_multivar(const char* key, const char* value,
- const char* value_regex, int multi_replace)
+int git_config_set_multivar(const char *key, const char *value,
+ const char *value_regex, int multi_replace)
{
int i, dot;
int fd = -1, in_fd;
int ret;
- char* config_filename;
+ char *config_filename;
struct lock_file *lock = NULL;
- const char* last_dot = strrchr(key, '.');
+ const char *last_dot = strrchr(key, '.');
if (config_exclusive_filename)
config_filename = xstrdup(config_exclusive_filename);
goto out_free;
}
- store.key = (char*)key;
+ store.key = (char *)key;
if (!store_write_section(fd, key) ||
!store_write_pair(fd, key, value))
goto write_err_out;
} else {
struct stat st;
- char* contents;
+ char *contents;
size_t contents_sz, copy_begin, copy_end;
int i, new_line = 0;
index 90e7900e6d7aff2fadf9ba04f8d982733493411c..f3b57bf1d21e8256bf084076e50cbc9ff84a1ee8 100644 (file)
struct entry *entry;
if (get_sha1_hex(buffer, sha1))
- die("expected sha1, got '%s'", (char*) buffer);
+ die("expected sha1, got '%s'", (char *) buffer);
entry = convert_entry(sha1);
memcpy(buffer, sha1_to_hex(entry->new_sha1), 40);
}
@@ -100,7 +100,7 @@ static int write_subdirectory(void *buffer, unsigned long size, const char *base
if (!slash) {
newlen += sprintf(new + newlen, "%o %s", mode, path);
new[newlen++] = '\0';
- hashcpy((unsigned char*)new + newlen, (unsigned char *) buffer + len - 20);
+ hashcpy((unsigned char *)new + newlen, (unsigned char *) buffer + len - 20);
newlen += 20;
used += len;
@@ -271,7 +271,7 @@ static void convert_commit(void *buffer, unsigned long size, unsigned char *resu
unsigned long orig_size = size;
if (memcmp(buffer, "tree ", 5))
- die("Bad commit '%s'", (char*) buffer);
+ die("Bad commit '%s'", (char *) buffer);
convert_ascii_sha1((char *) buffer + 5);
buffer = (char *) buffer + 46; /* "tree " + "hex sha1" + "\n" */
while (!memcmp(buffer, "parent ", 7)) {
diff --git a/diff-no-index.c b/diff-no-index.c
index 42c1dd8ad3b0633767bf577975a895722f882565..4ebc1dbd87d9b90ad2aaa5c7d4601761e2d1d724 100644 (file)
--- a/diff-no-index.c
+++ b/diff-no-index.c
if (prefix) {
int len = strlen(prefix);
- revs->diffopt.paths = xcalloc(2, sizeof(char*));
+ revs->diffopt.paths = xcalloc(2, sizeof(char *));
for (i = 0; i < 2; i++) {
const char *p = argv[argc - 2 + i];
/*
index 3ac71686ebef3d3f9c8b0b72adf612e9535031a5..363dcb9613f5f57a2ae31ea6f803caf44954475a 100644 (file)
--- a/diff.c
+++ b/diff.c
file->print_name = pname;
}
-static void show_stats(struct diffstat_t* data, struct diff_options *options)
+static void show_stats(struct diffstat_t *data, struct diff_options *options)
{
int i, len, add, del, adds = 0, dels = 0;
int max_change = 0, max_len = 0;
@@ -1025,7 +1025,7 @@ static void show_shortstats(struct diffstat_t* data, struct diff_options *option
total_files, adds, dels);
}
-static void show_numstat(struct diffstat_t* data, struct diff_options *options)
+static void show_numstat(struct diffstat_t *data, struct diff_options *options)
{
int i;
index c91ebfb46f929f926e1925c2db830c5847f3223b..15677da47c9dfc6bcb8f7f0b06bed16cf6f723ae 100644 (file)
--- a/dir.c
+++ b/dir.c
if (len && string[len - 1] == '/') {
char *s;
x = xmalloc(sizeof(*x) + len);
- s = (char*)(x+1);
+ s = (char *)(x+1);
memcpy(s, string, len - 1);
s[len - 1] = '\0';
string = s;
diff --git a/fast-import.c b/fast-import.c
index 8d959af3b2346a03f737c47d6dd000dfd917f69d..e9d23ffb2fb3f6df141944dca7ddab0edbd1e5ee 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
struct tree_entry
{
struct tree_content *tree;
- struct atom_str* name;
+ struct atom_str *name;
struct tree_entry_ms
{
uint16_t mode;
static struct object_entry_pool *blocks;
static struct object_entry *object_table[1 << 16];
static struct mark_set *marks;
-static const char* mark_file;
+static const char *mark_file;
/* Our last blob */
static struct last_object last_blob = { STRBUF_INIT, 0, 0, 0 };
static struct branch *new_branch(const char *name)
{
unsigned int hc = hc_str(name, strlen(name)) % branch_table_sz;
- struct branch* b = lookup_branch(name);
+ struct branch *b = lookup_branch(name);
if (b)
die("Invalid attempt to create duplicate branch: %s", name);
git_SHA_CTX c;
z_stream s;
- hdrlen = sprintf((char*)hdr,"%s %lu", typename(type),
+ hdrlen = sprintf((char *)hdr,"%s %lu", typename(type),
(unsigned long)dat->len) + 1;
git_SHA1_Init(&c);
git_SHA1_Update(&c, hdr, hdrlen);
static void load_tree(struct tree_entry *root)
{
- unsigned char* sha1 = root->versions[1].sha1;
+ unsigned char *sha1 = root->versions[1].sha1;
struct object_entry *myoe;
struct tree_content *t;
unsigned long size;
e->versions[0].mode = e->versions[1].mode;
e->name = to_atom(c, strlen(c));
c += e->name->str_len + 1;
- hashcpy(e->versions[0].sha1, (unsigned char*)c);
- hashcpy(e->versions[1].sha1, (unsigned char*)c);
+ hashcpy(e->versions[0].sha1, (unsigned char *)c);
+ hashcpy(e->versions[1].sha1, (unsigned char *)c);
c += 20;
}
free(buf);
index cc5aaa76f10021018fd5a5ea84ae9912d3633b69..5a00726d09a13d5f70ab0378e02bbbd299124d5c 100644 (file)
--- a/git.c
+++ b/git.c
}
}
-static int handle_options(const char*** argv, int* argc, int* envchanged)
+static int handle_options(const char ***argv, int *argc, int *envchanged)
{
int handled = 0;
int envchanged = 0, ret = 0, saved_errno = errno;
const char *subdir;
int count, option_count;
- const char** new_argv;
+ const char **new_argv;
const char *alias_command;
char *alias_string;
int unused_nongit;
"trace: alias expansion: %s =>",
alias_command);
- new_argv = xrealloc(new_argv, sizeof(char*) *
+ new_argv = xrealloc(new_argv, sizeof(char *) *
(count + *argcp + 1));
/* insert after command name */
- memcpy(new_argv + count, *argv + 1, sizeof(char*) * *argcp);
+ memcpy(new_argv + count, *argv + 1, sizeof(char *) * *argcp);
new_argv[count+*argcp] = NULL;
*argv = new_argv;
diff --git a/lockfile.c b/lockfile.c
index 3dbb2d1ff9407a7417be294adedc5312e7421a96..828d19f452a8bfffe2ee224a630e8246f4a1edab 100644 (file)
--- a/lockfile.c
+++ b/lockfile.c
* link is a relative path, so I must replace the
* last element of p with it.
*/
- char *r = (char*)last_path_elm(p);
+ char *r = (char *)last_path_elm(p);
if (r - p + link_len < s)
strcpy(r, link);
else {
diff --git a/reflog-walk.c b/reflog-walk.c
index fd065f4e1a689176a3f3255b2d88270bce094ff0..5623ea6b48a2f355e8866eabb2805b51b4127a4a 100644 (file)
--- a/reflog-walk.c
+++ b/reflog-walk.c
commit->object.flags &= ~(ADDED | SEEN | SHOWN);
}
-void show_reflog_message(struct reflog_walk_info* info, int oneline,
+void show_reflog_message(struct reflog_walk_info *info, int oneline,
enum date_mode dmode)
{
if (info && info->last_commit_reflog) {
diff --git a/run-command.c b/run-command.c
index b05c734d05e99cd009a0df26f0fc95fa13ae6f25..eb2efc33073512efd14b65e67db8cf814ca3fa33 100644 (file)
--- a/run-command.c
+++ b/run-command.c
if (cmd->env) {
for (; *cmd->env; cmd->env++) {
if (strchr(*cmd->env, '='))
- putenv((char*)*cmd->env);
+ putenv((char *)*cmd->env);
else
unsetenv(*cmd->env);
}
diff --git a/server-info.c b/server-info.c
index 66b0d9d878a011393582b837301eb1fd5caf2e40..906ce5b27242ca1e415a5410135d58f1c000e8b0 100644 (file)
--- a/server-info.c
+++ b/server-info.c
static int compare_info(const void *a_, const void *b_)
{
- struct pack_info * const* a = a_;
- struct pack_info * const* b = b_;
+ struct pack_info *const *a = a_;
+ struct pack_info *const *b = b_;
if (0 <= (*a)->old_num && 0 <= (*b)->old_num)
/* Keep the order in the original */
diff --git a/sha1_file.c b/sha1_file.c
index f708cf4f674fdf393044d6c36c7d97f1fa7dcd0c..28bd9082fc9f4b79519f6bef8204600072c07027 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
&& (offset + 20) <= (win_off + win->len);
}
-unsigned char* use_pack(struct packed_git *p,
+unsigned char *use_pack(struct packed_git *p,
struct pack_window **w_cursor,
off_t offset,
unsigned int *left)
diff --git a/wt-status.c b/wt-status.c
index 929b00f59285c21a07df98700c23171505f5cddb..1b6df45450c39c0f456df68485b5735950816ac8 100644 (file)
--- a/wt-status.c
+++ b/wt-status.c
die("bad config variable '%s'", var);
}
-static const char* color(int slot)
+static const char *color(int slot)
{
return wt_status_use_color > 0 ? wt_status_colors[slot] : "";
}