Skip to main content
summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorAndrew Gvozdev2010-04-30 00:24:13 -0400
committerAndrew Gvozdev2010-04-30 00:24:13 -0400
commit068c62ae83562cfd0918df6a6146531cf7568030 (patch)
treea1443958a0600041000ae1b1bed2cf649d2e77e9 /build
parent6aaacce7465ec984cdc890d150e3bce6b916c062 (diff)
downloadorg.eclipse.cdt-068c62ae83562cfd0918df6a6146531cf7568030.tar.gz
org.eclipse.cdt-068c62ae83562cfd0918df6a6146531cf7568030.tar.xz
org.eclipse.cdt-068c62ae83562cfd0918df6a6146531cf7568030.zip
compilation warnings
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/BaseBOPConsoleParserTests.java18
-rw-r--r--build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/GCCScannerInfoConsoleParserTests.java7
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/IScannerInfoCollector.java17
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/GCCSpecsRunSIProvider.java3
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java7
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java3
6 files changed, 35 insertions, 20 deletions
diff --git a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/BaseBOPConsoleParserTests.java b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/BaseBOPConsoleParserTests.java
index 8c2a02d7c5..206cf09bf9 100644
--- a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/BaseBOPConsoleParserTests.java
+++ b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/BaseBOPConsoleParserTests.java
@@ -63,8 +63,9 @@ public abstract class BaseBOPConsoleParserTests extends BaseTestCase {
fOutputParser.processLine("-c test.c"); // multiline //$NON-NLS-1$
fOutputParser.processLine("gcc -D 'SUM(x, y) = (x) + (y)' -c test.c"); // more complex macro definition //$NON-NLS-1$
+ @SuppressWarnings("unchecked")
List<String> sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
- assertTrue(sumSymbols.contains("MACRO1=1")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("MACRO1=1")); //$NON-NLS-1$
assertTrue(sumSymbols.contains("MACRO2=value2")); //$NON-NLS-1$
assertTrue(sumSymbols.contains("MACRO3=")); //$NON-NLS-1$
assertTrue(sumSymbols.contains("MACRO4=value4")); //$NON-NLS-1$
@@ -85,7 +86,8 @@ public abstract class BaseBOPConsoleParserTests extends BaseTestCase {
public void testParsingSymbolDefinitions_bug80271() {
fOutputParser.processLine("gcc -DMACRO1 -I ..\\inc -c ..\\perfilescdtest\\source.c"); // PR 80271 //$NON-NLS-1$
- List<String> sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
+ @SuppressWarnings("unchecked")
+ List<String> sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
assertTrue(sumSymbols.contains("MACRO1=1")); //$NON-NLS-1$
assertTrue(sumSymbols.size() == 1);
}
@@ -94,7 +96,8 @@ public abstract class BaseBOPConsoleParserTests extends BaseTestCase {
fOutputParser.processLine("../src/bug186065.cc:8: error: missing terminating \" character"); // PR 80271 //$NON-NLS-1$
fOutputParser.processLine("gcc -DBUG186065_IS_FIXED test.c"); //$NON-NLS-1$
- List<String> sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
+ @SuppressWarnings("unchecked")
+ List<String> sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
assertTrue(sumSymbols.contains("BUG186065_IS_FIXED=1")); //$NON-NLS-1$
assertTrue(sumSymbols.size() == 1);
}
@@ -107,7 +110,8 @@ public abstract class BaseBOPConsoleParserTests extends BaseTestCase {
fOutputParser.processLine("/usr/gcc-tool-x -DE test5.c"); //$NON-NLS-1$
fOutputParser.processLine("/usr/gcc/something_else -DF test6.c"); //$NON-NLS-1$
- List<String> sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
+ @SuppressWarnings("unchecked")
+ List<String> sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
assertTrue(sumSymbols.contains("A=1")); //$NON-NLS-1$
assertTrue(sumSymbols.contains("B=1")); //$NON-NLS-1$
assertTrue(sumSymbols.contains("C=1")); //$NON-NLS-1$
@@ -121,7 +125,8 @@ public abstract class BaseBOPConsoleParserTests extends BaseTestCase {
fOutputParser.processLine("gcc -DA test1.c; gcc -DB test2.c"); //$NON-NLS-1$
fOutputParser.processLine("nix -DC; gcc -DD test2.c"); //$NON-NLS-1$
- List<String> sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
+ @SuppressWarnings("unchecked")
+ List<String> sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
assertTrue(sumSymbols.contains("A=1")); //$NON-NLS-1$
assertTrue(sumSymbols.contains("B=1")); //$NON-NLS-1$
assertFalse(sumSymbols.contains("C=1")); //$NON-NLS-1$
@@ -141,7 +146,8 @@ public abstract class BaseBOPConsoleParserTests extends BaseTestCase {
fOutputParser.processLine("sh -c 'gcc -DAA test1.c; gcc -DBB test2.c'"); //$NON-NLS-1$
fOutputParser.processLine("sh -c 'nix -DCC; gcc -DDD test2.c'"); //$NON-NLS-1$
- List<String> sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
+ @SuppressWarnings("unchecked")
+ List<String> sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
assertTrue(sumSymbols.contains("A=1")); //$NON-NLS-1$
assertTrue(sumSymbols.contains("B=1")); //$NON-NLS-1$
assertTrue(sumSymbols.contains("C=1")); //$NON-NLS-1$
diff --git a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/GCCScannerInfoConsoleParserTests.java b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/GCCScannerInfoConsoleParserTests.java
index fc67345994..a5895442b5 100644
--- a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/GCCScannerInfoConsoleParserTests.java
+++ b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/GCCScannerInfoConsoleParserTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -69,8 +69,9 @@ public class GCCScannerInfoConsoleParserTests extends BaseBOPConsoleParserTests
fOutputParser.processLine("-Imultiline3\\"); //$NON-NLS-1$
fOutputParser.processLine(" -DAA=\"BB\" test.c"); //$NON-NLS-1$
- List sumIncludes = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.INCLUDE_PATHS);
- assertTrue(sumIncludes.contains("/dir/include")); //$NON-NLS-1$
+ @SuppressWarnings("unchecked")
+ List<String> sumIncludes = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.INCLUDE_PATHS);
+ assertTrue(sumIncludes.contains("/dir/include")); //$NON-NLS-1$
assertTrue(sumIncludes.contains("c:\\dir\\include")); //$NON-NLS-1$
assertTrue(sumIncludes.contains("D:/dir/include")); //$NON-NLS-1$
assertTrue(sumIncludes.contains("/dir2/include")); //$NON-NLS-1$
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/IScannerInfoCollector.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/IScannerInfoCollector.java
index 6b0fbad9be..8f7fdeb851 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/IScannerInfoCollector.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/IScannerInfoCollector.java
@@ -20,22 +20,27 @@ import java.util.Map;
*
* @author vhirsl
*/
+@SuppressWarnings("rawtypes")
public interface IScannerInfoCollector {
/**
* Contribute to resource's scanner configuration
*
- * @param resource - if used from within Eclipse it is expected that resource is a
- * member of <code>org.eclipse.core.resources.IResource</code> hierarchy.
- * If used outside of Eclipse then resource is expected to be a
- * <code>java.io.File<code> type.
+ * @param resource
+ * <li> {@link org.eclipse.core.resources.IResource} if used from within Eclipse.</li>
+ * <li> {@link java.io.File} if used outside of Eclipse.</li>
+ * <li> {@code Integer} if represents command ID.</li>
* @param scannerInfo - a map of key - list pairs, where key is the type of extra info
- * i.e. target specific options or imacros commands,...
+ * i.e. target specific options or imacros commands, for example
+ * <li>{@code Map<ScannerInfoTypes, List<String>>}</li>
+ * <li>{@code Map<ScannerInfoTypes, List<CCommandDSC>>}</li>
*/
public void contributeToScannerConfig(Object resource, Map scannerInfo);
/**
* @return specific piece of discovered scanner info for a resource
- * discovered during the last collection cycle
+ * discovered during the last collection cycle, can be:
+ * <li>{@code List<String>}</li>
+ * <li>{@code List<CCommandDSC>}</li>
*/
public List getCollectedScannerInfo(Object resource, ScannerInfoTypes type);
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/GCCSpecsRunSIProvider.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/GCCSpecsRunSIProvider.java
index 1b1407d518..bd15498025 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/GCCSpecsRunSIProvider.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/GCCSpecsRunSIProvider.java
@@ -63,11 +63,12 @@ public class GCCSpecsRunSIProvider extends DefaultRunSIProvider {
/* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig2.DefaultRunSIProvider#prepareArguments(boolean)
*/
- @Override
+ @Override
protected String[] prepareArguments(boolean isDefaultCommand) {
if (collector == null)
return fCompileArguments;
+ @SuppressWarnings("unchecked")
List<String> tso = collector.getCollectedScannerInfo(resource.getProject(), ScannerInfoTypes.TARGET_SPECIFIC_OPTION);
if (tso == null || tso.size() == 0) {
return fCompileArguments;
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java
index e361127690..21a9d6bf69 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java
@@ -95,7 +95,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
this.context = new InfoContext(project);
}
- public synchronized void contributeToScannerConfig(Object resource, Map scannerInfo, boolean isBuiltinConfig) {
+ public synchronized void contributeToScannerConfig(Object resource, @SuppressWarnings("rawtypes") Map scannerInfo, boolean isBuiltinConfig) {
this.isBuiltinConfig= isBuiltinConfig;
try {
contributeToScannerConfig(resource, scannerInfo);
@@ -108,7 +108,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#contributeToScannerConfig(java.lang.Object, java.util.Map)
*/
- public synchronized void contributeToScannerConfig(Object resource, Map scannerInfo) {
+ public synchronized void contributeToScannerConfig(Object resource, @SuppressWarnings("rawtypes") Map scannerInfo) {
// check the resource
String errorMessage = null;
if (resource == null) {
@@ -141,6 +141,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
for (Object name : scannerInfo.keySet()) {
ScannerInfoTypes siType = (ScannerInfoTypes) name;
+ @SuppressWarnings("unchecked")
List<String> delta = (List<String>) scannerInfo.get(siType);
List<String> discovered = discoveredSI.get(siType);
@@ -344,7 +345,7 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
if (errorMessage != null) {
TraceUtil.outputError("PerProjectSICollector.getCollectedScannerInfo : ", errorMessage); //$NON-NLS-1$
}
- else if (project.equals(((IResource)resource).getProject())) {
+ else if (resource!=null && project.equals(((IResource)resource).getProject())) {
rv = discoveredSI.get(type);
}
return rv;
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java
index 3a221de220..206852d762 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java
@@ -61,10 +61,11 @@ public class SCDMakefileGenerator extends DefaultRunSIProvider {
return generateMakefile(resource.getProject().getName());
}
- private boolean generateMakefile(String projectName) {
+ private boolean generateMakefile(String projectName) {
boolean rc = false;
if (collector instanceof IScannerInfoCollector2) {
IScannerInfoCollector2 collector2 = (IScannerInfoCollector2) collector;
+ @SuppressWarnings("unchecked")
List<CCommandDSC> commands = collector2.getCollectedScannerInfo(
resource.getProject(), ScannerInfoTypes.UNDISCOVERED_COMPILER_COMMAND);
if (commands != null && commands.size() > 0) {

Back to the top