mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Code formatting.
This commit is contained in:
parent
b3f4a2c33c
commit
0581a953b4
4 changed files with 25 additions and 29 deletions
|
@ -74,7 +74,6 @@ public class PDOMQualifierType extends PDOMNode implements IQualifierType, ICQua
|
||||||
} catch (DOMException e) {
|
} catch (DOMException e) {
|
||||||
throw new CoreException(Util.createStatus(e));
|
throw new CoreException(Util.createStatus(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -129,19 +128,19 @@ public class PDOMQualifierType extends PDOMNode implements IQualifierType, ICQua
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSameType(IType type) {
|
public boolean isSameType(IType type) {
|
||||||
if( type instanceof ITypedef )
|
if (type instanceof ITypedef)
|
||||||
return type.isSameType( this );
|
return type.isSameType(this);
|
||||||
if( !( type instanceof IQualifierType ) )
|
if (!(type instanceof IQualifierType))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
IQualifierType pt = (IQualifierType) type;
|
IQualifierType pt = (IQualifierType) type;
|
||||||
try {
|
try {
|
||||||
boolean flagsMatch= isConst() == pt.isConst() && isVolatile() == pt.isVolatile();
|
boolean flagsMatch= isConst() == pt.isConst() && isVolatile() == pt.isVolatile();
|
||||||
if(flagsMatch && (type instanceof ICQualifierType))
|
if (flagsMatch && type instanceof ICQualifierType)
|
||||||
flagsMatch &= isRestrict() == ((ICQualifierType)type).isRestrict();
|
flagsMatch &= isRestrict() == ((ICQualifierType) type).isRestrict();
|
||||||
if(flagsMatch) {
|
if (flagsMatch) {
|
||||||
IType myType= getType();
|
IType myType= getType();
|
||||||
return myType != null && myType.isSameType( pt.getType() );
|
return myType != null && myType.isSameType(pt.getType());
|
||||||
}
|
}
|
||||||
} catch (DOMException e) {
|
} catch (DOMException e) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class PDOMCFunctionType extends PDOMNode implements IIndexType, IFunction
|
||||||
}
|
}
|
||||||
list.addMember(typeNode);
|
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 {
|
public void delete(final PDOMLinkage linkage) throws CoreException {
|
||||||
linkage.deleteType(getReturnType(), record);
|
linkage.deleteType(getReturnType(), record);
|
||||||
PDOMNodeLinkedList list = new PDOMNodeLinkedList(pdom, record + TYPELIST, getLinkageImpl(), true);
|
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 void leave(IPDOMNode node) throws CoreException {
|
||||||
}
|
}
|
||||||
public boolean visit(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[] params1= getParameterTypes();
|
||||||
IType[] params2= ft.getParameterTypes();
|
IType[] params2= ft.getParameterTypes();
|
||||||
if( params1.length == 1 && params2.length == 0 ){
|
if (params1.length == 1 && params2.length == 0) {
|
||||||
if( !(params1[0] instanceof IBasicType) || ((IBasicType)params1[0]).getType() != IBasicType.t_void )
|
if (!(params1[0] instanceof IBasicType) || ((IBasicType)params1[0]).getType() != IBasicType.t_void)
|
||||||
return false;
|
return false;
|
||||||
} else if( params2.length == 1 && params1.length == 0 ){
|
} else if (params2.length == 1 && params1.length == 0) {
|
||||||
if( !(params2[0] instanceof IBasicType) || ((IBasicType)params2[0]).getType() != IBasicType.t_void )
|
if (!(params2[0] instanceof IBasicType) || ((IBasicType) params2[0]).getType() != IBasicType.t_void)
|
||||||
return false;
|
return false;
|
||||||
} else if( params1.length != params2.length ){
|
} else if (params1.length != params2.length) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
for( int i = 0; i < params1.length; i++ ){
|
for (int i = 0; i < params1.length; i++) {
|
||||||
if (params1[i] == null || ! params1[i].isSameType( params2[i] ) )
|
if (params1[i] == null || !params1[i].isSameType(params2[i]))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,12 +146,11 @@ public class PDOMCFunctionType extends PDOMNode implements IIndexType, IFunction
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public IType[] getParameterTypes() {
|
public IType[] getParameterTypes() {
|
||||||
final List<IType> result= new ArrayList<IType>();
|
final List<IType> result= new ArrayList<IType>();
|
||||||
try {
|
try {
|
||||||
PDOMNodeLinkedList list = new PDOMNodeLinkedList(pdom, record + TYPELIST, getLinkageImpl(), true);
|
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 void leave(IPDOMNode node) throws CoreException {
|
||||||
result.add((IType)node);
|
result.add((IType)node);
|
||||||
}
|
}
|
||||||
|
@ -159,7 +158,7 @@ public class PDOMCFunctionType extends PDOMNode implements IIndexType, IFunction
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch(CoreException ce) {
|
} catch (CoreException ce) {
|
||||||
CCorePlugin.log(ce);
|
CCorePlugin.log(ce);
|
||||||
}
|
}
|
||||||
return result.toArray(new IType[result.size()]);
|
return result.toArray(new IType[result.size()]);
|
||||||
|
|
|
@ -92,10 +92,10 @@ class PDOMCPPClassInstance extends PDOMCPPClassSpecialization implements ICPPTem
|
||||||
|
|
||||||
// require a class instance
|
// require a class instance
|
||||||
if (type instanceof ICPPClassSpecialization == false ||
|
if (type instanceof ICPPClassSpecialization == false ||
|
||||||
type instanceof ICPPTemplateInstance == false || type instanceof IProblemBinding)
|
type instanceof ICPPTemplateInstance == false || type instanceof IProblemBinding) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
final ICPPClassSpecialization classSpec2 = (ICPPClassSpecialization) type;
|
final ICPPClassSpecialization classSpec2 = (ICPPClassSpecialization) type;
|
||||||
final ICPPClassType orig1= getSpecializedBinding();
|
final ICPPClassType orig1= getSpecializedBinding();
|
||||||
final ICPPClassType orig2= classSpec2.getSpecializedBinding();
|
final ICPPClassType orig2= classSpec2.getSpecializedBinding();
|
||||||
|
|
|
@ -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.cdt.internal.core.pdom.dom.PDOMNotImplementedError;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
class PDOMCPPReferenceType extends PDOMNode implements ICPPReferenceType,
|
class PDOMCPPReferenceType extends PDOMNode implements ICPPReferenceType, ITypeContainer, IIndexType {
|
||||||
ITypeContainer, IIndexType {
|
|
||||||
|
|
||||||
private static final int TYPE = PDOMNode.RECORD_SIZE + 0;
|
private static final int TYPE = PDOMNode.RECORD_SIZE + 0;
|
||||||
|
|
||||||
|
@ -71,8 +70,7 @@ class PDOMCPPReferenceType extends PDOMNode implements ICPPReferenceType,
|
||||||
public int getNodeType() {
|
public int getNodeType() {
|
||||||
return IIndexCPPBindingConstants.CPP_REFERENCE_TYPE;
|
return IIndexCPPBindingConstants.CPP_REFERENCE_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public IType getType() {
|
public IType getType() {
|
||||||
try {
|
try {
|
||||||
PDOMNode node = getLinkageImpl().getNode(pdom.getDB().getInt(record + TYPE));
|
PDOMNode node = getLinkageImpl().getNode(pdom.getDB().getInt(record + TYPE));
|
||||||
|
@ -84,10 +82,10 @@ class PDOMCPPReferenceType extends PDOMNode implements ICPPReferenceType,
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSameType(IType type) {
|
public boolean isSameType(IType type) {
|
||||||
if( type instanceof ITypedef )
|
if (type instanceof ITypedef)
|
||||||
return type.isSameType(this);
|
return type.isSameType(this);
|
||||||
|
|
||||||
if( !( type instanceof ICPPReferenceType ))
|
if (!(type instanceof ICPPReferenceType))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ICPPReferenceType rhs = (ICPPReferenceType) type;
|
ICPPReferenceType rhs = (ICPPReferenceType) type;
|
||||||
|
|
Loading…
Add table
Reference in a new issue