1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2012-04-15 19:32:26 -07:00
parent be137ca311
commit 7366607b69
3 changed files with 13 additions and 19 deletions

View file

@ -61,13 +61,10 @@ public class ProblemBindingChecker extends AbstractIndexAstChecker {
return true; return true;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.codan.core.model.AbstractCheckerWithProblemPreferences#initPreferences(org.eclipse.cdt.codan.core.model.IProblemWorkingCopy)
*/
@Override @Override
public void initPreferences(IProblemWorkingCopy problem) { public void initPreferences(IProblemWorkingCopy problem) {
super.initPreferences(problem); super.initPreferences(problem);
// these checkers should not run on full or incremental build // This checker should not run on full or incremental build
getLaunchModePreference(problem).enableInLaunchModes(CheckerLaunchMode.RUN_AS_YOU_TYPE, CheckerLaunchMode.RUN_ON_DEMAND); getLaunchModePreference(problem).enableInLaunchModes(CheckerLaunchMode.RUN_AS_YOU_TYPE, CheckerLaunchMode.RUN_ON_DEMAND);
} }
@ -150,9 +147,8 @@ public class ProblemBindingChecker extends AbstractIndexAstChecker {
handleMemberProblem(name, parentNode, problemBinding, contextFlagsString); handleMemberProblem(name, parentNode, problemBinding, contextFlagsString);
} else if (parentNode instanceof IASTNamedTypeSpecifier) { } else if (parentNode instanceof IASTNamedTypeSpecifier) {
reportProblem(ERR_ID_TypeResolutionProblem, name, name.getRawSignature(), contextFlagsString); reportProblem(ERR_ID_TypeResolutionProblem, name, name.getRawSignature(), contextFlagsString);
} } else {
// Probably a variable // Probably a variable
else {
handleVariableProblem(name, contextFlagsString); handleVariableProblem(name, contextFlagsString);
} }
} }

View file

@ -555,10 +555,10 @@ class ASTFunctionStyleMacroDefinition extends ASTMacroDefinition implements IAST
int endIdx= Math.min(fExpansionNumber - defOffset, image.length); int endIdx= Math.min(fExpansionNumber - defOffset, image.length);
char start= '('; char start= '(';
for (int i = 0; i < result.length; i++) { for (int i = 0; i < result.length; i++) {
while(idx < endIdx && image[idx] != start) while (idx < endIdx && image[idx] != start)
idx++; idx++;
idx++; idx++;
while(idx < endIdx && Character.isWhitespace(image[idx])) while (idx < endIdx && Character.isWhitespace(image[idx]))
idx++; idx++;
start= ','; start= ',';
@ -800,7 +800,8 @@ class ASTMacroExpansionLocation implements IASTMacroExpansionLocation, org.eclip
@Override @Override
public IASTFileLocation asFileLocation() { public IASTFileLocation asFileLocation() {
return ((LocationCtxContainer) fContext.getParent()).createFileLocation(fContext.fOffsetInParent, fContext.fEndOffsetInParent-fContext.fOffsetInParent); return ((LocationCtxContainer) fContext.getParent()).createFileLocation(fContext.fOffsetInParent,
fContext.fEndOffsetInParent - fContext.fOffsetInParent);
} }
@Override @Override

View file

@ -12,7 +12,6 @@ package org.eclipse.cdt.internal.core.parser.scanner;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.IdentityHashMap; import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
@ -657,11 +656,10 @@ public class LocationMap implements ILocationResolver {
@Override @Override
public IASTPreprocessorMacroDefinition[] getMacroDefinitions() { public IASTPreprocessorMacroDefinition[] getMacroDefinitions() {
ArrayList<Object> result= new ArrayList<Object>(); ArrayList<IASTPreprocessorMacroDefinition> result= new ArrayList<IASTPreprocessorMacroDefinition>();
for (Iterator<ASTPreprocessorNode> iterator = fDirectives.iterator(); iterator.hasNext();) { for (ASTPreprocessorNode directive : fDirectives) {
Object directive= iterator.next();
if (directive instanceof IASTPreprocessorMacroDefinition) { if (directive instanceof IASTPreprocessorMacroDefinition) {
result.add(directive); result.add((IASTPreprocessorMacroDefinition) directive);
} }
} }
return result.toArray(new IASTPreprocessorMacroDefinition[result.size()]); return result.toArray(new IASTPreprocessorMacroDefinition[result.size()]);
@ -669,11 +667,10 @@ public class LocationMap implements ILocationResolver {
@Override @Override
public IASTPreprocessorIncludeStatement[] getIncludeDirectives() { public IASTPreprocessorIncludeStatement[] getIncludeDirectives() {
ArrayList<Object> result= new ArrayList<Object>(); ArrayList<IASTPreprocessorIncludeStatement> result= new ArrayList<IASTPreprocessorIncludeStatement>();
for (Iterator<ASTPreprocessorNode> iterator = fDirectives.iterator(); iterator.hasNext();) { for (ASTPreprocessorNode directive : fDirectives) {
Object directive= iterator.next();
if (directive instanceof IASTPreprocessorIncludeStatement) { if (directive instanceof IASTPreprocessorIncludeStatement) {
result.add(directive); result.add((IASTPreprocessorIncludeStatement) directive);
} }
} }
return result.toArray(new IASTPreprocessorIncludeStatement[result.size()]); return result.toArray(new IASTPreprocessorIncludeStatement[result.size()]);