mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 01:05: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 {
|
||||
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();
|
||||
|
||||
ICProjectDescription pd= core.getProjectDescription(project);
|
||||
|
@ -327,7 +329,6 @@ public class IndexProviderManagerTest extends IndexTestBase {
|
|||
index= CCorePlugin.getIndexManager().getIndex(cproject);
|
||||
CCorePlugin.getIndexManager().joinIndexer(8000, NPM);
|
||||
|
||||
try {
|
||||
DPT.reset(DP1);
|
||||
changeConfigRelations(project, ICProjectDescriptionPreferences.CONFIGS_LINK_SETTINGS_AND_ACTIVE);
|
||||
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()
|
||||
*/
|
||||
public boolean isGloballyQualified() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -476,6 +476,7 @@ public class CPPSemantics {
|
|||
return new CPPScope.CPPScopeProblem(((IProblemBinding)scope).getASTNode(), IProblemBinding.SEMANTIC_BAD_SCOPE, ((IProblemBinding)scope).getNameCharArray());
|
||||
return new CPPScope.CPPScopeProblem(name, IProblemBinding.SEMANTIC_BAD_SCOPE, name.toCharArray());
|
||||
}
|
||||
|
||||
private static void mergeResults(LookupData data, Object results, boolean scoped) {
|
||||
if (!data.contentAssist) {
|
||||
if (results instanceof IBinding) {
|
||||
|
@ -500,9 +501,9 @@ public class CPPSemantics {
|
|||
|
||||
CharArrayObjectMap map = null;
|
||||
Object[] objs = null;
|
||||
if( source instanceof CharArrayObjectMap )
|
||||
if (source instanceof CharArrayObjectMap) {
|
||||
map = (CharArrayObjectMap) source;
|
||||
else{
|
||||
} else {
|
||||
if (source instanceof Object[])
|
||||
objs = ArrayUtil.trim(Object.class, (Object[]) source);
|
||||
else
|
||||
|
@ -512,9 +513,11 @@ public class CPPSemantics {
|
|||
int size = map != null ? map.size() : objs.length;
|
||||
int resultInitialSize = resultMap.size();
|
||||
for (int i = 0; i < size; i ++) {
|
||||
char [] key = ( map != null ) ? map.keyAt(i)
|
||||
: ( objs[i] instanceof IBinding) ? ((IBinding)objs[i]).getNameCharArray()
|
||||
: ((IASTName)objs[i]).toCharArray();
|
||||
char[] key = (map != null) ?
|
||||
map.keyAt(i) :
|
||||
(objs[i] instanceof IBinding) ?
|
||||
((IBinding) objs[i]).getNameCharArray() :
|
||||
((IASTName) objs[i]).toCharArray();
|
||||
int idx = resultMap.lookup(key);
|
||||
if (idx == -1) {
|
||||
resultMap.put(key, (map != null) ? map.get(key) : objs[i]);
|
||||
|
@ -884,16 +887,14 @@ public class CPPSemantics {
|
|||
if (binding instanceof ICPPClassType) {
|
||||
IASTNode parent = data.astName.getParent();
|
||||
if (parent instanceof ICPPASTQualifiedName &&
|
||||
parent.getPropertyInParent() == IASTFieldReference.FIELD_NAME )
|
||||
{
|
||||
parent.getPropertyInParent() == IASTFieldReference.FIELD_NAME) {
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
//it is not ambiguous if they are the same thing and it is static or an enumerator
|
||||
if (binding instanceof IEnumerator ||
|
||||
(binding instanceof IFunction && ASTInternal.isStatic((IFunction) binding, false)) ||
|
||||
(binding instanceof IVariable && ((IVariable)binding).isStatic()) )
|
||||
{
|
||||
(binding instanceof IVariable && ((IVariable)binding).isStatic())) {
|
||||
ok = true;
|
||||
}
|
||||
if (!ok)
|
||||
|
@ -1079,16 +1080,13 @@ public class CPPSemantics {
|
|||
temp = (IASTName) possible;
|
||||
else
|
||||
temp = ((IASTName[])possible)[++jdx];
|
||||
|
||||
while (temp != null) {
|
||||
|
||||
if ((checkWholeClassScope || declaredBefore(temp, data.astName, isIndexBased)) &&
|
||||
(item != blockItem || data.includeBlockItem( item )) )
|
||||
|
||||
{
|
||||
(item != blockItem || data.includeBlockItem(item))) {
|
||||
if (data.considerConstructors ||
|
||||
!(temp.getParent() instanceof IASTDeclarator &&
|
||||
CPPVisitor.isConstructor( scope, (IASTDeclarator) temp.getParent() ) ) )
|
||||
{
|
||||
CPPVisitor.isConstructor(scope, (IASTDeclarator) temp.getParent()))) {
|
||||
found = (IASTName[]) ArrayUtil.append(IASTName.class, found, temp);
|
||||
}
|
||||
}
|
||||
|
@ -2009,8 +2007,7 @@ public class CPPSemantics {
|
|||
((ICPPSpecialization)bestFn).getSpecializedBinding() instanceof ICPPFunctionTemplate);
|
||||
boolean currIsTemplate = (currFn instanceof ICPPSpecialization &&
|
||||
((ICPPSpecialization)currFn).getSpecializedBinding() instanceof ICPPFunctionTemplate);
|
||||
if( bestIsTemplate && currIsTemplate )
|
||||
{
|
||||
if (bestIsTemplate && currIsTemplate) {
|
||||
ICPPFunctionTemplate t1 = (ICPPFunctionTemplate) ((ICPPSpecialization)bestFn).getSpecializedBinding();
|
||||
ICPPFunctionTemplate t2 = (ICPPFunctionTemplate) ((ICPPSpecialization)currFn).getSpecializedBinding();
|
||||
int order = CPPTemplates.orderTemplateFunctions(t1, t2);
|
||||
|
@ -2044,7 +2041,6 @@ public class CPPSemantics {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if (ambiguous || bestHasAmbiguousParam) {
|
||||
return new ProblemBinding(data.astName, IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP, data.name());
|
||||
}
|
||||
|
@ -2074,8 +2070,9 @@ public class CPPSemantics {
|
|||
if (o instanceof IType[]) {
|
||||
types = (IType[]) o;
|
||||
type = types[++idx];
|
||||
} else
|
||||
} else {
|
||||
type = (IType) o;
|
||||
}
|
||||
|
||||
while (type != null) {
|
||||
type = getUltimateType(type, false);
|
||||
|
@ -2419,7 +2416,7 @@ public class CPPSemantics {
|
|||
else
|
||||
binding = null;
|
||||
|
||||
if( binding != null )
|
||||
if (binding != null) {
|
||||
if (binding instanceof ICPPUsingDeclaration) {
|
||||
set.addAll(((ICPPUsingDeclaration)binding).getDelegates());
|
||||
} else if (binding instanceof CPPCompositeBinding) {
|
||||
|
@ -2428,6 +2425,7 @@ public class CPPSemantics {
|
|||
set.put(binding);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return set.keyArray(IBinding.class);
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
@ -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();
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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$
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,6 @@ import org.eclipse.core.runtime.CoreException;
|
|||
|
||||
/**
|
||||
* @author Bryan Wilkinson
|
||||
*
|
||||
*/
|
||||
class PDOMCPPDeferredClassInstance extends PDOMCPPInstance implements
|
||||
ICPPClassType, IPDOMMemberOwner, IIndexType, ICPPDeferredTemplateInstance, ICPPInternalDeferredClassInstance {
|
||||
|
@ -96,10 +95,11 @@ class PDOMCPPDeferredClassInstance extends PDOMCPPInstance implements
|
|||
//allow some fuzziness here.
|
||||
if (type instanceof ICPPDeferredTemplateInstance && type instanceof ICPPClassType) {
|
||||
ICPPClassTemplate typeClass = (ICPPClassTemplate) ((ICPPDeferredTemplateInstance)type).getSpecializedBinding();
|
||||
return (typeClass == classTemplate );
|
||||
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,7 +111,7 @@ 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();
|
||||
|
|
Loading…
Add table
Reference in a new issue