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

Cosmetics.

This commit is contained in:
Sergey Prigogin 2011-03-15 20:56:50 +00:00
parent 3b373bb5a5
commit ff5997789d

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Andrew Niefer (IBM Corporation) - Initial API and implementation * Andrew Niefer (IBM Corporation) - Initial API and implementation
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp; package org.eclipse.cdt.internal.core.dom.parser.cpp;
@ -31,9 +31,8 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
import org.eclipse.core.runtime.PlatformObject; import org.eclipse.core.runtime.PlatformObject;
public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContainer, ICPPInternalBinding { public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContainer, ICPPInternalBinding {
private IASTName[] declarations;
private IASTName[] declarations = null; private IType type;
private IType type = null;
public CPPTypedef(IASTName name) { public CPPTypedef(IASTName name) {
// bug 223020 even though qualified names are not legal, we need to deal with them. // bug 223020 even though qualified names are not legal, we need to deal with them.
@ -120,6 +119,7 @@ public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContain
} }
return t; return t;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IBinding#getFullyQualifiedName() * @see org.eclipse.cdt.core.dom.ast.IBinding#getFullyQualifiedName()
*/ */
@ -162,12 +162,10 @@ public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContain
if (node instanceof IASTName) { if (node instanceof IASTName) {
if (node.getParent() instanceof ICPPASTQualifiedName) { if (node.getParent() instanceof ICPPASTQualifiedName) {
name= (IASTName) node.getParent(); name= (IASTName) node.getParent();
} } else {
else {
name= (IASTName) node; name= (IASTName) node;
} }
} } else {
else {
return; return;
} }
@ -176,7 +174,7 @@ public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContain
} else { } else {
// keep the lowest offset declaration in [0] // keep the lowest offset declaration in [0]
if (declarations.length > 0 && if (declarations.length > 0 &&
((ASTNode )node).getOffset() < ((ASTNode) declarations[0]).getOffset()) { ((ASTNode) node).getOffset() < ((ASTNode) declarations[0]).getOffset()) {
declarations = (IASTName[]) ArrayUtil.prepend(IASTName.class, declarations, name); declarations = (IASTName[]) ArrayUtil.prepend(IASTName.class, declarations, name);
} else { } else {
declarations = (IASTName[]) ArrayUtil.append(IASTName.class, declarations, name); declarations = (IASTName[]) ArrayUtil.append(IASTName.class, declarations, name);