Commit f29249340c11b069e46b70fc145c1d7fbe213b94

Ramsay Jones 2010-06-01T19:41:55

Style: Do not use (C99) // comments Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Andreas Ericsson <ae@op5.se>

diff --git a/src/commit.c b/src/commit.c
index 9fcf811..eda57c5 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -115,7 +115,7 @@ git_commit *git_commit_lookup(git_revpool *pool, const git_oid *id)
 
 	memset(commit, 0x0, sizeof(git_commit));
 
-	// Initialize parent object
+	/* Initialize parent object */
 	git_oid_cpy(&commit->object.id, id);
 	commit->object.pool = pool;
 
@@ -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)
 			return GIT_ENOTFOUND;
 
-		// Inherit uninteresting flag
+		/* Inherit uninteresting flag */
 		if (commit->uninteresting)
 			parent->uninteresting = 1;
 
diff --git a/src/revobject.c b/src/revobject.c
index caa749d..32d5e64 100644
--- a/src/revobject.c
+++ b/src/revobject.c
@@ -45,7 +45,7 @@ git_revpool_table *git_revpool_table_create(unsigned int min_size)
 	if (table == 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 >> 1;
 	min_size |= min_size >> 2;
diff --git a/src/revwalk.c b/src/revwalk.c
index 2a6d97c..5d7f65d 100644
--- a/src/revwalk.c
+++ b/src/revwalk.c
@@ -76,9 +76,11 @@ int gitrp_push(git_revpool *pool, git_commit *commit)
 			return error;
 	}
 
-	// Sanity check: make sure that if the commit
-	// has been manually marked as uninteresting,
-	// all the parent commits are too.
+	/*
+	 * Sanity check: make sure that if the commit
+	 * has been manually marked as uninteresting,
+	 * all the parent commits are too.
+	 */
 	if (commit->uninteresting)
 		git_commit__mark_uninteresting(commit);
 
@@ -160,7 +162,7 @@ git_commit *gitrp_next(git_revpool *pool)
 			return next;
 	}
 
-	// No commits left to iterate
+	/* No commits left to iterate */
 	gitrp_reset(pool);
 	return NULL;
 }
diff --git a/tests/t0401-parse.c b/tests/t0401-parse.c
index 763dd65..770de6a 100644
--- a/tests/t0401-parse.c
+++ b/tests/t0401-parse.c
@@ -7,13 +7,13 @@
 
 static char *test_commits_broken[] = {
 
-    // empty commit
+    /* empty commit */
 "",
 
-    // random garbage
+    /* random garbage */
 "asd97sa9du902e9a0jdsuusad09as9du098709aweu8987sd\n",
 
-    // broken endlines 1
+    /* broken endlines 1 */
 "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\r\n\
 parent 05452d6349abcd67aa396dfb28660d765d8b2a36\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\
 \r\n\
 a test commit with broken endlines\r\n",
 
-    // broken endlines 2
+    /* broken endlines 2 */
 "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\
 parent 05452d6349abcd67aa396dfb28660d765d8b2a36\
 author 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",
 
-    // starting endlines
+    /* starting endlines */
 "\ntree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
 parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n\
 author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
@@ -37,24 +37,26 @@ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
 \n\
 a test commit with a starting endline\n",
 
-    // corrupted commit 1
+    /* corrupted commit 1 */
 "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
 parent 05452d6349abcd67aa396df",
 
-    // corrupted commit 2
+    /* corrupted commit 2 */
 "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
 parent ",
 
-    // corrupted commit 3
+    /* corrupted commit 3 */
 "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
 parent ",
 
-    // corrupted commit 4
+    /* corrupted commit 4 */
 "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
 par",
 
-    // FIXME: duplicated parents?
-    // It this supposed to pass?
+    /*
+     * FIXME: duplicated parents?
+     * It this supposed to pass?
+     */
 /*
 "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
 parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n\
@@ -68,20 +70,20 @@ duplicated parent",
 
 
 static char *test_commits_working[] = {
-    // simple commit with no message
+    /* simple commit with no message */
 "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
 author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
 committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
 \n",
 
-    // simple commit, no parent
+    /* simple commit, no parent */
 "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
 author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
 committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
 \n\
 a simple commit which works\n",
 
-    // simple commit, 1 parents
+    /* simple commit, 1 parents */
 "tree f6c0dad3c7b3481caa9d73db21f91964894a945b\n\
 parent 05452d6349abcd67aa396dfb28660d765d8b2a36\n\
 author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
diff --git a/tests/t0403-lists.c b/tests/t0403-lists.c
index f971ce4..dd1a5b5 100644
--- a/tests/t0403-lists.c
+++ b/tests/t0403-lists.c
@@ -24,7 +24,7 @@ BEGIN_TEST(list_timesort_test)
     for (t = 0; t < 20; ++t) {
         const int test_size = rand() % 500 + 500;
 
-        // Purely random sorting test
+        /* Purely random sorting test */
         for (i = 0; i < test_size; ++i) {
             git_commit *c = git__malloc(sizeof(git_commit));
             c->commit_time = (time_t)rand();
@@ -37,7 +37,7 @@ BEGIN_TEST(list_timesort_test)
         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) {
         git_commit *c = git__malloc(sizeof(git_commit));
         c->commit_time = 0;
@@ -49,7 +49,7 @@ BEGIN_TEST(list_timesort_test)
     TEST_SORTED();
     git_commit_list_clear(&list, 1);
 
-    // Try to sort empty list
+    /* Try to sort empty list */
     git_commit_list_timesort(&list);
     TEST_SORTED();
 
diff --git a/tests/t0501-walk.c b/tests/t0501-walk.c
index 755a4f7..065d464 100644
--- a/tests/t0501-walk.c
+++ b/tests/t0501-walk.c
@@ -21,12 +21,12 @@ static const char *odb_dir = "../t0501-objects";
 static const char *commit_head = "a4a7dce85cf63874e984719f4fdd239f5145052f";
 
 static const char *commit_ids[] = {
-    "a4a7dce85cf63874e984719f4fdd239f5145052f", // 0
-    "9fd738e8f7967c078dceed8190330fc8648ee56a", // 1
-    "4a202b346bb0fb0db7eff3cffeb3c70babbd2045", // 2
-    "c47800c7266a2be04c571c04d5a6614691ea99bd", // 3
-    "8496071c1b46c854b31185ea97743be6a8774479", // 4
-    "5b5b025afb0b4c913b4c338a42934a3863bf3644", // 5
+    "a4a7dce85cf63874e984719f4fdd239f5145052f", /* 0 */
+    "9fd738e8f7967c078dceed8190330fc8648ee56a", /* 1 */
+    "4a202b346bb0fb0db7eff3cffeb3c70babbd2045", /* 2 */
+    "c47800c7266a2be04c571c04d5a6614691ea99bd", /* 3 */
+    "8496071c1b46c854b31185ea97743be6a8774479", /* 4 */
+    "5b5b025afb0b4c913b4c338a42934a3863bf3644", /* 5 */
 };
 
 static const int commit_sorting_topo[] = {0, 1, 2, 3, 5, 4};