summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 82e5a82)
raw | patch | inline | side by side (parent: 82e5a82)
author | Pavel Roskin <proski@gnu.org> | |
Mon, 10 Jul 2006 06:57:51 +0000 (02:57 -0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 10 Jul 2006 07:47:13 +0000 (00:47 -0700) |
This doesn't make the code uglier or harder to read, yet it makes the
code more portable. This also simplifies checking for other potential
incompatibilities. "gcc -std=c89 -pedantic" can flag many incompatible
constructs as warnings, but C99 comments will cause it to emit an error.
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
code more portable. This also simplifies checking for other potential
incompatibilities. "gcc -std=c89 -pedantic" can flag many incompatible
constructs as warnings, but C99 comments will cause it to emit an error.
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
blame.c | patch | blob | history | |
builtin-apply.c | patch | blob | history | |
builtin-push.c | patch | blob | history | |
convert-objects.c | patch | blob | history | |
dir.c | patch | blob | history | |
http-fetch.c | patch | blob | history | |
mktag.c | patch | blob | history | |
read-cache.c | patch | blob | history | |
sha1_file.c | patch | blob | history | |
ssh-fetch.c | patch | blob | history |
index 0a06026168458de494f1cd089ea58470af4f3e56..b04b8f58aaf718208ab13e5cbfd8cd2a4444cbd7 100644 (file)
--- a/blame.c
+++ b/blame.c
};
struct chunk {
- int off1, len1; // ---
- int off2, len2; // +++
+ int off1, len1; /* --- */
+ int off2, len2; /* +++ */
};
struct patch {
}
#endif
-// p is a patch from commit to other.
+/* p is a patch from commit to other. */
static void fill_line_map(struct commit *commit, struct commit *other,
struct patch *p)
{
diff --git a/builtin-apply.c b/builtin-apply.c
index 1e5b846dd3935f54ee8fa1c3620810be059de5d3..c903146bb65e6db4dcb527badf864d98db6aabb3 100644 (file)
--- a/builtin-apply.c
+++ b/builtin-apply.c
#include "delta.h"
#include "builtin.h"
-// --check turns on checking that the working tree matches the
-// files that are being modified, but doesn't apply the patch
-// --stat does just a diffstat, and doesn't actually apply
-// --numstat does numeric diffstat, and doesn't actually apply
-// --index-info shows the old and new index info for paths if available.
-// --index updates the cache as well.
-// --cached updates only the cache without ever touching the working tree.
-//
+/*
+ * --check turns on checking that the working tree matches the
+ * files that are being modified, but doesn't apply the patch
+ * --stat does just a diffstat, and doesn't actually apply
+ * --numstat does numeric diffstat, and doesn't actually apply
+ * --index-info shows the old and new index info for paths if available.
+ * --index updates the cache as well.
+ * --cached updates only the cache without ever touching the working tree.
+ */
static const char *prefix;
static int prefix_length = -1;
static int newfd = -1;
@@ -284,8 +285,8 @@ static void parse_traditional_patch(const char *first, const char *second, struc
{
char *name;
- first += 4; // skip "--- "
- second += 4; // skip "+++ "
+ first += 4; /* skip "--- " */
+ second += 4; /* skip "+++ " */
if (is_dev_null(first)) {
patch->is_new = 1;
patch->is_delete = 0;
diff --git a/builtin-push.c b/builtin-push.c
index a8fac886f1a35dd645a513be70cb6c368f75437d..31cbfd73861326ad303472718365838329a55cb8 100644 (file)
--- a/builtin-push.c
+++ b/builtin-push.c
int cmd_push(int argc, const char **argv, char **envp)
{
int i;
- const char *repo = "origin"; // default repository
+ const char *repo = "origin"; /* default repository */
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
diff --git a/convert-objects.c b/convert-objects.c
index 0fabd8981c6047e5144cfb3776b4f4a5588f24e5..ebea8e472bb2eede02219999b0cfd9a63f211d4b 100644 (file)
--- a/convert-objects.c
+++ b/convert-objects.c
@@ -240,14 +240,14 @@ static void convert_date(void *buffer, unsigned long size, unsigned char *result
{
char *new = xmalloc(size + 100);
unsigned long newlen = 0;
-
- // "tree <sha1>\n"
+
+ /* "tree <sha1>\n" */
memcpy(new + newlen, buffer, 46);
newlen += 46;
buffer = (char *) buffer + 46;
size -= 46;
- // "parent <sha1>\n"
+ /* "parent <sha1>\n" */
while (!memcmp(buffer, "parent ", 7)) {
memcpy(new + newlen, buffer, 48);
newlen += 48;
@@ -255,12 +255,12 @@ static void convert_date(void *buffer, unsigned long size, unsigned char *result
size -= 48;
}
- // "author xyz <xyz> date"
+ /* "author xyz <xyz> date" */
newlen += convert_date_line(new + newlen, &buffer, &size);
- // "committer xyz <xyz> date"
+ /* "committer xyz <xyz> date" */
newlen += convert_date_line(new + newlen, &buffer, &size);
- // Rest
+ /* Rest */
memcpy(new + newlen, buffer, size);
newlen += size;
index d778ecd8908d7a32519cc9c31d8333de3fad0ae6..092d07736c60d4c6d86201ebeb841498c3be92a0 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -336,7 +336,7 @@ static int read_directory_recursive(struct dir_struct *dir, const char *path, co
if (dir->show_other_directories &&
(subdir || !dir->hide_empty_directories) &&
!dir_exists(fullname, baselen + len)) {
- // Rewind the read subdirectory
+ /* Rewind the read subdirectory */
while (dir->nr > rewind_base)
free(dir->entries[--dir->nr]);
break;
diff --git a/http-fetch.c b/http-fetch.c
index 44eba5fd0df292255dce056ec5aa700186096b39..12493fbed2822ce41b5b4c23fb85d6f4a47c104a 100644 (file)
--- a/http-fetch.c
+++ b/http-fetch.c
{
struct packed_git *new_pack;
if (has_pack_file(sha1))
- return 0; // don't list this as something we can get
+ return 0; /* don't list this as something we can get */
if (fetch_index(repo, sha1))
return -1;
base[serverlen - 1] != '/');
i += 3;
}
- // If the server got removed, give up.
+ /* If the server got removed, give up. */
okay = strchr(base, ':') - base + 3 <
serverlen;
} else if (alt_req->http_specific) {
okay = 1;
}
}
- // skip 'objects' at end
+ /* skip 'objects' at end */
if (okay) {
target = xmalloc(serverlen + posn - i - 6);
strlcpy(target, base, serverlen);
index f0fe5285b24d5a19c7d41b437a18a3851ae90802..27f4c4f0413c5a7bb16106d1a0c1d5381c1159d2 100644 (file)
--- a/mktag.c
+++ b/mktag.c
* in that size, you're doing something wrong.
*/
-// Some random size
+/* Some random size */
#define MAXSIZE (8192)
/*
die("could not read from stdin");
}
- // Verify it for some basic sanity: it needs to start with "object <sha1>\ntype\ntagger "
+ /* Verify it for some basic sanity: it needs to start with
+ "object <sha1>\ntype\ntagger " */
if (verify_tag(buffer, size) < 0)
die("invalid tag signature file");
diff --git a/read-cache.c b/read-cache.c
index 3c32aae7e8ae63bccad83a603f2b86c66965cd26..a50d3612c84d10da35b0b0e1278ecea899a4ec15 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
die("index file open failed (%s)", strerror(errno));
}
- size = 0; // avoid gcc warning
+ size = 0; /* avoid gcc warning */
map = MAP_FAILED;
if (!fstat(fd, &st)) {
size = st.st_size;
diff --git a/sha1_file.c b/sha1_file.c
index f7bb3a1c54c001a83dd0c2ee9c2b59dd686a66d1..459430a56c10df4ad02195ef83d289b753222ffc 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
{
if (!p->pack_size) {
struct stat st;
- // We created the struct before we had the pack
+ /* We created the struct before we had the pack */
stat(p->pack_name, &st);
if (!S_ISREG(st.st_mode))
die("packfile %s not a regular file", p->pack_name);
int hdrlen;
void *buf;
- // need to unpack and recompress it by itself
+ /* need to unpack and recompress it by itself */
unpacked = read_packed_sha1(sha1, type, &len);
hdrlen = sprintf(hdr, "%s %lu", type, len) + 1;
diff --git a/ssh-fetch.c b/ssh-fetch.c
index 1e59cd2008d8089efef74b940d1a1094add7e687..28f7fd9174e8c48493983b17fa7b18cdecd41609 100644 (file)
--- a/ssh-fetch.c
+++ b/ssh-fetch.c
struct object_list *temp;
if (memcmp(sha1, in_transit->item->sha1, 20)) {
- // we must have already fetched it to clean the queue
+ /* we must have already fetched it to clean the queue */
return has_sha1_file(sha1) ? 0 : -1;
}
prefetches--;
if (read(fd_in, &remote, 1) < 1)
return -1;
}
- //fprintf(stderr, "Got %d\n", remote);
+ /* fprintf(stderr, "Got %d\n", remote); */
if (remote < 0)
return remote;
ret = write_sha1_from_fd(sha1, fd_in, conn_buf, 4096, &conn_buf_posn);