summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4f12d52)
raw | patch | inline | side by side (parent: 4f12d52)
author | Shawn Pearce <spearce@spearce.org> | |
Sat, 8 Jul 2006 18:34:02 +0000 (14:34 -0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 10 Jul 2006 07:13:28 +0000 (00:13 -0700) |
In a handful places, we use C99 structure and array
initializers, which some compilers do not support.
This can be handy when you are trying to compile GIT on a
Solaris system that has an older C compiler, for example.
Signed-off-by: Junio C Hamano <junkio@cox.net>
initializers, which some compilers do not support.
This can be handy when you are trying to compile GIT on a
Solaris system that has an older C compiler, for example.
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-read-tree.c | patch | blob | history | |
checkout-index.c | patch | blob | history | |
diff.c | patch | blob | history |
diff --git a/builtin-read-tree.c b/builtin-read-tree.c
index 23a8d92a4b77e7436069c976bc5fa0ec162a9324..6df5d7c5cbe2cd524cda9e0636c3ed5a8259cf33 100644 (file)
--- a/builtin-read-tree.c
+++ b/builtin-read-tree.c
const unsigned char *sha1;
};
-static struct tree_entry_list df_conflict_list = {
- .name = NULL,
- .next = &df_conflict_list
-};
+static struct tree_entry_list df_conflict_list;
typedef int (*merge_fn_t)(struct cache_entry **src);
setitimer(ITIMER_REAL, &v, NULL);
}
+static struct checkout state;
static void check_updates(struct cache_entry **src, int nr)
{
- static struct checkout state = {
- .base_dir = "",
- .force = 1,
- .quiet = 1,
- .refresh_cache = 1,
- };
unsigned short mask = htons(CE_UPDATE);
unsigned last_percent = 200, cnt = 0, total = 0;
unsigned char sha1[20];
merge_fn_t fn = NULL;
+ df_conflict_list.next = &df_conflict_list;
+ state.base_dir = "";
+ state.force = 1;
+ state.quiet = 1;
+ state.refresh_cache = 1;
+
setup_git_directory();
git_config(git_default_config);
diff --git a/checkout-index.c b/checkout-index.c
index 29279555086ce36cdf598e390898a46888543846..61152f34b7fc00e745a2f7524c4da5b5a1a780a2 100644 (file)
--- a/checkout-index.c
+++ b/checkout-index.c
static int to_tempfile;
static char topath[4][MAXPATHLEN+1];
-static struct checkout state = {
- .base_dir = "",
- .base_dir_len = 0,
- .force = 0,
- .quiet = 0,
- .not_new = 0,
- .refresh_cache = 0,
-};
+static struct checkout state;
static void write_tempfile_record (const char *name)
{
int all = 0;
int read_from_stdin = 0;
+ state.base_dir = "";
prefix = setup_git_directory();
git_config(git_default_config);
prefix_length = prefix ? strlen(prefix) : 0;
index e101bfd8c808e832a209d352d677e7d8a666a5ec..287a927ce3131fd3a5c9151e5ea1e560842767a1 100644 (file)
--- a/diff.c
+++ b/diff.c
#define COLOR_WHITE "\033[37m"
static const char *diff_colors[] = {
- [DIFF_RESET] = COLOR_RESET,
- [DIFF_PLAIN] = COLOR_NORMAL,
- [DIFF_METAINFO] = COLOR_BOLD,
- [DIFF_FRAGINFO] = COLOR_CYAN,
- [DIFF_FILE_OLD] = COLOR_RED,
- [DIFF_FILE_NEW] = COLOR_GREEN,
+ COLOR_RESET,
+ COLOR_NORMAL,
+ COLOR_BOLD,
+ COLOR_CYAN,
+ COLOR_RED,
+ COLOR_GREEN
};
static int parse_diff_color_slot(const char *var, int ofs)