1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2013-05-17 17:26:33 -07:00
parent 53e2492c02
commit 7e77be0d90
4 changed files with 16 additions and 9 deletions

View file

@ -55,7 +55,7 @@ class PDOMCPPBase implements ICPPBase, ICPPInternalBase {
db.putRecPtr(record + CLASS_DEFINITION, classDefName.getRecord()); db.putRecPtr(record + CLASS_DEFINITION, classDefName.getRecord());
linkage.storeType(record + BASECLASS_TYPE, base.getBaseClassType()); linkage.storeType(record + BASECLASS_TYPE, base.getBaseClassType());
byte flags = (byte)(base.getVisibility() | (base.isVirtual() ? 4 : 0)); byte flags = (byte) (base.getVisibility() | (base.isVirtual() ? 4 : 0));
db.putByte(record + FLAGS, flags); db.putByte(record + FLAGS, flags);
} }
@ -128,7 +128,6 @@ class PDOMCPPBase implements ICPPBase, ICPPInternalBase {
CCorePlugin.log(e); CCorePlugin.log(e);
return 0; return 0;
} }
} }
@Override @Override
@ -166,6 +165,7 @@ class PDOMCPPBase implements ICPPBase, ICPPInternalBase {
public PDOMCPPBaseClone(ICPPBase base) { public PDOMCPPBaseClone(ICPPBase base) {
this.base = base; this.base = base;
} }
@Override @Override
public IBinding getBaseClass() { public IBinding getBaseClass() {
IType type= getBaseClassType(); IType type= getBaseClassType();
@ -174,6 +174,7 @@ class PDOMCPPBase implements ICPPBase, ICPPInternalBase {
return (IBinding) type; return (IBinding) type;
return null; return null;
} }
@Override @Override
public IType getBaseClassType() { public IType getBaseClassType() {
if (baseClass == null) { if (baseClass == null) {
@ -186,6 +187,7 @@ class PDOMCPPBase implements ICPPBase, ICPPInternalBase {
public IName getBaseClassSpecifierName() { public IName getBaseClassSpecifierName() {
return base.getBaseClassSpecifierName(); return base.getBaseClassSpecifierName();
} }
@Override @Override
public IName getClassDefinitionName() { public IName getClassDefinitionName() {
return base.getClassDefinitionName(); return base.getClassDefinitionName();
@ -195,19 +197,23 @@ class PDOMCPPBase implements ICPPBase, ICPPInternalBase {
public int getVisibility() { public int getVisibility() {
return base.getVisibility(); return base.getVisibility();
} }
@Override @Override
public boolean isVirtual() { public boolean isVirtual() {
return base.isVirtual(); return base.isVirtual();
} }
@Override @Override
public void setBaseClass(IBinding binding) { public void setBaseClass(IBinding binding) {
if (binding instanceof IType) if (binding instanceof IType)
baseClass = (IType) binding; baseClass = (IType) binding;
} }
@Override @Override
public void setBaseClass(IType binding) { public void setBaseClass(IType binding) {
baseClass = binding; baseClass = binding;
} }
@Override @Override
public ICPPBase clone() { public ICPPBase clone() {
return new PDOMCPPBaseClone(this); return new PDOMCPPBaseClone(this);

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2012 QNX Software Systems and others. * Copyright (c) 2007, 2013 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -244,7 +244,7 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
return ((ICPPClassSpecializationScope) scope).getBases(point); return ((ICPPClassSpecializationScope) scope).getBases(point);
} }
// This is an explicit specialization // This is an explicit specialization.
Long key= record + PDOMCPPLinkage.CACHE_BASES; Long key= record + PDOMCPPLinkage.CACHE_BASES;
ICPPBase[] bases= (ICPPBase[]) getPDOM().getCachedResult(key); ICPPBase[] bases= (ICPPBase[]) getPDOM().getCachedResult(key);
if (bases != null) if (bases != null)

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005, 2012 QNX Software Systems and others. * Copyright (c) 2005, 2013 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -309,8 +309,9 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
try { try {
List<PDOMCPPBase> list = new ArrayList<PDOMCPPBase>(); List<PDOMCPPBase> list = new ArrayList<PDOMCPPBase>();
for (PDOMCPPBase base = getFirstBase(); base != null; base = base.getNextBase()) for (PDOMCPPBase base = getFirstBase(); base != null; base = base.getNextBase()) {
list.add(base); list.add(base);
}
Collections.reverse(list); Collections.reverse(list);
bases = list.toArray(new ICPPBase[list.size()]); bases = list.toArray(new ICPPBase[list.size()]);
getPDOM().putCachedResult(key, bases); getPDOM().putCachedResult(key, bases);