Skip to content

Commit ccba7eb

Browse files
committed
global: make 'char *path' const where possible
Signed-off-by: Christian Hesse <[email protected]>
1 parent 54c407a commit ccba7eb

9 files changed

+10
-10
lines changed

ui-atom.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static void add_entry(struct commit *commit, const char *host)
8383
}
8484

8585

86-
void cgit_print_atom(char *tip, char *path, int max_count)
86+
void cgit_print_atom(char *tip, const char *path, int max_count)
8787
{
8888
char *host;
8989
const char *argv[] = {NULL, tip, NULL, NULL, NULL};

ui-atom.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef UI_ATOM_H
22
#define UI_ATOM_H
33

4-
extern void cgit_print_atom(char *tip, char *path, int max_count);
4+
extern void cgit_print_atom(char *tip, const char *path, int max_count);
55

66
#endif

ui-log.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ static char *next_token(char **src)
362362
}
363363

364364
void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern,
365-
char *path, int pager, int commit_graph, int commit_sort)
365+
const char *path, int pager, int commit_graph, int commit_sort)
366366
{
367367
struct rev_info rev;
368368
struct commit *commit;

ui-log.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define UI_LOG_H
33

44
extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep,
5-
char *pattern, char *path, int pager,
5+
char *pattern, const char *path, int pager,
66
int commit_graph, int commit_sort);
77
extern void show_commit_decorations(struct commit *commit);
88

ui-refs.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static int print_tag(struct refinfo *ref)
136136
return 0;
137137
}
138138

139-
static void print_refs_link(char *path)
139+
static void print_refs_link(const char *path)
140140
{
141141
html("<tr class='nohover'><td colspan='5'>");
142142
cgit_refs_link("[...]", NULL, NULL, ctx.qry.head, NULL, path);

ui-repolist.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "html.h"
1212
#include "ui-shared.h"
1313

14-
static time_t read_agefile(char *path)
14+
static time_t read_agefile(const char *path)
1515
{
1616
time_t result;
1717
size_t size;

ui-summary.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static char* append_readme_path(const char *filename, const char *ref, const cha
9999
return full_path;
100100
}
101101

102-
void cgit_print_repo_readme(char *path)
102+
void cgit_print_repo_readme(const char *path)
103103
{
104104
char *filename, *ref, *mimetype;
105105
int free_filename = 0;

ui-summary.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
#define UI_SUMMARY_H
33

44
extern void cgit_print_summary(void);
5-
extern void cgit_print_repo_readme(char *path);
5+
extern void cgit_print_repo_readme(const char *path);
66

77
#endif /* UI_SUMMARY_H */

ui-tree.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static void print_binary_buffer(char *buf, unsigned long size)
8484
html("</table>\n");
8585
}
8686

87-
static void print_object(const struct object_id *oid, char *path, const char *basename, const char *rev)
87+
static void print_object(const struct object_id *oid, const char *path, const char *basename, const char *rev)
8888
{
8989
enum object_type type;
9090
char *buf;
@@ -279,7 +279,7 @@ static void ls_tail(void)
279279
cgit_print_layout_end();
280280
}
281281

282-
static void ls_tree(const struct object_id *oid, char *path, struct walk_tree_context *walk_tree_ctx)
282+
static void ls_tree(const struct object_id *oid, const char *path, struct walk_tree_context *walk_tree_ctx)
283283
{
284284
struct tree *tree;
285285
struct pathspec paths = {

0 commit comments

Comments
 (0)