1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-09 01:05:38 +02:00

Compiler warnings.

This commit is contained in:
Sergey Prigogin 2008-04-19 19:35:13 +00:00
parent 4619d45eef
commit fd24289643
6 changed files with 840 additions and 840 deletions

View file

@ -316,18 +316,19 @@ public class IndexProviderManagerTest extends IndexTestBase {
public void testIndexFactoryConfigurationUsage() throws Exception {
IIndex index;
ICProject cproject= CProjectHelper.createCCProject("IndexFactoryConfigurationUsageTest", IPDOMManager.ID_NO_INDEXER);
IProject project= cproject.getProject();
ICProjectDescription pd= core.getProjectDescription(project);
ICConfigurationDescription cfg1= newCfg(pd, "project", "config1");
ICConfigurationDescription cfg2= newCfg(pd, "project", "config2");
core.setProjectDescription(project, pd);
index= CCorePlugin.getIndexManager().getIndex(cproject);
CCorePlugin.getIndexManager().joinIndexer(8000, NPM);
ICProject cproject = null;
try {
cproject = CProjectHelper.createCCProject("IndexFactoryConfigurationUsageTest", IPDOMManager.ID_NO_INDEXER);
IProject project= cproject.getProject();
ICProjectDescription pd= core.getProjectDescription(project);
ICConfigurationDescription cfg1= newCfg(pd, "project", "config1");
ICConfigurationDescription cfg2= newCfg(pd, "project", "config2");
core.setProjectDescription(project, pd);
index= CCorePlugin.getIndexManager().getIndex(cproject);
CCorePlugin.getIndexManager().joinIndexer(8000, NPM);
DPT.reset(DP1);
changeConfigRelations(project, ICProjectDescriptionPreferences.CONFIGS_LINK_SETTINGS_AND_ACTIVE);
assertEquals(0, DPT.getProjectsTrace(DP1).size());

View file

@ -86,7 +86,6 @@ public class CPPTemplateParameter extends PlatformObject implements ICPPTemplate
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding#isGloballyQualified()
*/
public boolean isGloballyQualified() {
// TODO Auto-generated method stub
return false;
}

View file

@ -36,7 +36,6 @@ import org.eclipse.core.runtime.CoreException;
/**
* @author Doug Schaefer
*
*/
public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmentBinding {
public static final PDOMBinding[] EMPTY_PDOMBINDING_ARRAY = {};
@ -72,7 +71,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
*
* @param pdom
* @param record
* @return
* @return <code>true</code> if the binding is orphaned.
* @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() {
try {
IBinding parent = getParentBinding();
if(parent instanceof IIndexScope) {
if (parent instanceof IIndexScope) {
return (IIndexScope) parent;
}
} catch(CoreException ce) {
} catch (CoreException ce) {
CCorePlugin.log(ce);
}
return null;
@ -201,10 +200,10 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
public final IIndexScope getScope() {
try {
IBinding parent = getParentBinding();
if(parent instanceof IIndexScope) {
if (parent instanceof IIndexScope) {
return (IIndexScope) parent;
}
} catch(CoreException ce) {
} catch (CoreException ce) {
CCorePlugin.log(ce);
}
return null;
@ -233,7 +232,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
public String toString() {
try {
return getName() + " " + getConstantNameForValue(getLinkageImpl(), getNodeType()); //$NON-NLS-1$
} catch(CoreException ce) {
} catch (CoreException ce) {
return getName() + " " + getNodeType(); //$NON-NLS-1$
}
}
@ -242,7 +241,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
* For debug purposes only.
* @param linkage
* @param value
* @return
* @return String representation of <code>value</code>.
*/
protected static String getConstantNameForValue(PDOMLinkage linkage, int value) {
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++) {
try {
fields[i].setAccessible(true);
if((fields[i].getModifiers() & Modifier.STATIC) != 0) {
if(int.class.equals(fields[i].getType())) {
if ((fields[i].getModifiers() & Modifier.STATIC) != 0) {
if (int.class.equals(fields[i].getType())) {
int fvalue= fields[i].getInt(null);
if(fvalue == value)
if (fvalue == value)
return fields[i].getName();
}
}
} catch(IllegalAccessException iae) {
} catch (IllegalAccessException iae) {
continue;
} catch(IllegalArgumentException iae) {
} catch (IllegalArgumentException iae) {
continue;
}
}
@ -269,7 +268,9 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
/**
* 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() {
try {
@ -294,7 +295,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
node = node.getParentNode();
}
return result.toArray(new String[result.size()]);
} catch(CoreException ce) {
} catch (CoreException ce) {
CCorePlugin.log(ce);
return null;
}
@ -305,7 +306,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
}
public boolean hasDefinition() throws CoreException {
return getFirstDefinition()!=null;
return getFirstDefinition() != null;
}
/**
@ -332,7 +333,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
do {
IString s0 = b0.getDBName(), s1 = b1.getDBName();
cmp = s0.compare(s1, true);
if(cmp==0) {
if (cmp == 0) {
int l1= b0.getLocalToFileRec();
int l2= b1.getLocalToFileRec();
if (l1 != l2) {
@ -340,13 +341,13 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
}
b0 = (PDOMBinding) b0.getParentBinding();
b1 = (PDOMBinding) b1.getParentBinding();
if(b0==null || b1==null) {
cmp = b0==b1 ? 0 : (b0==null ? -1 : 1);
if (b0 == null || b1 == null) {
cmp = b0 == b1 ? 0 : (b0 == null ? -1 : 1);
}
}
} while(cmp==0 && b1!=null && b0!=null);
} while(cmp == 0 && b1 != null && b0 != null);
return cmp;
} catch(CoreException ce) {
} catch (CoreException ce) {
CCorePlugin.log(ce);
return -1;
}
@ -356,7 +357,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
* Compares two PDOMBinding objects in accordance with
* {@link IIndexFragmentBindingComparator#compare(IIndexFragmentBinding, IIndexFragmentBinding)}
* @param other
* @return
* @return comparison result, -1, 0, or 1.
*/
public int pdomCompareTo(PDOMBinding other) {
int cmp = comparePDOMBindingQNs(this, other);
@ -412,7 +413,8 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IIndexFragmen
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;
}
}

View file

@ -75,6 +75,6 @@ abstract class PDOMCPPBinding extends PDOMBinding implements ICPPBinding {
}
public boolean isGloballyQualified() throws DOMException {
throw new PDOMNotImplementedError("In " + getClass().getCanonicalName()); //$NON-NLS-1$
throw new PDOMNotImplementedError("in " + getClass().getCanonicalName()); //$NON-NLS-1$
}
}

View file

@ -39,7 +39,6 @@ import org.eclipse.core.runtime.CoreException;
/**
* @author Bryan Wilkinson
*
*/
class PDOMCPPDeferredClassInstance extends PDOMCPPInstance implements
ICPPClassType, IPDOMMemberOwner, IIndexType, ICPPDeferredTemplateInstance, ICPPInternalDeferredClassInstance {
@ -84,7 +83,7 @@ class PDOMCPPDeferredClassInstance extends PDOMCPPInstance implements
}
public boolean isSameType(IType type) {
if( type instanceof PDOMNode ) {
if (type instanceof PDOMNode) {
PDOMNode node = (PDOMNode) type;
if (node.getPDOM() == getPDOM() && node.getRecord() == getRecord()) {
return true;
@ -94,12 +93,13 @@ class PDOMCPPDeferredClassInstance extends PDOMCPPInstance implements
ICPPClassTemplate classTemplate = (ICPPClassTemplate) getTemplateDefinition();
//allow some fuzziness here.
if( type instanceof ICPPDeferredTemplateInstance && type instanceof ICPPClassType ){
if (type instanceof ICPPDeferredTemplateInstance && type instanceof ICPPClassType) {
ICPPClassTemplate typeClass = (ICPPClassTemplate) ((ICPPDeferredTemplateInstance)type).getSpecializedBinding();
return (typeClass == classTemplate );
} else if( type instanceof ICPPClassTemplate && classTemplate == type ){
return typeClass == classTemplate;
} else if (type instanceof ICPPClassTemplate && classTemplate == type) {
return true;
} else if( type instanceof ICPPTemplateInstance && ((ICPPTemplateInstance)type).getTemplateDefinition() == classTemplate ){
} else if (type instanceof ICPPTemplateInstance &&
((ICPPTemplateInstance)type).getTemplateDefinition() == classTemplate) {
return true;
}
return false;
@ -111,18 +111,18 @@ class PDOMCPPDeferredClassInstance extends PDOMCPPInstance implements
/**
* @param argMap
* @return
* @return This class instance re-instantiated with resolved template arguments.
*/
public IType instantiate(ObjectMap argMap) {
IType[] arguments = getArguments();
IType [] newArgs = new IType[ arguments.length ];
IType[] newArgs = new IType[arguments.length];
int size = arguments.length;
for( int i = 0; i < size; i++ ){
newArgs[i] = CPPTemplates.instantiateType( arguments[i], argMap );
for (int i = 0; i < size; i++) {
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 {