summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a6b02ac)
raw | patch | inline | side by side (parent: a6b02ac)
author | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 6 Oct 2008 19:29:20 +0000 (21:29 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 6 Oct 2008 19:29:20 +0000 (21:29 +0200) |
tig.c | patch | blob | history |
index f81686b70f641aae155d15097e47331f548e7a7d..3850387c4b10829a571ecb9c5ae27841aeca6c8d 100644 (file)
--- a/tig.c
+++ b/tig.c
#define SIZEOF_STR 1024 /* Default string size. */
#define SIZEOF_REF 256 /* Size of symbolic or SHA1 ID. */
-#define SIZEOF_REV 41 /* Holds a SHA-1 and an ending NUL */
+#define SIZEOF_REV 41 /* Holds a SHA-1 and an ending NUL. */
+#define SIZEOF_ARG 32 /* Default argument array size. */
/* Revision graph */
};
static enum line_type
-get_line_type(char *line)
+get_line_type(const char *line)
{
int linelen = strlen(line);
enum line_type type;
}
static struct line_info *
-get_line_info(char *name)
+get_line_info(const char *name)
{
size_t namelen = strlen(name);
enum line_type type;
static size_t run_requests;
static enum request
-add_run_request(enum keymap keymap, int key, int argc, char **argv)
+add_run_request(enum keymap keymap, int key, int argc, const char **argv)
{
struct run_request *req;
char cmd[SIZEOF_STR];
struct {
enum keymap keymap;
int key;
- char *argv[1];
+ const char *argv[1];
} reqs[] = {
{ KEYMAP_MAIN, 'C', { "git cherry-pick %(commit)" } },
{ KEYMAP_GENERIC, 'G', { "git gc" } },
/* Wants: object fgcolor bgcolor [attr] */
static int
-option_color_command(int argc, char *argv[])
+option_color_command(int argc, const char *argv[])
{
struct line_info *info;
/* Wants: name = value */
static int
-option_set_command(int argc, char *argv[])
+option_set_command(int argc, const char *argv[])
{
if (argc != 3) {
config_msg = "Wrong number of arguments given to set command";
/* Wants: mode request key */
static int
-option_bind_command(int argc, char *argv[])
+option_bind_command(int argc, const char *argv[])
{
enum request request;
int keymap;
static int
set_option(char *opt, char *value)
{
- char *argv[16];
+ const char *argv[SIZEOF_ARG];
int valuelen;
int argc = 0;