author | Junio C Hamano <junkio@cox.net> | |
Mon, 19 Jun 2006 05:13:54 +0000 (22:13 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 19 Jun 2006 05:13:54 +0000 (22:13 -0700) |
blame.c | patch | blob | history | |
builtin-read-tree.c | patch | blob | history | |
diff-delta.c | patch | blob | history | |
diff-lib.c | patch | blob | history | |
http-fetch.c | patch | blob | history | |
http-push.c | patch | blob | history | |
imap-send.c | patch | blob | history | |
quote.c | patch | blob | history |
index 7c0b62cf3f5ff78f95cf96c2582f693b5d124752..c86e2fd4b31fc75adf1c315fda166aabc38f0f43 100644 (file)
--- a/blame.c
+++ b/blame.c
if (DEBUG)
printf("map: i1: %d %d %p i2: %d %d %p\n",
i1, map[i1],
- i1 != -1 ? blame_lines[map[i1]] : NULL,
+ (void *) (i1 != -1 ? blame_lines[map[i1]] : NULL),
i2, map2[i2],
- i2 != -1 ? blame_lines[map2[i2]] : NULL);
+ (void *) (i2 != -1 ? blame_lines[map2[i2]] : NULL));
if (map2[i2] != -1 &&
blame_lines[map[i1]] &&
!blame_lines[map2[i2]])
diff --git a/builtin-read-tree.c b/builtin-read-tree.c
index 04506da892c1bfb198c706e166efe8a2bf6cf1be..9a2099d7307903d62c85f3483a22969ab5094c84 100644 (file)
--- a/builtin-read-tree.c
+++ b/builtin-read-tree.c
static struct object_list *trees = NULL;
-static struct cache_entry df_conflict_entry = {
-};
+static struct cache_entry df_conflict_entry;
struct tree_entry_list {
struct tree_entry_list *next;
diff --git a/diff-delta.c b/diff-delta.c
index 25a798d050c6319f3d524c9c605ab70ea35ae7a1..74486b1b81419d0078d8f1e43c96db437d6d4f65 100644 (file)
--- a/diff-delta.c
+++ b/diff-delta.c
#include <string.h>
#include "delta.h"
+#include "git-compat-util.h"
/* maximum hash entry list for the same hash bucket */
#define HASH_LIMIT 64
const void *src_buf;
unsigned long src_size;
unsigned int hash_mask;
- struct index_entry *hash[0];
+ struct index_entry *hash[FLEX_ARRAY];
};
struct delta_index * create_delta_index(const void *buf, unsigned long bufsize)
diff --git a/diff-lib.c b/diff-lib.c
index 2183b41b03d08092ba6d98a642757640b86710d6..fdc11732dfbe201119182ff701f7fd40d74d1017 100644 (file)
--- a/diff-lib.c
+++ b/diff-lib.c
continue;
if (ce_stage(ce)) {
- struct {
- struct combine_diff_path p;
- struct combine_diff_parent filler[5];
- } combine;
+ struct combine_diff_path *dpath;
int num_compare_stages = 0;
+ size_t path_len;
- combine.p.next = NULL;
- combine.p.len = ce_namelen(ce);
- combine.p.path = xmalloc(combine.p.len + 1);
- memcpy(combine.p.path, ce->name, combine.p.len);
- combine.p.path[combine.p.len] = 0;
- combine.p.mode = 0;
- memset(combine.p.sha1, 0, 20);
- memset(&combine.p.parent[0], 0,
- sizeof(combine.filler));
+ path_len = ce_namelen(ce);
+
+ dpath = xmalloc (combine_diff_path_size (5, path_len));
+ dpath->path = (char *) &(dpath->parent[5]);
+
+ dpath->next = NULL;
+ dpath->len = path_len;
+ memcpy(dpath->path, ce->name, path_len);
+ dpath->path[path_len] = '\0';
+ dpath->mode = 0;
+ memset(dpath->sha1, 0, 20);
+ memset(&(dpath->parent[0]), 0,
+ sizeof(struct combine_diff_parent)*5);
while (i < entries) {
struct cache_entry *nce = active_cache[i];
if (2 <= stage) {
int mode = ntohl(nce->ce_mode);
num_compare_stages++;
- memcpy(combine.p.parent[stage-2].sha1,
+ memcpy(dpath->parent[stage-2].sha1,
nce->sha1, 20);
- combine.p.parent[stage-2].mode =
+ dpath->parent[stage-2].mode =
canon_mode(mode);
- combine.p.parent[stage-2].status =
+ dpath->parent[stage-2].status =
DIFF_STATUS_MODIFIED;
}
i--;
if (revs->combine_merges && num_compare_stages == 2) {
- show_combined_diff(&combine.p, 2,
+ show_combined_diff(dpath, 2,
revs->dense_combined_merges,
revs);
- free(combine.p.path);
+ free(dpath);
continue;
}
- free(combine.p.path);
+ free(dpath);
+ dpath = NULL;
/*
* Show the diff for the 'ce' if we found the one
diff --git a/http-fetch.c b/http-fetch.c
index da1a7f5416a4bf3a633d3577382984f528694a78..3a2cb5e1fc1b2794f632c5ddbedfa99500081e5a 100644 (file)
--- a/http-fetch.c
+++ b/http-fetch.c
static inline int needs_quote(int ch)
{
- switch (ch) {
- case '/': case '-': case '.':
- case 'A'...'Z': case 'a'...'z': case '0'...'9':
+ if (((ch >= 'A') && (ch <= 'Z'))
+ || ((ch >= 'a') && (ch <= 'z'))
+ || ((ch >= '0') && (ch <= '9'))
+ || (ch == '/')
+ || (ch == '-')
+ || (ch == '.'))
return 0;
- default:
- return 1;
- }
+ return 1;
}
static inline int hex(int v)
diff --git a/http-push.c b/http-push.c
index ba64f8fff58936ab59074b835b9df06eecf3031e..aaf155c5bcb5b7587afa1a3063316d3183020984 100644 (file)
--- a/http-push.c
+++ b/http-push.c
static inline int needs_quote(int ch)
{
- switch (ch) {
- case '/': case '-': case '.':
- case 'A'...'Z': case 'a'...'z': case '0'...'9':
+ if (((ch >= 'A') && (ch <= 'Z'))
+ || ((ch >= 'a') && (ch <= 'z'))
+ || ((ch >= '0') && (ch <= '9'))
+ || (ch == '/')
+ || (ch == '-')
+ || (ch == '.'))
return 0;
- default:
- return 1;
- }
+ return 1;
}
static inline int hex(int v)
diff --git a/imap-send.c b/imap-send.c
index 285ad29afb4c4126010ddc2f76963b4f8f1cce70..94e39cd94cb26b2147e214ce4032121df871834e 100644 (file)
--- a/imap-send.c
+++ b/imap-send.c
char *data;
int len;
unsigned char flags;
- unsigned char crlf:1;
+ unsigned int crlf:1;
} msg_data_t;
#define DRV_OK 0
index 06792d47c3e324ee9893a4e52035f0642f38005f..dcc23266109ce30e3fd098f3c76799b67b75a332 100644 (file)
--- a/quote.c
+++ b/quote.c
case '\\': case '"':
break; /* verbatim */
- case '0'...'7':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
/* octal */
ac = ((ch - '0') << 6);
if ((ch = *sp++) < '0' || '7' < ch)