mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 09:15:38 +02:00
Compiler warnings.
This commit is contained in:
parent
4619d45eef
commit
fd24289643
6 changed files with 840 additions and 840 deletions
|
@ -316,7 +316,9 @@ public class IndexProviderManagerTest extends IndexTestBase {
|
||||||
public void testIndexFactoryConfigurationUsage() throws Exception {
|
public void testIndexFactoryConfigurationUsage() throws Exception {
|
||||||
IIndex index;
|
IIndex index;
|
||||||
|
|
||||||
ICProject cproject= CProjectHelper.createCCProject("IndexFactoryConfigurationUsageTest", IPDOMManager.ID_NO_INDEXER);
|
ICProject cproject = null;
|
||||||
|
try {
|
||||||
|
cproject = CProjectHelper.createCCProject("IndexFactoryConfigurationUsageTest", IPDOMManager.ID_NO_INDEXER);
|
||||||
IProject project= cproject.getProject();
|
IProject project= cproject.getProject();
|
||||||
|
|
||||||
ICProjectDescription pd= core.getProjectDescription(project);
|
ICProjectDescription pd= core.getProjectDescription(project);
|
||||||
|
@ -327,7 +329,6 @@ public class IndexProviderManagerTest extends IndexTestBase {
|
||||||
index= CCorePlugin.getIndexManager().getIndex(cproject);
|
index= CCorePlugin.getIndexManager().getIndex(cproject);
|
||||||
CCorePlugin.getIndexManager().joinIndexer(8000, NPM);
|
CCorePlugin.getIndexManager().joinIndexer(8000, NPM);
|
||||||
|
|
||||||
try {
|
|
||||||
DPT.reset(DP1);
|
DPT.reset(DP1);
|
||||||
changeConfigRelations(project, ICProjectDescriptionPreferences.CONFIGS_LINK_SETTINGS_AND_ACTIVE);
|
changeConfigRelations(project, ICProjectDescriptionPreferences.CONFIGS_LINK_SETTINGS_AND_ACTIVE);
|
||||||
assertEquals(0, DPT.getProjectsTrace(DP1).size());
|
assertEquals(0, DPT.getProjectsTrace(DP1).size());
|
||||||
|
|
|
@ -86,7 +86,6 @@ public class CPPTemplateParameter extends PlatformObject implements ICPPTemplate
|
||||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding#isGloballyQualified()
|
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding#isGloballyQualified()
|
||||||
*/
|
*/
|
||||||
public boolean isGloballyQualified() {
|
public boolean isGloballyQualified() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -36,7 +36,6 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmentBinding {
|
public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmentBinding {
|
||||||
public static final PDOMBinding[] EMPTY_PDOMBINDING_ARRAY = {};
|
public static final PDOMBinding[] EMPTY_PDOMBINDING_ARRAY = {};
|
||||||
|
@ -72,7 +71,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
|
||||||
*
|
*
|
||||||
* @param pdom
|
* @param pdom
|
||||||
* @param record
|
* @param record
|
||||||
* @return
|
* @return <code>true</code> if the binding is orphaned.
|
||||||
* @throws CoreException
|
* @throws CoreException
|
||||||
*/
|
*/
|
||||||
public static boolean isOrphaned(PDOM pdom, int record) throws CoreException {
|
public static boolean isOrphaned(PDOM pdom, int record) throws CoreException {
|
||||||
|
@ -189,10 +188,10 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
|
||||||
public IIndexScope getParent() {
|
public IIndexScope getParent() {
|
||||||
try {
|
try {
|
||||||
IBinding parent = getParentBinding();
|
IBinding parent = getParentBinding();
|
||||||
if(parent instanceof IIndexScope) {
|
if (parent instanceof IIndexScope) {
|
||||||
return (IIndexScope) parent;
|
return (IIndexScope) parent;
|
||||||
}
|
}
|
||||||
} catch(CoreException ce) {
|
} catch (CoreException ce) {
|
||||||
CCorePlugin.log(ce);
|
CCorePlugin.log(ce);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -201,10 +200,10 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
|
||||||
public final IIndexScope getScope() {
|
public final IIndexScope getScope() {
|
||||||
try {
|
try {
|
||||||
IBinding parent = getParentBinding();
|
IBinding parent = getParentBinding();
|
||||||
if(parent instanceof IIndexScope) {
|
if (parent instanceof IIndexScope) {
|
||||||
return (IIndexScope) parent;
|
return (IIndexScope) parent;
|
||||||
}
|
}
|
||||||
} catch(CoreException ce) {
|
} catch (CoreException ce) {
|
||||||
CCorePlugin.log(ce);
|
CCorePlugin.log(ce);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -233,7 +232,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
|
||||||
public String toString() {
|
public String toString() {
|
||||||
try {
|
try {
|
||||||
return getName() + " " + getConstantNameForValue(getLinkageImpl(), getNodeType()); //$NON-NLS-1$
|
return getName() + " " + getConstantNameForValue(getLinkageImpl(), getNodeType()); //$NON-NLS-1$
|
||||||
} catch(CoreException ce) {
|
} catch (CoreException ce) {
|
||||||
return getName() + " " + getNodeType(); //$NON-NLS-1$
|
return getName() + " " + getNodeType(); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -242,7 +241,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
|
||||||
* For debug purposes only.
|
* For debug purposes only.
|
||||||
* @param linkage
|
* @param linkage
|
||||||
* @param value
|
* @param value
|
||||||
* @return
|
* @return String representation of <code>value</code>.
|
||||||
*/
|
*/
|
||||||
protected static String getConstantNameForValue(PDOMLinkage linkage, int value) {
|
protected static String getConstantNameForValue(PDOMLinkage linkage, int value) {
|
||||||
Class<? extends PDOMLinkage> c= linkage.getClass();
|
Class<? extends PDOMLinkage> c= linkage.getClass();
|
||||||
|
@ -250,16 +249,16 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
|
||||||
for (int i = 0; i < fields.length; i++) {
|
for (int i = 0; i < fields.length; i++) {
|
||||||
try {
|
try {
|
||||||
fields[i].setAccessible(true);
|
fields[i].setAccessible(true);
|
||||||
if((fields[i].getModifiers() & Modifier.STATIC) != 0) {
|
if ((fields[i].getModifiers() & Modifier.STATIC) != 0) {
|
||||||
if(int.class.equals(fields[i].getType())) {
|
if (int.class.equals(fields[i].getType())) {
|
||||||
int fvalue= fields[i].getInt(null);
|
int fvalue= fields[i].getInt(null);
|
||||||
if(fvalue == value)
|
if (fvalue == value)
|
||||||
return fields[i].getName();
|
return fields[i].getName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(IllegalAccessException iae) {
|
} catch (IllegalAccessException iae) {
|
||||||
continue;
|
continue;
|
||||||
} catch(IllegalArgumentException iae) {
|
} catch (IllegalArgumentException iae) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -269,7 +268,9 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
|
||||||
/**
|
/**
|
||||||
* Convenience method to shorten subclass file length
|
* Convenience method to shorten subclass file length
|
||||||
*/
|
*/
|
||||||
protected final void fail() { throw new PDOMNotImplementedError(); }
|
protected final void fail() {
|
||||||
|
throw new PDOMNotImplementedError("in " + getClass().getCanonicalName()); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
public PDOMName getScopeName() {
|
public PDOMName getScopeName() {
|
||||||
try {
|
try {
|
||||||
|
@ -294,7 +295,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
|
||||||
node = node.getParentNode();
|
node = node.getParentNode();
|
||||||
}
|
}
|
||||||
return result.toArray(new String[result.size()]);
|
return result.toArray(new String[result.size()]);
|
||||||
} catch(CoreException ce) {
|
} catch (CoreException ce) {
|
||||||
CCorePlugin.log(ce);
|
CCorePlugin.log(ce);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -305,7 +306,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasDefinition() throws CoreException {
|
public boolean hasDefinition() throws CoreException {
|
||||||
return getFirstDefinition()!=null;
|
return getFirstDefinition() != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -332,7 +333,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
|
||||||
do {
|
do {
|
||||||
IString s0 = b0.getDBName(), s1 = b1.getDBName();
|
IString s0 = b0.getDBName(), s1 = b1.getDBName();
|
||||||
cmp = s0.compare(s1, true);
|
cmp = s0.compare(s1, true);
|
||||||
if(cmp==0) {
|
if (cmp == 0) {
|
||||||
int l1= b0.getLocalToFileRec();
|
int l1= b0.getLocalToFileRec();
|
||||||
int l2= b1.getLocalToFileRec();
|
int l2= b1.getLocalToFileRec();
|
||||||
if (l1 != l2) {
|
if (l1 != l2) {
|
||||||
|
@ -340,13 +341,13 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
|
||||||
}
|
}
|
||||||
b0 = (PDOMBinding) b0.getParentBinding();
|
b0 = (PDOMBinding) b0.getParentBinding();
|
||||||
b1 = (PDOMBinding) b1.getParentBinding();
|
b1 = (PDOMBinding) b1.getParentBinding();
|
||||||
if(b0==null || b1==null) {
|
if (b0 == null || b1 == null) {
|
||||||
cmp = b0==b1 ? 0 : (b0==null ? -1 : 1);
|
cmp = b0 == b1 ? 0 : (b0 == null ? -1 : 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while(cmp==0 && b1!=null && b0!=null);
|
} while(cmp == 0 && b1 != null && b0 != null);
|
||||||
return cmp;
|
return cmp;
|
||||||
} catch(CoreException ce) {
|
} catch (CoreException ce) {
|
||||||
CCorePlugin.log(ce);
|
CCorePlugin.log(ce);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -356,7 +357,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
|
||||||
* Compares two PDOMBinding objects in accordance with
|
* Compares two PDOMBinding objects in accordance with
|
||||||
* {@link IIndexFragmentBindingComparator#compare(IIndexFragmentBinding, IIndexFragmentBinding)}
|
* {@link IIndexFragmentBindingComparator#compare(IIndexFragmentBinding, IIndexFragmentBinding)}
|
||||||
* @param other
|
* @param other
|
||||||
* @return
|
* @return comparison result, -1, 0, or 1.
|
||||||
*/
|
*/
|
||||||
public int pdomCompareTo(PDOMBinding other) {
|
public int pdomCompareTo(PDOMBinding other) {
|
||||||
int cmp = comparePDOMBindingQNs(this, other);
|
int cmp = comparePDOMBindingQNs(this, other);
|
||||||
|
@ -412,7 +413,8 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
|
||||||
return getBindings(name, resolve, prefix, null);
|
return getBindings(name, resolve, prefix, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix, IIndexFileSet fileSet) throws DOMException {
|
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix, IIndexFileSet fileSet)
|
||||||
|
throws DOMException {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -75,6 +75,6 @@ abstract class PDOMCPPBinding extends PDOMBinding implements ICPPBinding {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isGloballyQualified() throws DOMException {
|
public boolean isGloballyQualified() throws DOMException {
|
||||||
throw new PDOMNotImplementedError("In " + getClass().getCanonicalName()); //$NON-NLS-1$
|
throw new PDOMNotImplementedError("in " + getClass().getCanonicalName()); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,6 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Bryan Wilkinson
|
* @author Bryan Wilkinson
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
class PDOMCPPDeferredClassInstance extends PDOMCPPInstance implements
|
class PDOMCPPDeferredClassInstance extends PDOMCPPInstance implements
|
||||||
ICPPClassType, IPDOMMemberOwner, IIndexType, ICPPDeferredTemplateInstance, ICPPInternalDeferredClassInstance {
|
ICPPClassType, IPDOMMemberOwner, IIndexType, ICPPDeferredTemplateInstance, ICPPInternalDeferredClassInstance {
|
||||||
|
@ -84,7 +83,7 @@ class PDOMCPPDeferredClassInstance extends PDOMCPPInstance implements
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSameType(IType type) {
|
public boolean isSameType(IType type) {
|
||||||
if( type instanceof PDOMNode ) {
|
if (type instanceof PDOMNode) {
|
||||||
PDOMNode node = (PDOMNode) type;
|
PDOMNode node = (PDOMNode) type;
|
||||||
if (node.getPDOM() == getPDOM() && node.getRecord() == getRecord()) {
|
if (node.getPDOM() == getPDOM() && node.getRecord() == getRecord()) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -94,12 +93,13 @@ class PDOMCPPDeferredClassInstance extends PDOMCPPInstance implements
|
||||||
ICPPClassTemplate classTemplate = (ICPPClassTemplate) getTemplateDefinition();
|
ICPPClassTemplate classTemplate = (ICPPClassTemplate) getTemplateDefinition();
|
||||||
|
|
||||||
//allow some fuzziness here.
|
//allow some fuzziness here.
|
||||||
if( type instanceof ICPPDeferredTemplateInstance && type instanceof ICPPClassType ){
|
if (type instanceof ICPPDeferredTemplateInstance && type instanceof ICPPClassType) {
|
||||||
ICPPClassTemplate typeClass = (ICPPClassTemplate) ((ICPPDeferredTemplateInstance)type).getSpecializedBinding();
|
ICPPClassTemplate typeClass = (ICPPClassTemplate) ((ICPPDeferredTemplateInstance)type).getSpecializedBinding();
|
||||||
return (typeClass == classTemplate );
|
return typeClass == classTemplate;
|
||||||
} else if( type instanceof ICPPClassTemplate && classTemplate == type ){
|
} else if (type instanceof ICPPClassTemplate && classTemplate == type) {
|
||||||
return true;
|
return true;
|
||||||
} else if( type instanceof ICPPTemplateInstance && ((ICPPTemplateInstance)type).getTemplateDefinition() == classTemplate ){
|
} else if (type instanceof ICPPTemplateInstance &&
|
||||||
|
((ICPPTemplateInstance)type).getTemplateDefinition() == classTemplate) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -111,18 +111,18 @@ class PDOMCPPDeferredClassInstance extends PDOMCPPInstance implements
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param argMap
|
* @param argMap
|
||||||
* @return
|
* @return This class instance re-instantiated with resolved template arguments.
|
||||||
*/
|
*/
|
||||||
public IType instantiate(ObjectMap argMap) {
|
public IType instantiate(ObjectMap argMap) {
|
||||||
IType[] arguments = getArguments();
|
IType[] arguments = getArguments();
|
||||||
|
|
||||||
IType [] newArgs = new IType[ arguments.length ];
|
IType[] newArgs = new IType[arguments.length];
|
||||||
int size = arguments.length;
|
int size = arguments.length;
|
||||||
for( int i = 0; i < size; i++ ){
|
for (int i = 0; i < size; i++) {
|
||||||
newArgs[i] = CPPTemplates.instantiateType( arguments[i], argMap );
|
newArgs[i] = CPPTemplates.instantiateType(arguments[i], argMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (IType) ((ICPPInternalTemplateInstantiator)getTemplateDefinition()).instantiate( newArgs );
|
return (IType) ((ICPPInternalTemplateInstantiator) getTemplateDefinition()).instantiate(newArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addMember(PDOMNode member) throws CoreException {
|
public void addMember(PDOMNode member) throws CoreException {
|
||||||
|
|
Loading…
Add table
Reference in a new issue