mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
compilation warnings
This commit is contained in:
parent
36de03adca
commit
906c0d3869
1 changed files with 27 additions and 30 deletions
|
@ -15,7 +15,6 @@ package org.eclipse.cdt.make.internal.core.scannerconfig.gnu;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -34,10 +33,10 @@ import org.eclipse.core.runtime.Path;
|
||||||
* @author vhirsl
|
* @author vhirsl
|
||||||
*/
|
*/
|
||||||
public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsoleParserUtility {
|
public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsoleParserUtility {
|
||||||
private Map directoryCommandListMap;
|
private Map<String, List<Map<String, List<String>>>> directoryCommandListMap;
|
||||||
private List compiledFileList;
|
private List<String> compiledFileList;
|
||||||
|
|
||||||
private List commandsList2;
|
private List<CCommandDSC> commandsList2;
|
||||||
|
|
||||||
private int workingDirsN = 0;
|
private int workingDirsN = 0;
|
||||||
private int commandsN = 0;
|
private int commandsN = 0;
|
||||||
|
@ -66,16 +65,16 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
|
||||||
compiledFileList.add(longFileName);
|
compiledFileList.add(longFileName);
|
||||||
|
|
||||||
String workingDir = getWorkingDirectory().toString();
|
String workingDir = getWorkingDirectory().toString();
|
||||||
List directoryCommandList = (List) directoryCommandListMap.get(workingDir);
|
List<Map<String, List<String>>> directoryCommandList = directoryCommandListMap.get(workingDir);
|
||||||
if (directoryCommandList == null) {
|
if (directoryCommandList == null) {
|
||||||
directoryCommandList = new ArrayList();
|
directoryCommandList = new ArrayList<Map<String, List<String>>>();
|
||||||
directoryCommandListMap.put(workingDir, directoryCommandList);
|
directoryCommandListMap.put(workingDir, directoryCommandList);
|
||||||
++workingDirsN;
|
++workingDirsN;
|
||||||
}
|
}
|
||||||
Map command21FileListMap = null;
|
Map<String, List<String>> command21FileListMap = null;
|
||||||
for (Iterator i = directoryCommandList.iterator(); i.hasNext(); ) {
|
for (Map<String, List<String>> map : directoryCommandList) {
|
||||||
command21FileListMap = (Map) i.next();
|
command21FileListMap = map;
|
||||||
List fileList = (List) command21FileListMap.get(genericCommand);
|
List<String> fileList = command21FileListMap.get(genericCommand);
|
||||||
if (fileList != null) {
|
if (fileList != null) {
|
||||||
if (!fileList.contains(longFileName)) {
|
if (!fileList.contains(longFileName)) {
|
||||||
fileList.add(longFileName);
|
fileList.add(longFileName);
|
||||||
|
@ -84,10 +83,10 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
command21FileListMap = new HashMap(1);
|
command21FileListMap = new HashMap<String, List<String>>(1);
|
||||||
directoryCommandList.add(command21FileListMap);
|
directoryCommandList.add(command21FileListMap);
|
||||||
++commandsN;
|
++commandsN;
|
||||||
List fileList = new ArrayList();
|
List<String> fileList = new ArrayList<String>();
|
||||||
command21FileListMap.put(genericCommand, fileList);
|
command21FileListMap.put(genericCommand, fileList);
|
||||||
fileList.add(longFileName);
|
fileList.add(longFileName);
|
||||||
++filesN;
|
++filesN;
|
||||||
|
@ -122,7 +121,7 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
|
||||||
++commandsN;
|
++commandsN;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
command = (CCommandDSC) commandsList2.get(index);
|
command = commandsList2.get(index);
|
||||||
}
|
}
|
||||||
// // add a file
|
// // add a file
|
||||||
// command.addFile(longFileName);
|
// command.addFile(longFileName);
|
||||||
|
@ -135,8 +134,8 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
|
||||||
* @return CCommandDSC compile command description
|
* @return CCommandDSC compile command description
|
||||||
*/
|
*/
|
||||||
public CCommandDSC getNewCCommandDSC(String[] tokens, final int idxOfCompilerCommand, boolean cppFileType) {
|
public CCommandDSC getNewCCommandDSC(String[] tokens, final int idxOfCompilerCommand, boolean cppFileType) {
|
||||||
ArrayList dirafter = new ArrayList();
|
ArrayList<KVStringPair> dirafter = new ArrayList<KVStringPair>();
|
||||||
ArrayList includes = new ArrayList();
|
ArrayList<String> includes = new ArrayList<String>();
|
||||||
CCommandDSC command = new CCommandDSC(cppFileType, getProject());
|
CCommandDSC command = new CCommandDSC(cppFileType, getProject());
|
||||||
command.addSCOption(new KVStringPair(SCDOptionsEnum.COMMAND.toString(), tokens[idxOfCompilerCommand]));
|
command.addSCOption(new KVStringPair(SCDOptionsEnum.COMMAND.toString(), tokens[idxOfCompilerCommand]));
|
||||||
for (int i = idxOfCompilerCommand+1; i < tokens.length; ++i) {
|
for (int i = idxOfCompilerCommand+1; i < tokens.length; ++i) {
|
||||||
|
@ -169,12 +168,12 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
|
||||||
// ex. -I/dir
|
// ex. -I/dir
|
||||||
}
|
}
|
||||||
else if (optionKind.equals(SCDOptionsEnum.IDASH)) {
|
else if (optionKind.equals(SCDOptionsEnum.IDASH)) {
|
||||||
for (Iterator iter=includes.iterator(); iter.hasNext(); ) {
|
for (String inc : includes) {
|
||||||
option = (String)iter.next();
|
option = inc;
|
||||||
KVStringPair pair = new KVStringPair(SCDOptionsEnum.IQUOTE.toString(), option);
|
KVStringPair pair = new KVStringPair(SCDOptionsEnum.IQUOTE.toString(), option);
|
||||||
command.addSCOption(pair);
|
command.addSCOption(pair);
|
||||||
}
|
}
|
||||||
includes = new ArrayList();
|
includes = new ArrayList<String>();
|
||||||
// -I- has no parameter
|
// -I- has no parameter
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -216,15 +215,13 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String option;
|
for (String option : includes) {
|
||||||
for (Iterator iter=includes.iterator(); iter.hasNext(); ) {
|
|
||||||
option = (String)iter.next();
|
|
||||||
KVStringPair pair = new KVStringPair(SCDOptionsEnum.INCLUDE.toString(), option);
|
KVStringPair pair = new KVStringPair(SCDOptionsEnum.INCLUDE.toString(), option);
|
||||||
command.addSCOption(pair);
|
command.addSCOption(pair);
|
||||||
}
|
}
|
||||||
for (Iterator iter=dirafter.iterator(); iter.hasNext(); ) {
|
for (KVStringPair kvStringPair : dirafter) {
|
||||||
command.addSCOption((KVStringPair)iter.next());
|
command.addSCOption(kvStringPair);
|
||||||
}
|
}
|
||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,8 +294,8 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
|
||||||
* Currently this list is not filled, so it will always return an empty list.
|
* Currently this list is not filled, so it will always return an empty list.
|
||||||
* @return List of CCommandDSC
|
* @return List of CCommandDSC
|
||||||
*/
|
*/
|
||||||
public List getCCommandDSCList() {
|
public List<CCommandDSC> getCCommandDSCList() {
|
||||||
return new ArrayList(commandsList2);
|
return new ArrayList<CCommandDSC>(commandsList2);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue