Ejemplo n.º 1
0
void MustUseChecker::registerMatchers(MatchFinder *AstMatcher) {
  AstMatcher->addMatcher(switchCase().bind("switchcase"), this);
  AstMatcher->addMatcher(compoundStmt().bind("compound"), this);
  AstMatcher->addMatcher(ifStmt().bind("if"), this);
  AstMatcher->addMatcher(whileStmt().bind("while"), this);
  AstMatcher->addMatcher(doStmt().bind("do"), this);
  AstMatcher->addMatcher(forStmt().bind("for"), this);
  AstMatcher->addMatcher(binaryOperator(binaryCommaOperator()).bind("bin"),
                         this);
}
Ejemplo n.º 2
0
static bool checkWord_internal(const char * const start, char * current, int length, const char * const hash)
{
	if (length == 0) {
		return check_hash(start, hash);
	}

	char c = *current;
	*current = switchCase(*current);
	if (checkWord_internal(start, current + sizeof(char), length - 1, hash))
		return true;

	*current = c;
	return checkWord_internal(start, current + sizeof(char), length - 1, hash);
}