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

Code formatting.

This commit is contained in:
Sergey Prigogin 2008-10-12 23:48:09 +00:00
parent d2c1866cb7
commit cb5c6721aa
2 changed files with 55 additions and 57 deletions

View file

@ -2086,7 +2086,6 @@ public class CPPSemantics {
currFnCost[j] = cost; currFnCost[j] = cost;
} }
hasWorse = false; hasWorse = false;
hasBetter = false; hasBetter = false;
// In order for this function to be better than the previous best, it must // In order for this function to be better than the previous best, it must

View file

@ -42,9 +42,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.OverloadableOperator;
*/ */
public class SemanticUtil { public class SemanticUtil {
private static final char[] OPERATOR_CHARS = Keywords.OPERATOR.toCharArray(); private static final char[] OPERATOR_CHARS = Keywords.OPERATOR.toCharArray();
/** // Cache of overloadable operator names for fast lookup. Used by isConversionOperator.
* Cache of overloadable operator names for fast lookup. Used by isConversionOperator.
*/
private static final CharArraySet cas= new CharArraySet(OverloadableOperator.values().length); private static final CharArraySet cas= new CharArraySet(OverloadableOperator.values().length);
static { static {
@ -56,11 +54,11 @@ public class SemanticUtil {
} }
/** /**
* Returns a list of ICPPMethod objects representing all conversion operators * Returns an array of ICPPMethod objects representing all conversion operators
* declared by the specified class. This does not include inherited methods. Conversion * declared by the specified class. This does not include inherited methods. Conversion
* operators cannot be implicit. * operators cannot be implicit.
* @param clazz * @param clazz
* @return List of ICPPMethod * @return an array of conversion operators.
*/ */
public static final ICPPMethod[] getDeclaredConversionOperators(ICPPClassType clazz) throws DOMException { public static final ICPPMethod[] getDeclaredConversionOperators(ICPPClassType clazz) throws DOMException {
ICPPMethod[] methods= new ICPPMethod[0]; ICPPMethod[] methods= new ICPPMethod[0];
@ -79,11 +77,11 @@ public class SemanticUtil {
} }
/** /**
* Returns a list of ICPPMethod objects representing all conversion operators * Returns an array of ICPPMethod objects representing all conversion operators
* declared by the specified class and its ancestors. This includes inherited * declared by the specified class and its ancestors. This includes inherited
* methods. Conversion operators cannot be implicit. * methods. Conversion operators cannot be implicit.
* @param clazz * @param clazz
* @return List of ICPPMethod * @return an array of conversion operators.
*/ */
public static ICPPMethod[] getConversionOperators(ICPPClassType clazz) throws DOMException { public static ICPPMethod[] getConversionOperators(ICPPClassType clazz) throws DOMException {
ICPPMethod[] methods= new ICPPMethod[0]; ICPPMethod[] methods= new ICPPMethod[0];
@ -175,17 +173,18 @@ public class SemanticUtil {
type= tt; type= tt;
} else if (type instanceof IQualifierType) { } else if (type instanceof IQualifierType) {
type= ((IQualifierType) type).getType(); type= ((IQualifierType) type).getType();
} else if( stopAtPointerToMember && type instanceof ICPPPointerToMemberType ) } else if (stopAtPointerToMember && type instanceof ICPPPointerToMemberType) {
return type; return type;
else if( type instanceof IPointerType ) { } else if (type instanceof IPointerType) {
if (lastPointerType!=null) { if (lastPointerType!=null) {
lastPointerType[0]= type; lastPointerType[0]= type;
} }
type= ((IPointerType) type).getType(); type= ((IPointerType) type).getType();
} else if (type instanceof ICPPReferenceType) { } else if (type instanceof ICPPReferenceType) {
type= ((ICPPReferenceType) type).getType(); type= ((ICPPReferenceType) type).getType();
} else } else {
return type; return type;
}
} }
} catch (DOMException e) { } catch (DOMException e) {
@ -211,9 +210,10 @@ public class SemanticUtil {
type = ((IQualifierType) type).getType(); type = ((IQualifierType) type).getType();
} else if (type instanceof ICPPReferenceType) { } else if (type instanceof ICPPReferenceType) {
type = ((ICPPReferenceType) type).getType(); type = ((ICPPReferenceType) type).getType();
} else } else {
return type; return type;
} }
}
} catch (DOMException e) { } catch (DOMException e) {
return e.getProblem(); return e.getProblem();
} }
@ -292,5 +292,4 @@ public class SemanticUtil {
} }
return result; return result;
} }
} }