List for cgit developers and users
 help / color / Atom feed
* [PATCH 1/1] global: male 'char *path' const where possible
@ 2019-01-02 16:25 list
  2019-01-02 16:57 ` Jason
  0 siblings, 1 reply; 5+ messages in thread
From: list @ 2019-01-02 16:25 UTC (permalink / raw)


From: Christian Hesse <mail at eworm.de>

Signed-off-by: Christian Hesse <mail at eworm.de>
---
 ui-atom.c     | 2 +-
 ui-atom.h     | 2 +-
 ui-log.c      | 2 +-
 ui-log.h      | 2 +-
 ui-refs.c     | 2 +-
 ui-repolist.c | 2 +-
 ui-summary.c  | 2 +-
 ui-summary.h  | 2 +-
 ui-tree.c     | 4 ++--
 9 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/ui-atom.c b/ui-atom.c
index 3866823..cd66f82 100644
--- a/ui-atom.c
+++ b/ui-atom.c
@@ -83,7 +83,7 @@ static void add_entry(struct commit *commit, const char *host)
 }
 
 
-void cgit_print_atom(char *tip, char *path, int max_count)
+void cgit_print_atom(char *tip, const char *path, int max_count)
 {
 	char *host;
 	const char *argv[] = {NULL, tip, NULL, NULL, NULL};
diff --git a/ui-atom.h b/ui-atom.h
index 749ffd3..dda953b 100644
--- a/ui-atom.h
+++ b/ui-atom.h
@@ -1,6 +1,6 @@
 #ifndef UI_ATOM_H
 #define UI_ATOM_H
 
-extern void cgit_print_atom(char *tip, char *path, int max_count);
+extern void cgit_print_atom(char *tip, const char *path, int max_count);
 
 #endif
diff --git a/ui-log.c b/ui-log.c
index 3bcb657..8c65425 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -362,7 +362,7 @@ static char *next_token(char **src)
 }
 
 void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern,
-		    char *path, int pager, int commit_graph, int commit_sort)
+		    const char *path, int pager, int commit_graph, int commit_sort)
 {
 	struct rev_info rev;
 	struct commit *commit;
diff --git a/ui-log.h b/ui-log.h
index d324c92..325607c 100644
--- a/ui-log.h
+++ b/ui-log.h
@@ -2,7 +2,7 @@
 #define UI_LOG_H
 
 extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep,
-			   char *pattern, char *path, int pager,
+			   char *pattern, const char *path, int pager,
 			   int commit_graph, int commit_sort);
 extern void show_commit_decorations(struct commit *commit);
 
diff --git a/ui-refs.c b/ui-refs.c
index 2ec3858..456f610 100644
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -136,7 +136,7 @@ static int print_tag(struct refinfo *ref)
 	return 0;
 }
 
-static void print_refs_link(char *path)
+static void print_refs_link(const char *path)
 {
 	html("<tr class='nohover'><td colspan='5'>");
 	cgit_refs_link("[...]", NULL, NULL, ctx.qry.head, NULL, path);
diff --git a/ui-repolist.c b/ui-repolist.c
index 41424c0..7cf7638 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -11,7 +11,7 @@
 #include "html.h"
 #include "ui-shared.h"
 
-static time_t read_agefile(char *path)
+static time_t read_agefile(const char *path)
 {
 	time_t result;
 	size_t size;
diff --git a/ui-summary.c b/ui-summary.c
index 8e81ac4..947812a 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -99,7 +99,7 @@ static char* append_readme_path(const char *filename, const char *ref, const cha
 	return full_path;
 }
 
-void cgit_print_repo_readme(char *path)
+void cgit_print_repo_readme(const char *path)
 {
 	char *filename, *ref, *mimetype;
 	int free_filename = 0;
diff --git a/ui-summary.h b/ui-summary.h
index 0896650..cba696a 100644
--- a/ui-summary.h
+++ b/ui-summary.h
@@ -2,6 +2,6 @@
 #define UI_SUMMARY_H
 
 extern void cgit_print_summary(void);
-extern void cgit_print_repo_readme(char *path);
+extern void cgit_print_repo_readme(const char *path);
 
 #endif /* UI_SUMMARY_H */
diff --git a/ui-tree.c b/ui-tree.c
index df8ad82..314ac52 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -84,7 +84,7 @@ static void print_binary_buffer(char *buf, unsigned long size)
 	html("</table>\n");
 }
 
-static void print_object(const struct object_id *oid, char *path, const char *basename, const char *rev)
+static void print_object(const struct object_id *oid, const char *path, const char *basename, const char *rev)
 {
 	enum object_type type;
 	char *buf;
@@ -279,7 +279,7 @@ static void ls_tail(void)
 	cgit_print_layout_end();
 }
 
-static void ls_tree(const struct object_id *oid, char *path, struct walk_tree_context *walk_tree_ctx)
+static void ls_tree(const struct object_id *oid, const char *path, struct walk_tree_context *walk_tree_ctx)
 {
 	struct tree *tree;
 	struct pathspec paths = {


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] global: male 'char *path' const where possible
  2019-01-02 16:25 [PATCH 1/1] global: male 'char *path' const where possible list
@ 2019-01-02 16:57 ` Jason
  2019-01-02 19:44   ` list
  0 siblings, 1 reply; 5+ messages in thread
From: Jason @ 2019-01-02 16:57 UTC (permalink / raw)


Seems reasonable. Queue it up.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] global: male 'char *path' const where possible
  2019-01-02 16:57 ` Jason
