diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Trim the comments and dead code across the tree
Diffstat (limited to 'source/shared.c')
-rw-r--r--source/shared.c24
1 file changed, 9 insertions, 15 deletions
diff --git a/source/shared.c b/source/shared.c
index 00d5605..fab5c13 100644
--- a/source/shared.c
+++ b/source/shared.c
@@ -89,9 +89,8 @@ static int load_mmfile(mmfile_t *file, const struct object_id *oid)
}
/*
- * The test is on the oid rather than on the size, because load_mmfile uses a
- * literal only for a null oid, and a real blob that happens to be empty does
- * own its buffer.
+ * The test is on the oid rather than the size, because load_mmfile uses a
+ * literal only for a null oid, while a real but empty blob owns its buffer.
*/
static void release_mmfile(mmfile_t *file, const struct object_id *oid)
{
@@ -101,9 +100,7 @@ static void release_mmfile(mmfile_t *file, const struct object_id *oid)
/*
* Xdiff emits buffers that need not end on a line boundary, so a trailing
- * fragment is held back and joined with whatever arrives next. Git's own
- * xdiff_outf keeps that fragment in a callback struct, which is not an option
- * here because priv already carries the caller's function.
+ * fragment is held back and joined with whatever arrives next.
*/
static int emit_line(void *priv, mmbuffer_t *mb, int nbuf)
{
@@ -138,9 +135,8 @@ static int emit_line(void *priv, mmbuffer_t *mb, int nbuf)
return 0;
}
-// Takes an unsigned char because a byte over 0x7f is negative in a plain
-// char wherever char is signed, and a negative one is not a value the ctype
-// tests are defined for.
+// Takes an unsigned char because a byte over 0x7f is negative where char
+// is signed, which the ctype tests are not defined for.
static int is_token_char(unsigned char c)
{
return isalnum(c) || c == '_';
@@ -466,9 +462,8 @@ void cgit_diff_commit(struct commit *commit, filepair_fn fn, const char *prefix)
}
/*
- * Git's parse_date_format dies on anything it does not recognize, which would
- * turn a typo in cgitrc into a failed request, so only the formats cgit
- * documents reach it.
+ * Git's parse_date_format dies on anything unknown, which would turn a
+ * cgitrc typo into a failed request, so only documented formats reach it.
*/
void cgit_parse_date_format(const char *format, struct date_mode *mode)
{
@@ -578,9 +573,8 @@ char *cgit_expand_macros(const char *text)
out = expand_macro(start, limit - start) - 1;
}
start = NULL;
- // Step back so the character that ended the
- // token is written again past the expansion,
- // where it may open a token of its own.
+ // Step back so the byte that ended the token
+ // is written again and may open a new one.
text--;
}
out++;