}
}
+static const char*
+bool_to_string(bool value)
+{
+ return value ? "true" : "false";
+}
+
static bool
verify_absolute_path(void *value, char **errmsg)
{
reformat(&s, "compiler_check = %s", conf->compiler_check);
printer(s, conf->item_origins[find_conf("compiler_check")->number], context);
- reformat(&s, "compression = %s", conf->compression ? "true" : "false");
+ reformat(&s, "compression = %s", bool_to_string(conf->compression));
printer(s, conf->item_origins[find_conf("compression")->number], context);
reformat(&s, "compression_level = %u", conf->compression_level);
reformat(&s, "cpp_extension = %s", conf->cpp_extension);
printer(s, conf->item_origins[find_conf("cpp_extension")->number], context);
- reformat(&s, "direct_mode = %s", conf->direct_mode ? "true" : "false");
+ reformat(&s, "direct_mode = %s", bool_to_string(conf->direct_mode));
printer(s, conf->item_origins[find_conf("direct_mode")->number], context);
- reformat(&s, "disable = %s", conf->disable ? "true" : "false");
+ reformat(&s, "disable = %s", bool_to_string(conf->disable));
printer(s, conf->item_origins[find_conf("disable")->number], context);
reformat(&s, "extra_files_to_hash = %s", conf->extra_files_to_hash);
printer(s, conf->item_origins[find_conf("extra_files_to_hash")->number],
context);
- reformat(&s, "hard_link = %s", conf->hard_link ? "true" : "false");
+ reformat(&s, "hard_link = %s", bool_to_string(conf->hard_link));
printer(s, conf->item_origins[find_conf("hard_link")->number], context);
- reformat(&s, "hash_dir = %s", conf->hash_dir ? "true" : "false");
+ reformat(&s, "hash_dir = %s", bool_to_string(conf->hash_dir));
printer(s, conf->item_origins[find_conf("hash_dir")->number], context);
reformat(&s, "log_file = %s", conf->log_file);
reformat(&s, "prefix_command = %s", conf->prefix_command);
printer(s, conf->item_origins[find_conf("prefix_command")->number], context);
- reformat(&s, "read_only = %s", conf->read_only ? "true" : "false");
+ reformat(&s, "read_only = %s", bool_to_string(conf->read_only));
printer(s, conf->item_origins[find_conf("read_only")->number], context);
- reformat(&s, "recache = %s", conf->recache ? "true" : "false");
+ reformat(&s, "recache = %s", bool_to_string(conf->recache));
printer(s, conf->item_origins[find_conf("recache")->number], context);
- reformat(&s, "run_second_cpp = %s", conf->run_second_cpp ? "true" : "false");
+ reformat(&s, "run_second_cpp = %s", bool_to_string(conf->run_second_cpp));
printer(s, conf->item_origins[find_conf("run_second_cpp")->number], context);
reformat(&s, "sloppiness = ");
}
printer(s, conf->item_origins[find_conf("sloppiness")->number], context);
- reformat(&s, "stats = %s", conf->stats ? "true" : "false");
+ reformat(&s, "stats = %s", bool_to_string(conf->stats));
printer(s, conf->item_origins[find_conf("stats")->number], context);
reformat(&s, "temporary_dir = %s", conf->temporary_dir);
}
printer(s, conf->item_origins[find_conf("umask")->number], context);
- reformat(&s, "unify = %s", conf->unify ? "true" : "false");
+ reformat(&s, "unify = %s", bool_to_string(conf->unify));
printer(s, conf->item_origins[find_conf("unify")->number], context);
free(s);