@ 2019-01-02 19:44   ` list
  2019-01-02 23:14     ` jamie.couture
  0 siblings, 1 reply; 5+ messages in thread
From: list @ 2019-01-02 19:44 UTC (permalink / raw)


"Jason A. Donenfeld" <Jason at zx2c4.com> on Wed, 2019/01/02 17:57:
> Seems reasonable. Queue it up.

Done.
I stumbled upon this, probably there's a lot more to become const.
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20190102/821a64e2/attachment.asc>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] global: male 'char *path' const where possible
  2019-01-02 19:44   ` list
@ 2019-01-02 23:14     ` jamie.couture
  2019-01-03  7:11       ` list
  0 siblings, 1 reply; 5+ messages in thread
From: jamie.couture @ 2019-01-02 23:14 UTC (permalink / raw)


s/male/make/

Perhaps?

On Wed, Jan 2, 2019 at 2:45 PM Christian Hesse <list at eworm.de> wrote:

> "Jason A. Donenfeld" <Jason at zx2c4.com> on Wed, 2019/01/02 17:57:
> > Seems reasonable. Queue it up.
>
> Done.
> I stumbled upon this, probably there's a lot more to become const.
> --
> main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
> "CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
> putchar(b-1/(/*    Chris            cc -ox -xc - && ./x
> */b/42*2-3)*42);}
> _______________________________________________
> CGit mailing list
> CGit at lists.zx2c4.com
> https://lists.zx2c4.com/mailman/listinfo/cgit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20190102/9f9fcd79/attachment.html>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] global: male 'char *path' const where possible
  2019-01-02 23:14     ` jamie.couture
@ 2019-01-03  7:11       ` list
  0 siblings, 0 replies; 5+ messages in thread
From: list @ 2019-01-03  7:11 UTC (permalink / raw)


Jamie Couture <jamie.couture at gmail.com> on Wed, 2019/01/02 18:14:
> s/male/make/
> 
> Perhaps?

Sure... Thanks!
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20190103/39edd342/attachment-0001.asc>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-02 16:25 [PATCH 1/1] global: male 'char *path' const where possible list
2019-01-02 16:57 ` Jason
2019-01-02 19:44   ` list
2019-01-02 23:14     ` jamie.couture
2019-01-03  7:11       ` list

List for cgit developers and users

Archives are clonable: git clone --mirror http://inbox.vuxu.org/cgit

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.cgit


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git