Example #1
0
static void register_silenced_functions(void)
{
	struct token *token;
	char *func;
	char name[256];

	silenced_funcs = create_function_hashtable(500);

	if (option_project == PROJ_NONE)
		return;

	snprintf(name, 256, "%s.silenced_functions", option_project_str);

	token = get_tokens_file(name);
	if (!token)
		return;
	if (token_type(token) != TOKEN_STREAMBEGIN)
		return;
	token = token->next;
	while (token_type(token) != TOKEN_STREAMEND) {
		if (token_type(token) != TOKEN_IDENT)
			return;
		func = alloc_string(show_ident(token->ident));
		insert_func(silenced_funcs, func, INT_PTR(1));
		token = token->next;
	}
	clear_token_alloc();
}
Example #2
0
void check_or_vs_and(int id)
{
	my_id = id;

	unconstant_macros = create_function_hashtable(100);
	load_strings("unconstant_macros", unconstant_macros);

	add_hook(&match_logic, LOGIC_HOOK);
	add_hook(&match_condition, CONDITION_HOOK);
	if (option_spammy)
		add_hook(&match_binop, BINOP_HOOK);
}
Example #3
0
void check_bit_shift(int id)
{
	my_id = id;

	shifters = create_function_hashtable(5000);
	register_shifters();

	add_hook(&match_assign, ASSIGNMENT_HOOK);
	add_hook(&match_binop, BINOP_HOOK);

	if (option_info) {
		add_hook(&match_binop_info, BINOP_HOOK);
		if (option_project == PROJ_KERNEL) {
			add_function_hook("set_bit", &match_call, INT_PTR(0));
			add_function_hook("test_bit", &match_call, INT_PTR(0));
		}
	}
}