1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

compilation warnings

This commit is contained in:
Andrew Gvozdev 2010-04-29 04:33:44 +00:00
parent 4790e5993f
commit f068ae1a89
10 changed files with 36 additions and 27 deletions

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
@ -75,6 +75,7 @@ public class Command extends Directive implements ICommand {
return false; return false;
} }
@Override
public String toString() { public String toString() {
StringBuffer cmd = new StringBuffer(); StringBuffer cmd = new StringBuffer();
cmd.append( '\t'); cmd.append( '\t');

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
@ -25,6 +25,7 @@ public class Comment extends Directive implements IComment {
} }
} }
@Override
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append(POUND_STRING).append(comment).append('\n'); buffer.append(POUND_STRING).append(comment).append('\n');

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2008 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
@ -27,6 +27,7 @@ public abstract class Directive implements IDirective {
setLines(start, end); setLines(start, end);
} }
@Override
public abstract String toString(); public abstract String toString();
/* (non-Javadoc) /* (non-Javadoc)

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
@ -22,6 +22,7 @@ public class EmptyLine extends Directive implements IEmptyLine {
super(parent); super(parent);
} }
@Override
public String toString() { public String toString() {
return NL_STRING; return NL_STRING;
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2008 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
@ -41,10 +41,12 @@ public class NullMakefile extends AbstractMakefile {
super(null); super(null);
} }
@Override
public IDirective[] getDirectives() { public IDirective[] getDirectives() {
return EMPTY_DIRECTIVES; return EMPTY_DIRECTIVES;
} }
@Override
public IDirective[] getBuiltins() { public IDirective[] getBuiltins() {
return EMPTY_DIRECTIVES; return EMPTY_DIRECTIVES;
} }
@ -52,6 +54,7 @@ public class NullMakefile extends AbstractMakefile {
public void addDirective(IDirective directive) { public void addDirective(IDirective directive) {
} }
@Override
public String toString() { public String toString() {
return new String(); return new String();
} }

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
@ -22,7 +22,7 @@ import org.eclipse.cdt.make.core.makefile.IDirective;
public abstract class Parent extends Directive implements IParent { public abstract class Parent extends Directive implements IParent {
ArrayList children = new ArrayList(); ArrayList<Directive> children = new ArrayList<Directive>();
public Parent(Directive parent) { public Parent(Directive parent) {
super(parent); super(parent);
@ -34,7 +34,7 @@ public abstract class Parent extends Directive implements IParent {
public IDirective[] getDirectives() { public IDirective[] getDirectives() {
children.trimToSize(); children.trimToSize();
return (IDirective[]) children.toArray(new IDirective[0]); return children.toArray(new IDirective[0]);
} }
public void addDirective(Directive directive) { public void addDirective(Directive directive) {
@ -57,12 +57,13 @@ public abstract class Parent extends Directive implements IParent {
public Directive[] getStatements() { public Directive[] getStatements() {
children.trimToSize(); children.trimToSize();
return (Directive[]) children.toArray(new Directive[0]); return children.toArray(new Directive[0]);
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see java.lang.Object#toString() * @see java.lang.Object#toString()
*/ */
@Override
public String toString() { public String toString() {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
IDirective[] directives = getDirectives(); IDirective[] directives = getDirectives();

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
@ -11,8 +11,9 @@
package org.eclipse.cdt.make.internal.core.scannerconfig; package org.eclipse.cdt.make.internal.core.scannerconfig;
import java.util.Arrays; import java.util.Arrays;
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.ICSettingBase; import org.eclipse.cdt.core.settings.model.ICSettingBase;
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData; import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
@ -32,7 +33,7 @@ import org.eclipse.core.runtime.Path;
public abstract class CDataDiscoveredInfoProcessor { public abstract class CDataDiscoveredInfoProcessor {
public void applyDiscoveredInfo(CConfigurationData cfgData, DiscoveredSettingInfo dsIinfo){ public void applyDiscoveredInfo(CConfigurationData cfgData, DiscoveredSettingInfo dsIinfo){
Map map = CDataUtil.createPathRcDataMap(cfgData); Map<IPath, CResourceData> map = CDataUtil.createPathRcDataMap(cfgData);
IRcSettingInfo info; IRcSettingInfo info;
PathSettingsContainer cr = PathSettingsContainer.createRootContainer(); PathSettingsContainer cr = PathSettingsContainer.createRootContainer();
@ -46,7 +47,7 @@ public abstract class CDataDiscoveredInfoProcessor {
} }
if(map.size() != 0){ if(map.size() != 0){
CResourceData rcData = (CResourceData)map.get(Path.EMPTY); CResourceData rcData = map.get(Path.EMPTY);
if(rcData != null){ if(rcData != null){
info = CDataDiscoveredInfoCalculator.createEmptyRcSettingInfo((CFolderData)rcData); info = CDataDiscoveredInfoCalculator.createEmptyRcSettingInfo((CFolderData)rcData);
applyInfo(cfgData, info, cr); applyInfo(cfgData, info, cr);
@ -54,11 +55,11 @@ public abstract class CDataDiscoveredInfoProcessor {
} }
if(map.size() != 0){ if(map.size() != 0){
for(Iterator iter = map.entrySet().iterator(); iter.hasNext();){ Set<Entry<IPath, CResourceData>> entries = map.entrySet();
Map.Entry entry = (Map.Entry)iter.next(); for (Entry<IPath, CResourceData> entry : entries) {
IPath path = (IPath)entry.getKey(); IPath path = entry.getKey();
PathSettingsContainer curCr = cr.getChildContainer(path, false, false); PathSettingsContainer curCr = cr.getChildContainer(path, false, false);
rcData = (CResourceData)entry.getValue(); rcData = entry.getValue();
info = (IRcSettingInfo)curCr.getValue(); info = (IRcSettingInfo)curCr.getValue();
applyInfo(cfgData, rcData, info); applyInfo(cfgData, rcData, info);
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2007 QNX Software Systems and others. * Copyright (c) 2004, 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
@ -59,7 +59,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
// PathSettingsContainer fContainer = PathSettingsContainer.createRootContainer(); // PathSettingsContainer fContainer = PathSettingsContainer.createRootContainer();
public IDiscoveredPathInfo getInfo(InfoContext context){ public IDiscoveredPathInfo getInfo(InfoContext context){
return (IDiscoveredPathInfo)fInfoMap.get(context); return fInfoMap.get(context);
} }
// private Map getMap(IPath path, boolean create, boolean exactPath){ // private Map getMap(IPath path, boolean create, boolean exactPath){
@ -90,8 +90,8 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
public IDiscoveredPathInfo setInfo(InfoContext context, IDiscoveredPathInfo info){ public IDiscoveredPathInfo setInfo(InfoContext context, IDiscoveredPathInfo info){
if(info != null) if(info != null)
return (IDiscoveredPathInfo)fInfoMap.put(context, info); return fInfoMap.put(context, info);
return (IDiscoveredPathInfo)fInfoMap.remove(context); return fInfoMap.remove(context);
} }
} }
@ -154,7 +154,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
} }
private DiscoveredInfoHolder getHolder(IProject project, boolean create){ private DiscoveredInfoHolder getHolder(IProject project, boolean create){
DiscoveredInfoHolder holder = (DiscoveredInfoHolder)fDiscoveredInfoHolderMap.get(project); DiscoveredInfoHolder holder = fDiscoveredInfoHolderMap.get(project);
if(holder == null && create){ if(holder == null && create){
holder = new DiscoveredInfoHolder(); holder = new DiscoveredInfoHolder();
fDiscoveredInfoHolderMap.put(project, holder); fDiscoveredInfoHolderMap.put(project, holder);
@ -274,7 +274,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
// 1. clear DiscoveredPathManager's path info cache // 1. clear DiscoveredPathManager's path info cache
DiscoveredInfoHolder holder = getHolder(project, false); DiscoveredInfoHolder holder = getHolder(project, false);
InfoContext context = new InfoContext(project); InfoContext context = new InfoContext(project);
IDiscoveredPathInfo oldInfo = (IDiscoveredPathInfo) holder.getInfo(context); IDiscoveredPathInfo oldInfo = holder.getInfo(context);
// 2. switch the containers // 2. switch the containers
try { try {

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
@ -148,7 +148,7 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
cos.close(); cos.close();
} }
catch (Exception e) { catch (Exception e) {
CCorePlugin.log(e); MakeCorePlugin.log(e);
} }
finally { finally {
monitor.done(); monitor.done();

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2008 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
@ -88,7 +88,7 @@ public class DefaultSIFileReader implements IExternalScannerInfoProvider {
ConsoleOutputSniffer sniffer = ScannerInfoConsoleParserFactory. ConsoleOutputSniffer sniffer = ScannerInfoConsoleParserFactory.
getMakeBuilderOutputSniffer(ostream, null, project, context, buildDirectory, buildInfo, markerGenerator, collector); getMakeBuilderOutputSniffer(ostream, null, project, context, buildDirectory, buildInfo, markerGenerator, collector);
if (sniffer != null) { if (sniffer != null) {
ostream = (sniffer == null ? null : sniffer.getOutputStream()); ostream = sniffer.getOutputStream();
} }
if (ostream != null) { if (ostream != null) {