Commit f2924934 by Ramsay Jones Committed by Andreas Ericsson

Style: Do not use (C99) // comments

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Andreas Ericsson <ae@op5.se>
parent b2bc567f
...@@ -115,7 +115,7 @@ git_commit *git_commit_lookup(git_revpool *pool, const git_oid *id) ...@@ -115,7 +115,7 @@ git_commit *git_commit_lookup(git_revpool *pool, const git_oid *id)
memset(commit, 0x0, sizeof(git_commit)); memset(commit, 0x0, sizeof(git_commit));
// Initialize parent object /* Initialize parent object */
git_oid_cpy(&commit->object.id, id); git_oid_cpy(&commit->object.id, id);
commit->object.pool = pool; commit->object.pool = pool;
...@@ -200,7 +200,7 @@ int git_commit__parse_buffer(git_commit *commit, void *data, size_t len) ...@@ -200,7 +200,7 @@ int git_commit__parse_buffer(git_commit *commit, void *data, size_t len)
if ((parent = git_commit_lookup(commit->object.pool, &oid)) == NULL) if ((parent = git_commit_lookup(commit->object.pool, &oid)) == NULL)
return GIT_ENOTFOUND; return GIT_ENOTFOUND;
// Inherit uninteresting flag /* Inherit uninteresting flag */
if (commit->uninteresting) if (commit->uninteresting)
parent->uninteresting = 1; parent->uninteresting = 1;
......
...@@ -45,7 +45,7 @@ git_revpool_table *git_revpool_table_create(unsigned int min_size) ...@@ -45,7 +45,7 @@ git_revpool_table *git_revpool_table_create(unsigned int min_size)
if (table == NULL) if (table == NULL)
return NULL; return NULL;
// round up size to closest power of 2 /* round up size to closest power of 2 */
min_size--; min_size--;
min_size |= min_size >> 1; min_size |= min_size >> 1;
min_size |= min_size >> 2; min_size |= min_size >> 2;
......
...@@ -76,9 +76,11 @@ int gitrp_push(git_revpool *pool, git_commit *commit) ...@@ -76,9 +76,11 @@ int gitrp_push(git_revpool *pool, git_commit *commit)
return error; return error;
} }
// Sanity check: make sure that if the commit /*
// has been manually marked as uninteresting, * Sanity check: make sure that if the commit
// all the parent commits are too. * has been manually marked as uninteresting,
* all the parent commits are too.
*/
if (commit->uninteresting) if (commit->uninteresting)
git_commit__mark_uninteresting(commit); git_commit__mark_uninteresting(commit);
...@@ -160,7 +162,7 @@ git_commit *gitrp_next(git_revpool *pool) ...@@ -160,7 +162,7 @@ git_commit *gitrp_next(git_revpool *pool)
return next; return next;
} }
// No commits left to iterate /* No commits left to iterate */
gitrp_reset(pool); gitrp_reset(pool);
return NULL; return NULL;
} }
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
static char *test_commits_broken[] = { static char *test_commits_broken[] = {
// empty commit /* empty commit */
"", "",
// random garbage /* random garbage */
"asd97sa9du902e9a0jdsuusad09as9du098709aweu8987sd\n", "asd97sa9du902e9a0jdsuusad09as9du098709aweu8987sd\n",
// broken endlines 1 /* broken endlines 1 */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\r\n\ "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\r\n\
parent 05452d6349abcd67aa396dfb28660d765d8b2a36\r\n\ parent 05452d6349abcd67aa396dfb28660d765d8b2a36\r\n\
author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\r\n\ author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\r\n\
...@@ -21,7 +21,7 @@ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\r\n\ ...@@ -21,7 +21,7 @@ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\r\n\
\r\n\ \r\n\
a test commit with broken endlines\r\n", a test commit with broken endlines\r\n",
// broken endlines 2 /* broken endlines 2 */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\ "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\
parent 05452d6349abcd67aa396dfb28660d765d8b2a36\ parent 05452d6349abcd67aa396dfb28660d765d8b2a36\
author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\ author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\
...@@ -29,7 +29,7 @@ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\ ...@@ -29,7 +29,7 @@ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\
\ \
another test commit with broken endlines", another test commit with broken endlines",
// starting endlines /* starting endlines */
"\ntree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ "\ntree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n\ parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n\
author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\ author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
...@@ -37,24 +37,26 @@ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\ ...@@ -37,24 +37,26 @@ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
\n\ \n\
a test commit with a starting endline\n", a test commit with a starting endline\n",
// corrupted commit 1 /* corrupted commit 1 */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
parent 05452d6349abcd67aa396df", parent 05452d6349abcd67aa396df",
// corrupted commit 2 /* corrupted commit 2 */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
parent ", parent ",
// corrupted commit 3 /* corrupted commit 3 */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
parent ", parent ",
// corrupted commit 4 /* corrupted commit 4 */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
par", par",
// FIXME: duplicated parents? /*
// It this supposed to pass? * FIXME: duplicated parents?
* It this supposed to pass?
*/
/* /*
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n\ parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n\
...@@ -68,20 +70,20 @@ duplicated parent", ...@@ -68,20 +70,20 @@ duplicated parent",
static char *test_commits_working[] = { static char *test_commits_working[] = {
// simple commit with no message /* simple commit with no message */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\ author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
\n", \n",
// simple commit, no parent /* simple commit, no parent */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\ author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
\n\ \n\
a simple commit which works\n", a simple commit which works\n",
// simple commit, 1 parents /* simple commit, 1 parents */
"tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\ "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n\ parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n\
author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\ author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
......
...@@ -24,7 +24,7 @@ BEGIN_TEST(list_timesort_test) ...@@ -24,7 +24,7 @@ BEGIN_TEST(list_timesort_test)
for (t = 0; t < 20; ++t) { for (t = 0; t < 20; ++t) {
const int test_size = rand() % 500 + 500; const int test_size = rand() % 500 + 500;
// Purely random sorting test /* Purely random sorting test */
for (i = 0; i < test_size; ++i) { for (i = 0; i < test_size; ++i) {
git_commit *c = git__malloc(sizeof(git_commit)); git_commit *c = git__malloc(sizeof(git_commit));
c->commit_time = (time_t)rand(); c->commit_time = (time_t)rand();
...@@ -37,7 +37,7 @@ BEGIN_TEST(list_timesort_test) ...@@ -37,7 +37,7 @@ BEGIN_TEST(list_timesort_test)
git_commit_list_clear(&list, 1); git_commit_list_clear(&list, 1);
} }
// Try to sort list with all dates equal. /* Try to sort list with all dates equal. */
for (i = 0; i < 200; ++i) { for (i = 0; i < 200; ++i) {
git_commit *c = git__malloc(sizeof(git_commit)); git_commit *c = git__malloc(sizeof(git_commit));
c->commit_time = 0; c->commit_time = 0;
...@@ -49,7 +49,7 @@ BEGIN_TEST(list_timesort_test) ...@@ -49,7 +49,7 @@ BEGIN_TEST(list_timesort_test)
TEST_SORTED(); TEST_SORTED();
git_commit_list_clear(&list, 1); git_commit_list_clear(&list, 1);
// Try to sort empty list /* Try to sort empty list */
git_commit_list_timesort(&list); git_commit_list_timesort(&list);
TEST_SORTED(); TEST_SORTED();
......
...@@ -21,12 +21,12 @@ static const char *odb_dir = "../t0501-objects"; ...@@ -21,12 +21,12 @@ static const char *odb_dir = "../t0501-objects";
static const char *commit_head = "a4a7dce85cf63874e984719f4fdd239f5145052f"; static const char *commit_head = "a4a7dce85cf63874e984719f4fdd239f5145052f";
static const char *commit_ids[] = { static const char *commit_ids[] = {
"a4a7dce85cf63874e984719f4fdd239f5145052f", // 0 "a4a7dce85cf63874e984719f4fdd239f5145052f", /* 0 */
"9fd738e8f7967c078dceed8190330fc8648ee56a", // 1 "9fd738e8f7967c078dceed8190330fc8648ee56a", /* 1 */
"4a202b346bb0fb0db7eff3cffeb3c70babbd2045", // 2 "4a202b346bb0fb0db7eff3cffeb3c70babbd2045", /* 2 */
"c47800c7266a2be04c571c04d5a6614691ea99bd", // 3 "c47800c7266a2be04c571c04d5a6614691ea99bd", /* 3 */
"8496071c1b46c854b31185ea97743be6a8774479", // 4 "8496071c1b46c854b31185ea97743be6a8774479", /* 4 */
"5b5b025afb0b4c913b4c338a42934a3863bf3644", // 5 "5b5b025afb0b4c913b4c338a42934a3863bf3644", /* 5 */
}; };
static const int commit_sorting_topo[] = {0, 1, 2, 3, 5, 4}; static const int commit_sorting_topo[] = {0, 1, 2, 3, 5, 4};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment