summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 546ba5d)
raw | patch | inline | side by side (parent: 546ba5d)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 8 Feb 2009 19:37:11 +0000 (20:37 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 8 Feb 2009 19:37:11 +0000 (20:37 +0100) |
tig.c | patch | blob | history |
index 62645334d9e6dcdc86ed108583e4e1ce4269e473..c9370d04c69a072d9909743bb2ca05ad226822db 100644 (file)
--- a/tig.c
+++ b/tig.c
#define ENUM_MAP(name, value) { name, STRING_SIZE(name), value }
static bool
-map_enum_do(struct enum_map *map, size_t map_size, int *value, const char *name)
+map_enum_do(const struct enum_map *map, size_t map_size, int *value, const char *name)
{
size_t namelen = strlen(name);
int i;
const char *help;
};
-static struct request_info req_info[] = {
+static const struct request_info req_info[] = {
#define REQ_GROUP(help) { 0, NULL, 0, (help) },
#define REQ_(req, help) { REQ_##req, (#req), STRING_SIZE(#req), (help) }
REQ_INFO
enum request request;
};
-static struct keybinding default_keybindings[] = {
+static const struct keybinding default_keybindings[] = {
/* View switching */
{ 'm', REQ_VIEW_MAIN },
{ 'd', REQ_VIEW_DIFF },
#undef KEYMAP_
};
-static struct enum_map keymap_table[] = {
+static const struct enum_map keymap_table[] = {
#define KEYMAP_(name) ENUM_MAP(#name, KEYMAP_##name)
KEYMAP_INFO
#undef KEYMAP_
int value;
};
-static struct key key_table[] = {
+static const struct key key_table[] = {
{ "Enter", KEY_RETURN },
{ "Space", ' ' },
{ "Backspace", KEY_BACKSPACE },
buf[pos] = 0;
for (i = 0; i < ARRAY_SIZE(default_keybindings); i++) {
- struct keybinding *keybinding = &default_keybindings[i];
+ const struct keybinding *keybinding = &default_keybindings[i];
if (keybinding->request != request)
continue;
static bool config_errors;
static const char *config_msg;
-static struct enum_map color_map[] = {
+static const struct enum_map color_map[] = {
#define COLOR_MAP(name) ENUM_MAP(#name, COLOR_##name)
COLOR_MAP(DEFAULT),
COLOR_MAP(BLACK),
COLOR_MAP(YELLOW),
};
-static struct enum_map attr_map[] = {
+static const struct enum_map attr_map[] = {
#define ATTR_MAP(name) ENUM_MAP(#name, A_##name)
ATTR_MAP(NORMAL),
ATTR_MAP(BLINK),
info = get_line_info(argv[0]);
if (!info) {
- static struct enum_map obsolete[] = {
+ static const struct enum_map obsolete[] = {
ENUM_MAP("main-delim", LINE_DELIMITER),
ENUM_MAP("main-date", LINE_DATE),
ENUM_MAP("main-author", LINE_AUTHOR),
request = get_request(argv[2]);
if (request == REQ_NONE) {
- static struct enum_map obsolete[] = {
+ static const struct enum_map obsolete[] = {
ENUM_MAP("cherry-pick", REQ_NONE),
ENUM_MAP("screen-resize", REQ_NONE),
ENUM_MAP("tree-parent", REQ_PARENT),