1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Code formatting.

This commit is contained in:
Sergey Prigogin 2008-12-26 04:20:37 +00:00
parent 6ea85657c4
commit fb3b1587e1
4 changed files with 13 additions and 13 deletions

View file

@ -86,8 +86,7 @@ public class ASTTypeUtil {
if (parameters.length == 0) { if (parameters.length == 0) {
return false; return false;
} else if (parameters.length == 1) { } else if (parameters.length == 1) {
IType ultimateType = SemanticUtil IType ultimateType = SemanticUtil.getUltimateTypeViaTypedefs(parameters[0].getType());
.getUltimateTypeViaTypedefs(parameters[0].getType());
if (ultimateType instanceof IBasicType) { if (ultimateType instanceof IBasicType) {
if (((IBasicType) ultimateType).getType() == IBasicType.t_void) { if (((IBasicType) ultimateType).getType() == IBasicType.t_void) {
@ -514,7 +513,7 @@ public class ASTTypeUtil {
*/ */
public static String getType(IASTDeclarator decltor) { public static String getType(IASTDeclarator decltor) {
// get the most nested declarator // get the most nested declarator
while(decltor.getNestedDeclarator() != null) while (decltor.getNestedDeclarator() != null)
decltor = decltor.getNestedDeclarator(); decltor = decltor.getNestedDeclarator();
IBinding binding = decltor.getName().resolveBinding(); IBinding binding = decltor.getName().resolveBinding();
@ -559,7 +558,9 @@ public class ASTTypeUtil {
return getType((IType)((IASTName) node).resolveBinding()); return getType((IType)((IASTName) node).resolveBinding());
if (node instanceof IASTTypeId) if (node instanceof IASTTypeId)
return getType((IASTTypeId) node); return getType((IASTTypeId) node);
} catch (DOMException e) { return EMPTY_STRING; } } catch (DOMException e) {
return EMPTY_STRING;
}
return EMPTY_STRING; return EMPTY_STRING;
} }
@ -681,8 +682,7 @@ public class ASTTypeUtil {
IASTNode node= null; IASTNode node= null;
if (binding instanceof ICInternalBinding) { if (binding instanceof ICInternalBinding) {
node= ((ICInternalBinding) binding).getPhysicalNode(); node= ((ICInternalBinding) binding).getPhysicalNode();
} } else if (binding instanceof ICPPInternalBinding) {
else if (binding instanceof ICPPInternalBinding) {
node= ((ICPPInternalBinding) binding).getDefinition(); node= ((ICPPInternalBinding) binding).getDefinition();
} }
if (node != null) { if (node != null) {

View file

@ -2040,7 +2040,8 @@ public class CPPSemantics {
if (data.forFunctionDeclaration()) if (data.forFunctionDeclaration())
return firstViable; return firstViable;
final IType[] sourceParameters = getSourceParameterTypes(data.functionParameters); // the parameters the function is being called with // The parameters the function is being called with
final IType[] sourceParameters = getSourceParameterTypes(data.functionParameters);
if (CPPTemplates.containsDependentType(sourceParameters)) { if (CPPTemplates.containsDependentType(sourceParameters)) {
if (viableCount == 1) if (viableCount == 1)
return firstViable; return firstViable;

View file

@ -22,20 +22,19 @@ public class CompositeFunctionType extends CompositeType implements IFunctionTyp
} }
public IType[] getParameterTypes() throws DOMException { public IType[] getParameterTypes() throws DOMException {
IType[] result = ((IFunctionType)type).getParameterTypes(); IType[] result = ((IFunctionType) type).getParameterTypes();
for(int i=0; i<result.length; i++) { for (int i = 0; i < result.length; i++) {
result[i] = cf.getCompositeType((IIndexType)result[i]); result[i] = cf.getCompositeType((IIndexType)result[i]);
} }
return result; return result;
} }
public IType getReturnType() throws DOMException { public IType getReturnType() throws DOMException {
return cf.getCompositeType((IIndexType)((IFunctionType)type).getReturnType()); return cf.getCompositeType((IIndexType) ((IFunctionType) type).getReturnType());
} }
@Override @Override
public boolean isSameType(IType other) { public boolean isSameType(IType other) {
return type.isSameType(other); return type.isSameType(other);
} }
} }

View file

@ -24,7 +24,7 @@ public class CompositeTypeContainer extends CompositeType implements ITypeContai
} }
public final IType getType() throws DOMException { public final IType getType() throws DOMException {
return cf.getCompositeType((IIndexType)((ITypeContainer)type).getType()); return cf.getCompositeType((IIndexType) ((ITypeContainer) type).getType());
} }
@Override @Override