1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 23:05:47 +02:00

Code formatting.

This commit is contained in:
Sergey Prigogin 2009-02-23 02:29:53 +00:00
parent b81800cca4
commit 540907f410

View file

@ -23,7 +23,6 @@ import org.eclipse.cdt.internal.core.index.IIndexType;
* Integral c++ type. * Integral c++ type.
*/ */
public class CPPBasicType implements ICPPBasicType { public class CPPBasicType implements ICPPBasicType {
protected int qualifierBits = 0; protected int qualifierBits = 0;
protected int type; protected int type;
protected IASTExpression expression = null; protected IASTExpression expression = null;
@ -32,9 +31,9 @@ public class CPPBasicType implements ICPPBasicType {
type = t; type = t;
qualifierBits = bits; qualifierBits = bits;
if (type == IBasicType.t_unspecified) { if (type == IBasicType.t_unspecified &&
if ((qualifierBits & (IS_LONG | IS_SHORT | IS_SIGNED | IS_UNSIGNED)) != 0) (qualifierBits & (IS_LONG | IS_SHORT | IS_SIGNED | IS_UNSIGNED)) != 0) {
type = IBasicType.t_int; type = IBasicType.t_int;
} }
} }
@ -44,29 +43,30 @@ public class CPPBasicType implements ICPPBasicType {
expression= fromExpression; expression= fromExpression;
} }
public boolean isSameType( IType object ) { public boolean isSameType(IType object) {
if( object == this ) if (object == this)
return true; return true;
if( object instanceof ITypedef || object instanceof IIndexType) if (object instanceof ITypedef || object instanceof IIndexType)
return object.isSameType( this ); return object.isSameType(this);
if( !(object instanceof CPPBasicType) ) if (!(object instanceof CPPBasicType))
return false; return false;
if( type == -1 ) if (type == -1)
return false; return false;
CPPBasicType t = (CPPBasicType) object; CPPBasicType t = (CPPBasicType) object;
if( type != t.type ) if (type != t.type)
return false; return false;
if( type == IBasicType.t_int ){ if (type == IBasicType.t_int) {
//signed int and int are equivalent //signed int and int are equivalent
return (qualifierBits & ~IS_SIGNED ) == (t.qualifierBits & ~IS_SIGNED ); return (qualifierBits & ~IS_SIGNED) == (t.qualifierBits & ~IS_SIGNED);
} }
return ( type == t.type && qualifierBits == t.qualifierBits ); return (type == t.type && qualifierBits == t.qualifierBits);
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IBasicType#getType() * @see org.eclipse.cdt.core.dom.ast.IBasicType#getType()
*/ */
@ -78,36 +78,36 @@ public class CPPBasicType implements ICPPBasicType {
* @see org.eclipse.cdt.core.dom.ast.IBasicType#isSigned() * @see org.eclipse.cdt.core.dom.ast.IBasicType#isSigned()
*/ */
public boolean isSigned() { public boolean isSigned() {
return ( qualifierBits & IS_SIGNED ) != 0; return (qualifierBits & IS_SIGNED) != 0;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IBasicType#isUnsigned() * @see org.eclipse.cdt.core.dom.ast.IBasicType#isUnsigned()
*/ */
public boolean isUnsigned() { public boolean isUnsigned() {
return ( qualifierBits & IS_UNSIGNED ) != 0; return (qualifierBits & IS_UNSIGNED) != 0;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IBasicType#isShort() * @see org.eclipse.cdt.core.dom.ast.IBasicType#isShort()
*/ */
public boolean isShort() { public boolean isShort() {
return ( qualifierBits & IS_SHORT) != 0; return (qualifierBits & IS_SHORT) != 0;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IBasicType#isLong() * @see org.eclipse.cdt.core.dom.ast.IBasicType#isLong()
*/ */
public boolean isLong() { public boolean isLong() {
return ( qualifierBits & IS_LONG ) != 0; return (qualifierBits & IS_LONG) != 0;
} }
@Override @Override
public Object clone(){ public Object clone() {
IType t = null; IType t = null;
try { try {
t = (IType) super.clone(); t = (IType) super.clone();
} catch ( CloneNotSupportedException e ) { } catch (CloneNotSupportedException e) {
//not going to happen //not going to happen
} }
return t; return t;