diff options
author | Russell Belfer <rb@github.com> | 2013-05-24 21:35:58 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-05-24 21:35:58 +0400 |
commit | 16adc9fade52b49e2bc13cb52407cc0025a93c8b (patch) | |
tree | 4e4e46a8d370237a766e9edd5a277520c4f43aef /src/config_file.c | |
parent | 2e62e7c23ce69d89d495a2c42458c7e185a3120a (diff) |
Typedef git_config_level_t and use it everywhere
The GIT_CONFIG_LEVEL constants actually work well as an enum
because they are mutually exclusive, so this adds a typedef to
the enum and uses that everywhere that one of these constants are
expected, instead of the old code that typically used an unsigned
int.
Diffstat (limited to 'src/config_file.c')
-rw-r--r-- | src/config_file.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/config_file.c b/src/config_file.c index e57cd1e53..dec952115 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -81,10 +81,10 @@ typedef struct { time_t file_mtime; size_t file_size; - unsigned int level; + git_config_level_t level; } diskfile_backend; -static int config_parse(diskfile_backend *cfg_file, unsigned int level); +static int config_parse(diskfile_backend *cfg_file, git_config_level_t level); static int parse_variable(diskfile_backend *cfg, char **var_name, char **var_value); static int config_write(diskfile_backend *cfg, const char *key, const regex_t *preg, const char *value); static char *escape_value(const char *ptr); @@ -181,7 +181,7 @@ static void free_vars(git_strmap *values) git_strmap_free(values); } -static int config_open(git_config_backend *cfg, unsigned int level) +static int config_open(git_config_backend *cfg, git_config_level_t level) { int res; diskfile_backend *b = (diskfile_backend *)cfg; @@ -965,7 +965,7 @@ static int strip_comments(char *line, int in_quotes) return quote_count; } -static int config_parse(diskfile_backend *cfg_file, unsigned int level) +static int config_parse(diskfile_backend *cfg_file, git_config_level_t level) { int c; char *current_section = NULL; |