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

compilation warnings

This commit is contained in:
Andrew Gvozdev 2010-04-29 19:15:13 +00:00
parent 844ab2144c
commit cffc49b240
7 changed files with 28 additions and 20 deletions

View file

@ -370,6 +370,7 @@ public class MakeCorePlugin extends Plugin {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#startup() * @see org.eclipse.core.runtime.Plugin#startup()
*/ */
@Override
public void start(BundleContext context) throws Exception { public void start(BundleContext context) throws Exception {
super.start(context); super.start(context);

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007 Intel Corporation and others. * Copyright (c) 2007, 2010 Intel Corporation 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
@ -26,6 +26,7 @@ public class MakeCDataFactory extends CDataFactory {
return fInstance; return fInstance;
} }
@Override
public CLanguageData createLanguageData(CConfigurationData cfg, public CLanguageData createLanguageData(CConfigurationData cfg,
CResourceData rcBase, CLanguageData base, String id, boolean clone) { CResourceData rcBase, CLanguageData base, String id, boolean clone) {
if(id == null) if(id == null)
@ -33,6 +34,7 @@ public class MakeCDataFactory extends CDataFactory {
return new MakeLanguageData(id, base); return new MakeLanguageData(id, base);
} }
@Override
public CLanguageData createLanguageData(CConfigurationData cfg, public CLanguageData createLanguageData(CConfigurationData cfg,
CResourceData rcBase, String id, String name, String languageId, CResourceData rcBase, String id, String name, String languageId,
int supportedKinds, String[] rcTypes, boolean isContentTypes) { int supportedKinds, String[] rcTypes, boolean isContentTypes) {

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007 Intel Corporation and others. * Copyright (c) 2007, 2010 Intel Corporation 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
@ -25,6 +25,7 @@ public class MakeDiscoveredInfoProcessor extends CDataDiscoveredInfoProcessor {
return fInstance; return fInstance;
} }
@Override
protected void setInfoForData(CConfigurationData cfgData, protected void setInfoForData(CConfigurationData cfgData,
CResourceData rcData, CLanguageData data, PathInfo pi, CResourceData rcData, CLanguageData data, PathInfo pi,
CResourceData baseRcData, CLanguageData baseLangData) { CResourceData baseRcData, CLanguageData baseLangData) {

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007 Intel Corporation and others. * Copyright (c) 2007, 2010 Intel Corporation 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
@ -34,6 +34,7 @@ public class MakeLanguageData extends UserAndDiscoveredEntryLanguageData {
fSupportedKinds = kinds; fSupportedKinds = kinds;
} }
@Override
protected void copySettingsFrom(CLanguageData data) { protected void copySettingsFrom(CLanguageData data) {
super.copySettingsFrom(data); super.copySettingsFrom(data);
if(data instanceof MakeLanguageData){ if(data instanceof MakeLanguageData){
@ -41,6 +42,7 @@ public class MakeLanguageData extends UserAndDiscoveredEntryLanguageData {
} }
} }
@Override
protected ICLanguageSettingEntry[] getAllDiscoveredEntries(int kind) { protected ICLanguageSettingEntry[] getAllDiscoveredEntries(int kind) {
if(fDiscoveredCache != null){ if(fDiscoveredCache != null){
int roFlag = canDisableDiscoveredEntries(kind) ? 0 : ICLanguageSettingEntry.READONLY; int roFlag = canDisableDiscoveredEntries(kind) ? 0 : ICLanguageSettingEntry.READONLY;

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2006 QNX Software Systems and others. * Copyright (c) 2000, 2010 QNX Software Systems 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
@ -28,6 +28,7 @@ public class MakefileReader extends LineNumberReader {
} }
@Override
public String readLine() throws IOException { public String readLine() throws IOException {
boolean done = false; boolean done = false;
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2009 IBM Corporation and others. * Copyright (c) 2004, 2010 IBM Corporation 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
@ -11,9 +11,9 @@
package org.eclipse.cdt.make.internal.core.scannerconfig; package org.eclipse.cdt.make.internal.core.scannerconfig;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.IPathEntry; import org.eclipse.cdt.core.model.IPathEntry;
@ -37,7 +37,7 @@ public class PerFileDiscoveredPathContainer extends DiscoveredPathContainer
* @see org.eclipse.cdt.core.model.IPathEntryContainerExtension#getPathEntries(org.eclipse.core.runtime.IPath, int) * @see org.eclipse.cdt.core.model.IPathEntryContainerExtension#getPathEntries(org.eclipse.core.runtime.IPath, int)
*/ */
public IPathEntry[] getPathEntries(IPath path, int mask) { public IPathEntry[] getPathEntries(IPath path, int mask) {
ArrayList entries = new ArrayList(); ArrayList<IPathEntry> entries = new ArrayList<IPathEntry>();
try { try {
IDiscoveredPathInfo info = MakeCorePlugin.getDefault().getDiscoveryManager().getDiscoveredInfo(fProject); IDiscoveredPathInfo info = MakeCorePlugin.getDefault().getDiscoveryManager().getDiscoveredInfo(fProject);
if (info instanceof IPerFileDiscoveredPathInfo) { if (info instanceof IPerFileDiscoveredPathInfo) {
@ -56,10 +56,10 @@ public class PerFileDiscoveredPathContainer extends DiscoveredPathContainer
} }
} }
if ((mask & IPathEntry.CDT_MACRO) != 0) { if ((mask & IPathEntry.CDT_MACRO) != 0) {
Map syms = filePathInfo.getSymbols(path); Map<String, String> syms = filePathInfo.getSymbols(path);
for (Iterator iter = syms.entrySet().iterator(); iter.hasNext(); ) { Set<Entry<String, String>> entrySet = syms.entrySet();
Entry entry = (Entry)iter.next(); for (Entry<String, String> entry : entrySet) {
entries.add(CoreModel.newMacroEntry(path, (String)entry.getKey(), (String)entry.getValue())); entries.add(CoreModel.newMacroEntry(path, entry.getKey(), entry.getValue()));
} }
} }
// compare the resource with include and macros files // compare the resource with include and macros files
@ -88,7 +88,7 @@ public class PerFileDiscoveredPathContainer extends DiscoveredPathContainer
catch (CoreException e) { catch (CoreException e) {
// //
} }
return (IPathEntry[]) entries.toArray(new IPathEntry[entries.size()]); return entries.toArray(new IPathEntry[entries.size()]);
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007 Intel Corporation and others. * Copyright (c) 2007, 2010 Intel Corporation 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
@ -10,16 +10,17 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.make.internal.core.scannerconfig.util; package org.eclipse.cdt.make.internal.core.scannerconfig.util;
import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.cdt.core.settings.model.CMacroEntry; import org.eclipse.cdt.core.settings.model.CMacroEntry;
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.core.settings.model.ICMacroEntry; import org.eclipse.cdt.core.settings.model.ICMacroEntry;
import org.eclipse.cdt.core.settings.model.util.CDataUtil; import org.eclipse.cdt.core.settings.model.util.CDataUtil;
import org.eclipse.cdt.make.core.scannerconfig.PathInfo;
import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo; import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo;
import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerFileDiscoveredPathInfo; import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerFileDiscoveredPathInfo;
import org.eclipse.cdt.make.core.scannerconfig.PathInfo;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
public class PathInfoToLangSettingsConverter { public class PathInfoToLangSettingsConverter {
@ -73,13 +74,13 @@ public class PathInfoToLangSettingsConverter {
return entries; return entries;
} }
private static ICMacroEntry[] calculateEntries(int flags, Map map){ private static ICMacroEntry[] calculateEntries(int flags, Map<String, String> map){
ICMacroEntry entries[] = new ICMacroEntry[map.size()]; ICMacroEntry entries[] = new ICMacroEntry[map.size()];
int num = 0; int num = 0;
for(Iterator iter = map.entrySet().iterator(); iter.hasNext();){ Set<Entry<String, String>> entrySet = map.entrySet();
Map.Entry entry = (Map.Entry)iter.next(); for (Entry<String, String> entry : entrySet) {
String name = (String)entry.getKey(); String name = entry.getKey();
String value = (String)entry.getValue(); String value = entry.getValue();
entries[num++] = new CMacroEntry(name, value, flags); entries[num++] = new CMacroEntry(name, value, flags);
} }
return entries; return entries;