1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Code formatting.

This commit is contained in:
Sergey Prigogin 2008-12-01 03:49:09 +00:00
parent b3f4a2c33c
commit 0581a953b4
4 changed files with 25 additions and 29 deletions

View file

@ -74,7 +74,6 @@ public class PDOMQualifierType extends PDOMNode implements IQualifierType, ICQua
} catch (DOMException e) {
throw new CoreException(Util.createStatus(e));
}
}
@Override
@ -129,19 +128,19 @@ public class PDOMQualifierType extends PDOMNode implements IQualifierType, ICQua
}
public boolean isSameType(IType type) {
if( type instanceof ITypedef )
return type.isSameType( this );
if( !( type instanceof IQualifierType ) )
if (type instanceof ITypedef)
return type.isSameType(this);
if (!(type instanceof IQualifierType))
return false;
IQualifierType pt = (IQualifierType) type;
try {
boolean flagsMatch= isConst() == pt.isConst() && isVolatile() == pt.isVolatile();
if(flagsMatch && (type instanceof ICQualifierType))
flagsMatch &= isRestrict() == ((ICQualifierType)type).isRestrict();
if(flagsMatch) {
if (flagsMatch && type instanceof ICQualifierType)
flagsMatch &= isRestrict() == ((ICQualifierType) type).isRestrict();
if (flagsMatch) {
IType myType= getType();
return myType != null && myType.isSameType( pt.getType() );
return myType != null && myType.isSameType(pt.getType());
}
} catch (DOMException e) {
}

View file

@ -73,7 +73,7 @@ public class PDOMCFunctionType extends PDOMNode implements IIndexType, IFunction
}
list.addMember(typeNode);
}
} catch(DOMException de) {
} catch (DOMException de) {
}
}
@ -81,7 +81,7 @@ public class PDOMCFunctionType extends PDOMNode implements IIndexType, IFunction
public void delete(final PDOMLinkage linkage) throws CoreException {
linkage.deleteType(getReturnType(), record);
PDOMNodeLinkedList list = new PDOMNodeLinkedList(pdom, record + TYPELIST, getLinkageImpl(), true);
list.accept(new IPDOMVisitor(){
list.accept(new IPDOMVisitor() {
public void leave(IPDOMNode node) throws CoreException {
}
public boolean visit(IPDOMNode node) throws CoreException {
@ -123,17 +123,17 @@ public class PDOMCFunctionType extends PDOMNode implements IIndexType, IFunction
IType[] params1= getParameterTypes();
IType[] params2= ft.getParameterTypes();
if( params1.length == 1 && params2.length == 0 ){
if( !(params1[0] instanceof IBasicType) || ((IBasicType)params1[0]).getType() != IBasicType.t_void )
if (params1.length == 1 && params2.length == 0) {
if (!(params1[0] instanceof IBasicType) || ((IBasicType)params1[0]).getType() != IBasicType.t_void)
return false;
} else if( params2.length == 1 && params1.length == 0 ){
if( !(params2[0] instanceof IBasicType) || ((IBasicType)params2[0]).getType() != IBasicType.t_void )
} else if (params2.length == 1 && params1.length == 0) {
if (!(params2[0] instanceof IBasicType) || ((IBasicType) params2[0]).getType() != IBasicType.t_void)
return false;
} else if( params1.length != params2.length ){
} else if (params1.length != params2.length) {
return false;
} else {
for( int i = 0; i < params1.length; i++ ){
if (params1[i] == null || ! params1[i].isSameType( params2[i] ) )
for (int i = 0; i < params1.length; i++) {
if (params1[i] == null || !params1[i].isSameType(params2[i]))
return false;
}
}
@ -146,12 +146,11 @@ public class PDOMCFunctionType extends PDOMNode implements IIndexType, IFunction
return false;
}
public IType[] getParameterTypes() {
final List<IType> result= new ArrayList<IType>();
try {
PDOMNodeLinkedList list = new PDOMNodeLinkedList(pdom, record + TYPELIST, getLinkageImpl(), true);
list.accept(new IPDOMVisitor(){
list.accept(new IPDOMVisitor() {
public void leave(IPDOMNode node) throws CoreException {
result.add((IType)node);
}
@ -159,7 +158,7 @@ public class PDOMCFunctionType extends PDOMNode implements IIndexType, IFunction
return false;
}
});
} catch(CoreException ce) {
} catch (CoreException ce) {
CCorePlugin.log(ce);
}
return result.toArray(new IType[result.size()]);

View file

@ -92,9 +92,9 @@ class PDOMCPPClassInstance extends PDOMCPPClassSpecialization implements ICPPTem
// require a class instance
if (type instanceof ICPPClassSpecialization == false ||
type instanceof ICPPTemplateInstance == false || type instanceof IProblemBinding)
type instanceof ICPPTemplateInstance == false || type instanceof IProblemBinding) {
return false;
}
final ICPPClassSpecialization classSpec2 = (ICPPClassSpecialization) type;
final ICPPClassType orig1= getSpecializedBinding();

View file

@ -30,8 +30,7 @@ import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNotImplementedError;
import org.eclipse.core.runtime.CoreException;
class PDOMCPPReferenceType extends PDOMNode implements ICPPReferenceType,
ITypeContainer, IIndexType {
class PDOMCPPReferenceType extends PDOMNode implements ICPPReferenceType, ITypeContainer, IIndexType {
private static final int TYPE = PDOMNode.RECORD_SIZE + 0;
@ -72,7 +71,6 @@ class PDOMCPPReferenceType extends PDOMNode implements ICPPReferenceType,
return IIndexCPPBindingConstants.CPP_REFERENCE_TYPE;
}
public IType getType() {
try {
PDOMNode node = getLinkageImpl().getNode(pdom.getDB().getInt(record + TYPE));
@ -84,10 +82,10 @@ class PDOMCPPReferenceType extends PDOMNode implements ICPPReferenceType,
}
public boolean isSameType(IType type) {
if( type instanceof ITypedef )
if (type instanceof ITypedef)
return type.isSameType(this);
if( !( type instanceof ICPPReferenceType ))
if (!(type instanceof ICPPReferenceType))
return false;
ICPPReferenceType rhs = (ICPPReferenceType) type;