Skip to content

Commit 4b25d09

Browse files
felipecgitster
authored andcommitted
Fix a bunch of pointer declarations (codestyle)
Essentially; s/type* /type */ as per the coding guidelines. Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 75b4406 commit 4b25d09

25 files changed

+64
-64
lines changed

alias.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int split_cmdline(char *cmdline, const char ***argv)
2727
int src, dst, count = 0, size = 16;
2828
char quoted = 0;
2929

30-
*argv = xmalloc(sizeof(char*) * size);
30+
*argv = xmalloc(sizeof(char *) * size);
3131

3232
/* split alias_string */
3333
(*argv)[count++] = cmdline;
@@ -40,7 +40,7 @@ int split_cmdline(char *cmdline, const char ***argv)
4040
; /* skip */
4141
if (count >= size) {
4242
size += 16;
43-
*argv = xrealloc(*argv, sizeof(char*) * size);
43+
*argv = xrealloc(*argv, sizeof(char *) * size);
4444
}
4545
(*argv)[count++] = cmdline + dst;
4646
} else if (!quoted && (c == '\'' || c == '"')) {

alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ DEFINE_ALLOCATOR(object, union any_object)
5757
#define SZ_FMT "%zu"
5858
#endif
5959

60-
static void report(const char* name, unsigned int count, size_t size)
60+
static void report(const char *name, unsigned int count, size_t size)
6161
{
6262
fprintf(stderr, "%10s: %8u (" SZ_FMT " kB)\n", name, count, size);
6363
}

attr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static struct match_attr *parse_attr_line(const char *line, const char *src,
224224
if (is_macro)
225225
res->u.attr = git_attr(name, namelen);
226226
else {
227-
res->u.pattern = (char*)&(res->state[num_attr]);
227+
res->u.pattern = (char *)&(res->state[num_attr]);
228228
memcpy(res->u.pattern, name, namelen);
229229
res->u.pattern[namelen] = 0;
230230
}
@@ -275,7 +275,7 @@ static void free_attr_elem(struct attr_stack *e)
275275
setto == ATTR__UNKNOWN)
276276
;
277277
else
278-
free((char*) setto);
278+
free((char *) setto);
279279
}
280280
free(a);
281281
}

