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

Cosmetics.

This commit is contained in:
Sergey Prigogin 2012-08-04 18:13:00 -07:00
parent e932abc78a
commit 58e4809932
8 changed files with 56 additions and 61 deletions

View file

@ -211,7 +211,7 @@ public class CPPBasicType implements ICPPBasicType, ISerializableType {
int modifiers= 0;
int kind;
if (dense) {
kind= (firstByte & (ITypeMarshalBuffer.FLAG4-1))/ITypeMarshalBuffer.FLAG1;
kind= (firstByte & (ITypeMarshalBuffer.FLAG4 - 1)) / ITypeMarshalBuffer.FLAG1;
} else {
kind= buffer.getByte();
modifiers= buffer.getByte();

View file

@ -796,12 +796,13 @@ public class CPPTemplates {
IType[] exceptionSpecs= instantiateTypes(func.getExceptionSpecification(), tpMap, -1, within, point);
if (decl instanceof ICPPFunctionTemplate) {
if (decl instanceof ICPPConstructor)
if (decl instanceof ICPPConstructor) {
spec = new CPPConstructorTemplateSpecialization((ICPPConstructor) decl, owner, tpMap, type, exceptionSpecs);
else if (decl instanceof ICPPMethod)
} else if (decl instanceof ICPPMethod) {
spec = new CPPMethodTemplateSpecialization((ICPPMethod) decl, owner, tpMap, type, exceptionSpecs);
else
} else {
spec = new CPPFunctionTemplateSpecialization((ICPPFunctionTemplate) decl, owner, tpMap, type, exceptionSpecs);
}
} else if (decl instanceof ICPPConstructor) {
spec = new CPPConstructorSpecialization((ICPPConstructor) decl, owner, tpMap, type, exceptionSpecs);
} else if (decl instanceof ICPPMethod) {
@ -1265,11 +1266,11 @@ public class CPPTemplates {
}
/**
* Checks whether a given name corresponds to a template declaration and returns the ast node for it.
* This works for the name of a template-definition and also for a name needed to qualify a member
* definition:
* Checks whether a given name corresponds to a template declaration and returns the AST node
* for it. This works for the name of a template-definition and also for a name needed to
* qualify a member definition:
* <pre>
* template &lttypename T&gt void MyTemplate&ltT&gt::member() {}
* template &lt;typename T&gt; void MyTemplate&ltT&gt;::member() {}
* </pre>
* @param name a name for which the corresponding template declaration is searched for.
* @return the template declaration or <code>null</code> if <code>name</code> does not
@ -1614,10 +1615,11 @@ public class CPPTemplates {
name = dtor.getName();
} else if (simple.getDeclarators().length == 0) {
IASTDeclSpecifier spec = simple.getDeclSpecifier();
if (spec instanceof ICPPASTCompositeTypeSpecifier)
if (spec instanceof ICPPASTCompositeTypeSpecifier) {
name = ((ICPPASTCompositeTypeSpecifier) spec).getName();
else if (spec instanceof ICPPASTElaboratedTypeSpecifier)
} else if (spec instanceof ICPPASTElaboratedTypeSpecifier) {
name = ((ICPPASTElaboratedTypeSpecifier) spec).getName();
}
}
} else if (nestedDecl instanceof IASTFunctionDefinition) {
IASTDeclarator declarator = ((IASTFunctionDefinition) nestedDecl).getDeclarator();
@ -1633,11 +1635,10 @@ public class CPPTemplates {
if (currDecl == templateDecl) {
return ns[j];
}
if (currDecl instanceof ICPPASTTemplateDeclaration) {
currDecl = ((ICPPASTTemplateDeclaration) currDecl).getDeclaration();
} else {
if (!(currDecl instanceof ICPPASTTemplateDeclaration)) {
return null;
}
currDecl = ((ICPPASTTemplateDeclaration) currDecl).getDeclaration();
}
}
} else {
@ -2361,7 +2362,7 @@ public class CPPTemplates {
public static boolean containsDependentArg(ObjectMap tpMap) {
for (Object arg : tpMap.valueArray()) {
if (isDependentType((IType)arg))
if (isDependentType((IType) arg))
return true;
}
return false;
@ -2395,9 +2396,9 @@ public class CPPTemplates {
}
} else if (!t.equals(owner)) {
if (unknown instanceof ICPPUnknownClassType) {
result= new CPPUnknownClass((ICPPUnknownBinding)t, unknown.getNameCharArray());
result= new CPPUnknownClass((ICPPUnknownBinding) t, unknown.getNameCharArray());
} else if (unknown instanceof IFunction) {
result= new CPPUnknownClass((ICPPUnknownBinding)t, unknown.getNameCharArray());
result= new CPPUnknownClass((ICPPUnknownBinding) t, unknown.getNameCharArray());
} else {
result= new CPPUnknownBinding((ICPPUnknownBinding) t, unknown.getNameCharArray());
}

View file

@ -6,9 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - initial API and implementation
* Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.index;
import org.eclipse.cdt.core.dom.ast.IType;
@ -18,5 +17,4 @@ import org.eclipse.cdt.core.dom.ast.IType;
* @since 4.0
*/
public interface IIndexType extends IType {
}

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn (Wind River Systems) - initial API and implementation
* Markus Schorn (Wind River Systems) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@ -24,7 +24,6 @@ import org.eclipse.core.runtime.CoreException;
* serves as a base for unknown types.
*/
class PDOMCPPUnknownBinding extends PDOMCPPBinding implements ICPPUnknownBinding {
@SuppressWarnings("hiding")
protected static final int RECORD_SIZE = PDOMCPPBinding.RECORD_SIZE;

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Sergey Prigogin (Google) - initial API and implementation
* Markus Schorn (Wind River Systems)
* Sergey Prigogin (Google) - initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@ -31,7 +31,6 @@ import org.eclipse.core.runtime.CoreException;
* @author Sergey Prigogin
*/
class PDOMCPPUnknownClassInstance extends PDOMCPPUnknownClassType implements ICPPUnknownClassInstance, IPDOMOverloader {
private static final int ARGUMENTS = PDOMCPPUnknownClassType.RECORD_SIZE + 0;
private static final int SIGNATURE_HASH = ARGUMENTS + 4;
@ -54,7 +53,6 @@ class PDOMCPPUnknownClassInstance extends PDOMCPPUnknownClassType implements ICP
db.putInt(record + SIGNATURE_HASH, sigHash != null ? sigHash.intValue() : 0);
} catch (DOMException e) {
}
}
public PDOMCPPUnknownClassInstance(PDOMLinkage linkage, long bindingRecord) {
@ -80,7 +78,7 @@ class PDOMCPPUnknownClassInstance extends PDOMCPPUnknownClassType implements ICP
public ICPPTemplateArgument[] getArguments() {
if (arguments == null) {
try {
final long rec= getPDOM().getDB().getRecPtr(record+ARGUMENTS);
final long rec= getPDOM().getDB().getRecPtr(record + ARGUMENTS);
arguments= PDOMCPPArgumentList.getArguments(this, rec);
} catch (CoreException e) {
CCorePlugin.log(e);

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Sergey Prigogin (Google) - initial API and implementation
* Markus Schorn (Wind River Systems)
* Sergey Prigogin (Google) - initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@ -45,9 +45,8 @@ import org.eclipse.core.runtime.CoreException;
/**
* @author Sergey Prigogin
*/
class PDOMCPPUnknownClassType extends PDOMCPPUnknownBinding implements ICPPClassScope, ICPPUnknownClassType,
IPDOMMemberOwner, IIndexType, IIndexScope {
class PDOMCPPUnknownClassType extends PDOMCPPUnknownBinding
implements ICPPClassScope, ICPPUnknownClassType, IPDOMMemberOwner, IIndexType, IIndexScope {
private static final int KEY = PDOMCPPBinding.RECORD_SIZE + 0; // byte
private static final int MEMBERLIST = PDOMCPPBinding.RECORD_SIZE + 4;
@SuppressWarnings("hiding")
@ -59,7 +58,7 @@ class PDOMCPPUnknownClassType extends PDOMCPPUnknownBinding implements ICPPClass
super(linkage, parent, classType);
setKind(classType);
// linked list is initialized by storage being zero'd by malloc
// Linked list is initialized by storage being zero'd by malloc
}
public PDOMCPPUnknownClassType(PDOMLinkage linkage, long bindingRecord) {
@ -245,7 +244,7 @@ class PDOMCPPUnknownClassType extends PDOMCPPUnknownBinding implements ICPPClass
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IType#isSameType(org.eclipse.cdt.core.dom.ast.IType)
* @see IType#isSameType(IType)
*/
@Override
public boolean isSameType(IType type) {
@ -263,8 +262,8 @@ class PDOMCPPUnknownClassType extends PDOMCPPUnknownBinding implements ICPPClass
}
if (type instanceof ICPPUnknownClassType
&& type instanceof ICPPUnknownClassInstance == false
&& type instanceof ICPPDeferredClassInstance == false) {
&& !(type instanceof ICPPUnknownClassInstance)
&& !(type instanceof ICPPDeferredClassInstance)) {
ICPPUnknownClassType rhs= (ICPPUnknownClassType) type;
if (CharArrayUtils.equals(getNameCharArray(), rhs.getNameCharArray())) {
final IBinding lhsContainer = getOwner();

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - initial API and implementation
* Sergey Prigogin (Google)
* Markus Schorn - initial API and implementation
* Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;