22
static struct oidset gitmodules_found = OIDSET_INIT;
23
static struct oidset gitmodules_done = OIDSET_INIT;
24
25
-#define FSCK_FATAL -1
26
-#define FSCK_INFO -2
27
-
25
#define FOREACH_MSG_ID(FUNC) \
26
/* fatal errors */ \
27
FUNC(NUL_IN_HEADER, FATAL) \
94
const char *id_string;
95
const char *downcased;
96
const char *camelcased;
100
- int msg_type;
97
+ enum fsck_msg_type msg_type;
98
} msg_id_info[FSCK_MSG_MAX + 1] = {
99
FOREACH_MSG_ID(MSG_ID)
100
{ NULL, NULL, NULL, -1 }
161
list_config_item(list, prefix, msg_id_info[i].camelcased);
162
}
163
167
-static int fsck_msg_type(enum fsck_msg_id msg_id,
164
+static enum fsck_msg_type fsck_msg_type(enum fsck_msg_id msg_id,
165
struct fsck_options *options)
166
{
167
assert(msg_id >= 0 && msg_id < FSCK_MSG_MAX);
168
169
if (!options->msg_type) {
173
- int msg_type = msg_id_info[msg_id].msg_type;
170
+ enum fsck_msg_type msg_type = msg_id_info[msg_id].msg_type;
171
172
if (options->strict && msg_type == FSCK_WARN)
173
msg_type = FSCK_ERROR;
177
return options->msg_type[msg_id];
178
}
179
183
-static int parse_msg_type(const char *str)
180
+static enum fsck_msg_type parse_msg_type(const char *str)
181
{
182
if (!strcmp(str, "error"))
183
return FSCK_ERROR;
200
void fsck_set_msg_type(struct fsck_options *options,
201
const char *msg_id_str, const char *msg_type_str)
202
{
206
- int msg_id = parse_msg_id(msg_id_str), msg_type;
203
+ int msg_id = parse_msg_id(msg_id_str);
204
+ enum fsck_msg_type msg_type;
205
206
if (msg_id < 0)
207
die("Unhandled message id: %s", msg_id_str);
212
213
if (!options->msg_type) {
214
int i;
217
- int *severity;
215
+ enum fsck_msg_type *severity;
216
ALLOC_ARRAY(severity, FSCK_MSG_MAX);
217
for (i = 0; i < FSCK_MSG_MAX; i++)
218
severity[i] = fsck_msg_type(i, options);
273
{
274
va_list ap;
275
struct strbuf sb = STRBUF_INIT;
278
- int msg_type = fsck_msg_type(msg_id, options), result;
276
+ enum fsck_msg_type msg_type = fsck_msg_type(msg_id, options);
277
+ int result;
278
279
if (msg_type == FSCK_IGNORE)
280
return 0;
1246
int fsck_error_function(struct fsck_options *o,
1247
const struct object_id *oid,
1248
enum object_type object_type,
1250
- int msg_type, const char *message)
1249
+ enum fsck_msg_type msg_type, const char *message)
1250
{
1251
if (msg_type == FSCK_WARN) {
1252
warning("object %s: %s", fsck_describe_object(o, oid), message);