builtin-blame.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ static void find_copy_in_blob(struct scoreboard *sb,
873873
* Prepare mmfile that contains only the lines in ent.
874874
*/
875875
cp = nth_line(sb, ent->lno);
876-
file_o.ptr = (char*) cp;
876+
file_o.ptr = (char *) cp;
877877
cnt = ent->num_lines;
878878

879879
while (cnt && cp < sb->final_buf + sb->final_buf_size) {
@@ -1704,7 +1704,7 @@ static int prepare_lines(struct scoreboard *sb)
17041704
while (len--) {
17051705
if (bol) {
17061706
sb->lineno = xrealloc(sb->lineno,
1707-
sizeof(int* ) * (num + 1));
1707+
sizeof(int *) * (num + 1));
17081708
sb->lineno[num] = buf - sb->final_buf;
17091709
bol = 0;
17101710
}
@@ -1714,7 +1714,7 @@ static int prepare_lines(struct scoreboard *sb)
17141714
}
17151715
}
17161716
sb->lineno = xrealloc(sb->lineno,
1717-
sizeof(int* ) * (num + incomplete + 1));
1717+
sizeof(int *) * (num + incomplete + 1));
17181718
sb->lineno[num + incomplete] = buf - sb->final_buf;
17191719
sb->num_lines = num + incomplete;
17201720
return sb->num_lines;
@@ -1889,7 +1889,7 @@ static const char *parse_loc(const char *spec,
18891889
return spec;
18901890

18911891
/* it could be a regexp of form /.../ */
1892-
for (term = (char*) spec + 1; *term && *term != '/'; term++) {
1892+
for (term = (char *) spec + 1; *term && *term != '/'; term++) {
18931893
if (*term == '\\')
18941894
term++;
18951895
}

builtin-checkout-index.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static int checkout_file(const char *name, int prefix_length)
124124
static void checkout_all(const char *prefix, int prefix_length)
125125
{
126126
int i, errs = 0;
127-
struct cache_entry* last_ce = NULL;
127+
struct cache_entry *last_ce = NULL;
128128

129129
for (i = 0; i < active_nr ; i++) {
130130
struct cache_entry *ce = active_cache[i];
@@ -278,7 +278,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
278278
p = prefix_path(prefix, prefix_length, arg);
279279
checkout_file(p, prefix_length);
280280
if (p < arg || p > arg + strlen(arg))
281-
free((char*)p);
281+
free((char *)p);
282282
}
283283

284284
if (read_from_stdin) {

builtin-describe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
334334
die("--long is incompatible with --abbrev=0");
335335

336336
if (contains) {
337-
const char **args = xmalloc((7 + argc) * sizeof(char*));
337+
const char **args = xmalloc((7 + argc) * sizeof(char *));
338338
int i = 0;
339339
args[i++] = "name-rev";
340340
args[i++] = "--name-only";
@@ -349,7 +349,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
349349
args[i++] = s;
350350
}
351351
}
352-
memcpy(args + i, argv, argc * sizeof(char*));
352+
memcpy(args + i, argv, argc * sizeof(char *));
353353
args[i + argc] = NULL;
354354
return cmd_name_rev(i + argc, args, prefix);
355355
}

builtin-fetch-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static void mark_common(struct commit *commit,
111111
Get the next rev to send, ignoring the common.
112112
*/
113113

114-
static const unsigned char* get_rev(void)
114+
static const unsigned char *get_rev(void)
115115
{
116116
struct commit *commit = NULL;
117117

builtin-help.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static int check_emacsclient_version(void)
114114
return 0;
115115
}
116116

117-
static void exec_woman_emacs(const char* path, const char *page)
117+
static void exec_woman_emacs(const char *path, const char *page)
118118
{
119119
if (!check_emacsclient_version()) {
120120
/* This works only with emacsclient version >= 22. */
@@ -128,7 +128,7 @@ static void exec_woman_emacs(const char* path, const char *page)
128128
}
129129
}
130130

131-
static void exec_man_konqueror(const char* path, const char *page)
131+
static void exec_man_konqueror(const char *path, const char *page)
132132
{
133133
const char *display = getenv("DISPLAY");
134134
if (display && *display) {
@@ -156,7 +156,7 @@ static void exec_man_konqueror(const char* path, const char *page)
156156
}
157157
}
158158

159-
static void exec_man_man(const char* path, const char *page)
159+
static void exec_man_man(const char *path, const char *page)
160160
{
161161
if (!path)
162162
path = "man";

builtin-update-index.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ static void update_one(const char *path, const char *prefix, int prefix_length)
292292
report("add '%s'", path);
293293
free_return:
294294
if (p < path || p > path + strlen(path))
295-
free((char*)p);
295+
free((char *)p);
296296
}
297297

298298
static void read_index_info(int line_termination)
@@ -509,7 +509,7 @@ static int do_unresolve(int ac, const char **av,
509509
const char *p = prefix_path(prefix, prefix_length, arg);
510510
err |= unresolve_one(p);
511511
if (p < arg || p > arg + strlen(arg))
512-
free((char*)p);
512+
free((char *)p);
513513
}
514514
return err;
515515
}
@@ -712,7 +712,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
712712
if (set_executable_bit)
713713
chmod_path(set_executable_bit, p);
714714
if (p < path || p > path + strlen(path))
715-
free((char*)p);
715+
free((char *)p);
716716
}
717717
if (read_from_stdin) {
718718
struct strbuf buf = STRBUF_INIT, nbuf = STRBUF_INIT;

cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
846846

847847
extern void pack_report(void);
848848
extern int open_pack_index(struct packed_git *);
849-
extern unsigned char* use_pack(struct packed_git *, struct pack_window **, off_t, unsigned int *);
849+
extern unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, unsigned int *);
850850
extern void close_pack_windows(struct packed_git *);
851851
extern void unuse_pack(struct pack_window **);
852852
extern void free_pack_by_name(const char *);

0 commit comments

Comments
 (0)