mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
compilation warnings
This commit is contained in:
parent
f400c28d0e
commit
09e2717298
1 changed files with 20 additions and 18 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
|
* Copyright (c) 2007, 2010 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -12,30 +12,32 @@
|
||||||
package org.eclipse.cdt.make.scannerdiscovery;
|
package org.eclipse.cdt.make.scannerdiscovery;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
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;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes;
|
import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes;
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.util.CCommandDSC;
|
import org.eclipse.cdt.make.internal.core.scannerconfig.util.CCommandDSC;
|
||||||
|
|
||||||
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
final class TestScannerInfoCollector implements IScannerInfoCollector {
|
final class TestScannerInfoCollector implements IScannerInfoCollector {
|
||||||
private HashMap fInfoMap = new HashMap();
|
private HashMap<ScannerInfoTypes, List> fInfoMap = new HashMap<ScannerInfoTypes, List>();
|
||||||
private HashMap fResourceToInfoMap = new HashMap();
|
private HashMap<Object, Map<ScannerInfoTypes, List>> fResourceToInfoMap = new HashMap<Object, Map<ScannerInfoTypes, List>>();
|
||||||
|
|
||||||
public void contributeToScannerConfig(Object resource, Map scannerInfo) {
|
public void contributeToScannerConfig(Object resource, Map scannerInfo0) {
|
||||||
for (Iterator iterator = scannerInfo.entrySet().iterator(); iterator.hasNext();) {
|
Map<ScannerInfoTypes, List> scannerInfo = scannerInfo0;
|
||||||
Map.Entry entry = (Map.Entry) iterator.next();
|
Set<Entry<ScannerInfoTypes, List>> entrySet = scannerInfo.entrySet();
|
||||||
ScannerInfoTypes key = (ScannerInfoTypes) entry.getKey();
|
for (Entry<ScannerInfoTypes, List> entry : entrySet) {
|
||||||
List value = (List) entry.getValue();
|
ScannerInfoTypes key = entry.getKey();
|
||||||
|
List value = entry.getValue();
|
||||||
addTo(key, value);
|
addTo(key, value);
|
||||||
if (ScannerInfoTypes.COMPILER_COMMAND.equals(key)) {
|
if (ScannerInfoTypes.COMPILER_COMMAND.equals(key)) {
|
||||||
for (Iterator iterator2 = value.iterator(); iterator2.hasNext();) {
|
List<CCommandDSC> cdscs = value;
|
||||||
CCommandDSC cdsc= (CCommandDSC) iterator2.next();
|
for (CCommandDSC cdsc : cdscs) {
|
||||||
cdsc.resolveOptions(null);
|
cdsc.resolveOptions(null);
|
||||||
addTo(ScannerInfoTypes.INCLUDE_PATHS, cdsc.getIncludes());
|
addTo(ScannerInfoTypes.INCLUDE_PATHS, cdsc.getIncludes());
|
||||||
addTo(ScannerInfoTypes.QUOTE_INCLUDE_PATHS, cdsc.getQuoteIncludes());
|
addTo(ScannerInfoTypes.QUOTE_INCLUDE_PATHS, cdsc.getQuoteIncludes());
|
||||||
|
@ -48,10 +50,10 @@ final class TestScannerInfoCollector implements IScannerInfoCollector {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addTo(ScannerInfoTypes type, List col) {
|
private void addTo(ScannerInfoTypes type, List<String> col) {
|
||||||
Collection target= (Collection) fInfoMap.get(type);
|
List<String> target = fInfoMap.get(type);
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
target= new ArrayList();
|
target= new ArrayList<String>();
|
||||||
fInfoMap.put(type, target);
|
fInfoMap.put(type, target);
|
||||||
}
|
}
|
||||||
target.addAll(col);
|
target.addAll(col);
|
||||||
|
@ -59,12 +61,12 @@ final class TestScannerInfoCollector implements IScannerInfoCollector {
|
||||||
|
|
||||||
public List getCollectedScannerInfo(Object resource, ScannerInfoTypes type) {
|
public List getCollectedScannerInfo(Object resource, ScannerInfoTypes type) {
|
||||||
if (resource == null) {
|
if (resource == null) {
|
||||||
List result= (List) fInfoMap.get(type);
|
List result= fInfoMap.get(type);
|
||||||
return result == null ? Collections.EMPTY_LIST : result;
|
return result == null ? Collections.EMPTY_LIST : result;
|
||||||
}
|
}
|
||||||
Map scannerInfo= (Map)fResourceToInfoMap.get(resource);
|
Map<ScannerInfoTypes, List> scannerInfo= fResourceToInfoMap.get(resource);
|
||||||
if (scannerInfo != null) {
|
if (scannerInfo != null) {
|
||||||
List result= (List) scannerInfo.get(type);
|
List result= scannerInfo.get(type);
|
||||||
return result == null ? Collections.EMPTY_LIST : result;
|
return result == null ? Collections.EMPTY_LIST : result;
|
||||||
}
|
}
|
||||||
return Collections.EMPTY_LIST;
|
return Collections.EMPTY_LIST;
|
||||||
|
|
Loading…
Add table
Reference in a new issue