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-01-09 18:09:55 -08:00
parent 6985289cff
commit 14d94dafe0
4 changed files with 9 additions and 14 deletions

View file

@ -28,7 +28,6 @@ import org.eclipse.cdt.internal.core.dom.parser.VariableReadWriteFlags;
* with the variable. * with the variable.
*/ */
public final class CVariableReadWriteFlags extends VariableReadWriteFlags { public final class CVariableReadWriteFlags extends VariableReadWriteFlags {
private static CVariableReadWriteFlags INSTANCE= new CVariableReadWriteFlags(); private static CVariableReadWriteFlags INSTANCE= new CVariableReadWriteFlags();
public static int getReadWriteFlags(IASTName variable) { public static int getReadWriteFlags(IASTName variable) {
@ -73,15 +72,14 @@ public final class CVariableReadWriteFlags extends VariableReadWriteFlags {
if (indirection == 0) { if (indirection == 0) {
return READ; return READ;
} }
while(indirection > 0 && (type instanceof IPointerType)) { while (indirection > 0 && (type instanceof IPointerType)) {
type= ((IPointerType) type).getType(); type= ((IPointerType) type).getType();
indirection--; indirection--;
} }
if (indirection == 0) { if (indirection == 0) {
if (type instanceof IQualifierType) { if (type instanceof IQualifierType) {
return ((IQualifierType) type).isConst() ? READ : READ | WRITE; return ((IQualifierType) type).isConst() ? READ : READ | WRITE;
} } else if (type instanceof IPointerType) {
else if (type instanceof IPointerType) {
return ((IPointerType) type).isConst() ? READ : READ | WRITE; return ((IPointerType) type).isConst() ? READ : READ | WRITE;
} }
} }

View file

@ -35,7 +35,6 @@ import org.eclipse.cdt.internal.core.dom.parser.VariableReadWriteFlags;
* with the variable. * with the variable.
*/ */
public final class CPPVariableReadWriteFlags extends VariableReadWriteFlags { public final class CPPVariableReadWriteFlags extends VariableReadWriteFlags {
private static CPPVariableReadWriteFlags INSTANCE= new CPPVariableReadWriteFlags(); private static CPPVariableReadWriteFlags INSTANCE= new CPPVariableReadWriteFlags();
public static int getReadWriteFlags(IASTName variable) { public static int getReadWriteFlags(IASTName variable) {
@ -109,8 +108,7 @@ public final class CPPVariableReadWriteFlags extends VariableReadWriteFlags {
if (indirection == 0) { if (indirection == 0) {
if (type instanceof IQualifierType) { if (type instanceof IQualifierType) {
return ((IQualifierType) type).isConst() ? READ : READ | WRITE; return ((IQualifierType) type).isConst() ? READ : READ | WRITE;
} } else if (type instanceof IPointerType) {
else if (type instanceof IPointerType) {
return ((IPointerType) type).isConst() ? READ : READ | WRITE; return ((IPointerType) type).isConst() ? READ : READ | WRITE;
} }
} }

View file

@ -21,7 +21,6 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVariableReadWri
import org.eclipse.cdt.internal.core.pdom.dom.PDOMName; import org.eclipse.cdt.internal.core.pdom.dom.PDOMName;
public class CSearchUtil { public class CSearchUtil {
public static int LRU_WORKINGSET_LIST_SIZE= 3; public static int LRU_WORKINGSET_LIST_SIZE= 3;
private static LRUWorkingSets workingSetsCache; private static LRUWorkingSets workingSetsCache;
@ -44,10 +43,10 @@ public class CSearchUtil {
} }
public static String toString(IWorkingSet[] workingSets) { public static String toString(IWorkingSet[] workingSets) {
if( workingSets != null && workingSets.length > 0 ){ if (workingSets != null && workingSets.length > 0) {
String string = new String(); String string = new String();
for( int i = 0; i < workingSets.length; i++ ){ for (int i = 0; i < workingSets.length; i++) {
if( i > 0 ) if (i > 0)
string += ", "; //$NON-NLS-1$ string += ", "; //$NON-NLS-1$
string += workingSets[i].getName(); string += workingSets[i].getName();
} }
@ -62,8 +61,7 @@ public class CSearchUtil {
boolean isWrite; boolean isWrite;
if (binding instanceof ICPPVariable) { if (binding instanceof ICPPVariable) {
isWrite = ((CPPVariableReadWriteFlags.getReadWriteFlags(node) & PDOMName.WRITE_ACCESS) != 0); isWrite = ((CPPVariableReadWriteFlags.getReadWriteFlags(node) & PDOMName.WRITE_ACCESS) != 0);
} } else {
else {
isWrite = ((CVariableReadWriteFlags.getReadWriteFlags(node) & PDOMName.WRITE_ACCESS) != 0); isWrite = ((CVariableReadWriteFlags.getReadWriteFlags(node) & PDOMName.WRITE_ACCESS) != 0);
} }
return isWrite; return isWrite;

View file

@ -39,7 +39,8 @@ public class LineSearchElement extends PDOMSearchElement {
private final ICElement fEnclosingElement; private final ICElement fEnclosingElement;
private final boolean fIsWriteAccess; private final boolean fIsWriteAccess;
public Match(int offset, int length, boolean isPolymorphicCall, ICElement enclosingElement, boolean isWriteAccess) { public Match(int offset, int length, boolean isPolymorphicCall, ICElement enclosingElement,
boolean isWriteAccess) {
fOffset = offset; fOffset = offset;
fLength = length; fLength = length;
fIsPolymorphicCall = isPolymorphicCall; fIsPolymorphicCall = isPolymorphicCall;