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

Fixes warnings.

This commit is contained in:
Markus Schorn 2007-01-19 14:24:29 +00:00
parent 9c3fe10028
commit 5f96c8b22e
12 changed files with 33 additions and 29 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2005 QNX Software Systems and others. * Copyright (c) 2000, 2007 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
@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.model; package org.eclipse.cdt.core.model;
@ -227,16 +228,19 @@ public interface ICElement extends IAdaptable {
/** /**
* Modifier indicating a class constructor * Modifier indicating a class constructor
* @deprecated use {@link IMethodDeclaration#isConstructor()}
*/ */
static final int C_CLASS_CTOR = 0x100; static final int C_CLASS_CTOR = 0x100;
/** /**
* Modifier indicating a class destructor * Modifier indicating a class destructor
* @deprecated use {@link IMethodDeclaration#isDestructor()}
*/ */
static final int C_CLASS_DTOR = 0x200; static final int C_CLASS_DTOR = 0x200;
/** /**
* Modifier indicating a static storage attribute * Modifier indicating a static storage attribute
* @deprecated use {@link IDeclaration#isStatic()}
*/ */
static final int C_STORAGE_STATIC = 0x400; static final int C_STORAGE_STATIC = 0x400;
@ -247,21 +251,24 @@ public interface ICElement extends IAdaptable {
/** /**
* Modifier indicating a private class * Modifier indicating a private class
* @deprecated use {@link IMember#getVisibility()}
*/ */
static final int CPP_PRIVATE = 0x1000; static final int CPP_PRIVATE = 0x1000;
/** /**
* Modifier indicating a public class * Modifier indicating a public class
* @deprecated use {@link IMember#getVisibility()}
*/ */
static final int CPP_PUBLIC = 0x2000; static final int CPP_PUBLIC = 0x2000;
/** /**
* Modifier indicating a protected class * Modifier indicating a protected class
* @deprecated use {@link IMember#getVisibility()}
*/ */
static final int CPP_PROTECTED = 0x4000; static final int CPP_PROTECTED = 0x4000;
/** /**
* Modifier indicating a friend class * Modifier indicating a friend class
* @deprecated use {@link IMethodDeclaration#isFriend()}
*/ */
static final int CPP_FRIEND = 0x8000; static final int CPP_FRIEND = 0x8000;

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2006 IBM Corporation and others. * Copyright (c) 2000, 2007 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
@ -942,7 +942,7 @@ private static int scanArrayTypeSignature(char[] string, int start) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
char c = string[start]; char c = string[start];
if (c != C_ARRAY) { //$NON-NLS-1$ if (c != C_ARRAY) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
return scanTypeSignature(string, start + 1); return scanTypeSignature(string, start + 1);
@ -1691,7 +1691,7 @@ private static int appendArrayTypeSignature(char[] string, int start, boolean fu
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
char c = string[start]; char c = string[start];
if (c != C_ARRAY) { //$NON-NLS-1$ if (c != C_ARRAY) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
int e = appendTypeSignature(string, start + 1, fullyQualifyTypeNames, buffer); int e = appendTypeSignature(string, start + 1, fullyQualifyTypeNames, buffer);

View file

@ -296,7 +296,7 @@ public class Binary extends Openable implements IBinary {
File file = new File(filename); File file = new File(filename);
if (file.exists()) { if (file.exists()) {
filename = file.getCanonicalPath(); filename = file.getCanonicalPath();
} else if (filename.startsWith(".")) { } else if (filename.startsWith(".")) { //$NON-NLS-1$
file = new File(obj.getPath().removeLastSegments(1).toOSString(), filename); file = new File(obj.getPath().removeLastSegments(1).toOSString(), filename);
filename = file.getCanonicalPath(); filename = file.getCanonicalPath();
} }
@ -346,7 +346,7 @@ public class Binary extends Openable implements IBinary {
} }
private void addFunction(OpenableInfo info, ISymbol symbol, Map hash) throws CModelException { private void addFunction(OpenableInfo info, ISymbol symbol, Map hash) throws CModelException {
IPath filename = filename = symbol.getFilename(); IPath filename= symbol.getFilename();
BinaryFunction function = null; BinaryFunction function = null;
if (filename != null && !filename.isEmpty()) { if (filename != null && !filename.isEmpty()) {
@ -376,7 +376,7 @@ public class Binary extends Openable implements IBinary {
} }
private void addVariable(OpenableInfo info, ISymbol symbol, Map hash) throws CModelException { private void addVariable(OpenableInfo info, ISymbol symbol, Map hash) throws CModelException {
IPath filename = filename = symbol.getFilename(); IPath filename= symbol.getFilename();
BinaryVariable variable = null; BinaryVariable variable = null;
if (filename != null && !filename.isEmpty()) { if (filename != null && !filename.isEmpty()) {
BinaryModule module = null; BinaryModule module = null;

View file

@ -83,7 +83,7 @@ public class BinaryRunner {
public void start() { public void start() {
String taskName = CCorePlugin.getResourceString("CoreModel.BinaryRunner.Binary_Search_Thread"); //$NON-NLS-1$ String taskName = CCorePlugin.getResourceString("CoreModel.BinaryRunner.Binary_Search_Thread"); //$NON-NLS-1$
taskName += " (" + cproject.getElementName() + ")"; taskName += " (" + cproject.getElementName() + ")"; //$NON-NLS-1$//$NON-NLS-2$
runner = new Job(taskName) { runner = new Job(taskName) {
/* /*

View file

@ -27,7 +27,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable; import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.SafeRunner;
/** /**
* @see IBuffer * @see IBuffer
@ -226,7 +226,7 @@ public class Buffer implements IBuffer {
if (this.changeListeners != null) { if (this.changeListeners != null) {
for (int i = 0, size = this.changeListeners.size(); i < size; ++i) { for (int i = 0, size = this.changeListeners.size(); i < size; ++i) {
final IBufferChangedListener listener = (IBufferChangedListener) this.changeListeners.get(i); final IBufferChangedListener listener = (IBufferChangedListener) this.changeListeners.get(i);
Platform.run(new ISafeRunnable() { SafeRunner.run(new ISafeRunnable() {
public void handleException(Throwable exception) { public void handleException(Throwable exception) {
Util.log(exception, "Exception occurred in listener of buffer change notification", ICLogConstants.CDT); //$NON-NLS-1$ Util.log(exception, "Exception occurred in listener of buffer change notification", ICLogConstants.CDT); //$NON-NLS-1$
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2001, 2006 IBM Corporation and others. * Copyright (c) 2001, 2007 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
@ -105,7 +105,7 @@ public class CModelBuilder {
{ {
IProject currentProject = null; IProject currentProject = null;
boolean hasCppNature = true; boolean hasCppNature = true;
char[] code = EMPTY_CHAR_ARRAY; //$NON-NLS-1$ char[] code = EMPTY_CHAR_ARRAY;
// get the current project // get the current project
if (translationUnit != null && translationUnit.getCProject() != null) { if (translationUnit != null && translationUnit.getCProject() != null) {
@ -209,7 +209,7 @@ public class CModelBuilder {
} }
Util.debugLog("CModelBuilder: parsing " //$NON-NLS-1$ Util.debugLog("CModelBuilder: parsing " //$NON-NLS-1$
+ translationUnit.getElementName() + translationUnit.getElementName()
+ " mode="+ (quickParseMode ? "quick " : "structural ") //$NON-NLS-1$ //$NON-NLS-2$ + " mode="+ (quickParseMode ? "quick " : "structural ") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ " time="+ ( System.currentTimeMillis() - startTime ) + "ms", //$NON-NLS-1$ //$NON-NLS-2$ + " time="+ ( System.currentTimeMillis() - startTime ) + "ms", //$NON-NLS-1$ //$NON-NLS-2$
IDebugLogConstants.MODEL, false); IDebugLogConstants.MODEL, false);

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006 Wind River Systems, Inc. and others. * Copyright (c) 2006, 2007 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
@ -248,7 +248,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
final IASTTranslationUnit ast= fTranslationUnit.getAST(index, ITranslationUnit.AST_SKIP_ALL_HEADERS); final IASTTranslationUnit ast= fTranslationUnit.getAST(index, ITranslationUnit.AST_SKIP_ALL_HEADERS);
Util.debugLog("CModelBuilder2: parsing " //$NON-NLS-1$ Util.debugLog("CModelBuilder2: parsing " //$NON-NLS-1$
+ fTranslationUnit.getElementName() + fTranslationUnit.getElementName()
+ " mode="+ (quickParseMode ? "fast " : "full ") //$NON-NLS-1$ //$NON-NLS-2$ + " mode="+ (quickParseMode ? "fast " : "full ") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ " time="+ ( System.currentTimeMillis() - startTime ) + "ms", //$NON-NLS-1$ //$NON-NLS-2$ + " time="+ ( System.currentTimeMillis() - startTime ) + "ms", //$NON-NLS-1$ //$NON-NLS-2$
IDebugLogConstants.MODEL, false); IDebugLogConstants.MODEL, false);
@ -781,7 +781,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
} }
final IASTName astClassName= compositeTypeSpecifier.getName(); final IASTName astClassName= compositeTypeSpecifier.getName();
final String className= ASTStringUtil.getSimpleName(astClassName);; final String className= ASTStringUtil.getSimpleName(astClassName);
final Structure element; final Structure element;
if (!isTemplate) { if (!isTemplate) {

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006 Intel Corporation and others. * Copyright (c) 2006, 2007 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
@ -117,6 +117,6 @@ public class CShiftData implements ICElementDelta {
} }
public String toString() { public String toString() {
return ("CShiftData: offset=" + offset + ", size=" + size + ", lines=" + lines); return ("CShiftData: offset=" + offset + ", size=" + size + ", lines=" + lines); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
} }
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2005 QNX Software Systems and others. * Copyright (c) 2000, 2007 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
@ -77,7 +77,7 @@ public class CreateNamespaceOperation extends CreateElementInTUOperation {
sb.append("namespace "); //$NON-NLS-1$; sb.append("namespace "); //$NON-NLS-1$;
sb.append(fNamespace).append(' ').append('{'); sb.append(fNamespace).append(' ').append('{');
sb.append(Util.LINE_SEPARATOR); sb.append(Util.LINE_SEPARATOR);
sb.append('}'); //$NON-NLS-1$; sb.append('}'); //;
sb.append(Util.LINE_SEPARATOR); sb.append(Util.LINE_SEPARATOR);
return sb.toString(); return sb.toString();
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005 QnX Software Systems and others. * Copyright (c) 2005, 2007 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
@ -87,7 +87,6 @@ public class PathEntryContainerUpdatesOperation extends CModelOperation {
if (list.size() > 0) { if (list.size() > 0) {
final ICElementDelta[] deltas = new ICElementDelta[list.size()]; final ICElementDelta[] deltas = new ICElementDelta[list.size()];
list.toArray(deltas); list.toArray(deltas);
CModelManager manager = CModelManager.getDefault();
for (int i = 0; i < deltas.length; i++) { for (int i = 0; i < deltas.length; i++) {
addDelta(deltas[i]); addDelta(deltas[i]);
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2006 QNX Software Systems and others. * Copyright (c) 2000, 2007 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
@ -409,7 +409,7 @@ public class PathEntryUtil {
} else { } else {
StringBuffer errMesg = new StringBuffer( StringBuffer errMesg = new StringBuffer(
CCorePlugin.getResourceString("CoreModel.PathEntry.NestedEntry")); //$NON-NLS-1$ CCorePlugin.getResourceString("CoreModel.PathEntry.NestedEntry")); //$NON-NLS-1$
return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, errMesg.toString()); //$NON-NLS-1$ return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, errMesg.toString());
} }
} }
} }
@ -439,7 +439,7 @@ public class PathEntryUtil {
IPath includePath = include.getFullIncludePath(); IPath includePath = include.getFullIncludePath();
if (!isValidExternalPath(includePath)) { if (!isValidExternalPath(includePath)) {
return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY,
CoreModelMessages.getFormattedString("PathEntryManager.2", includePath.toOSString())); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ CoreModelMessages.getFormattedString("PathEntryManager.2", includePath.toOSString())); //$NON-NLS-1$
} }
if (!isValidBasePath(include.getBasePath())) { if (!isValidBasePath(include.getBasePath())) {
return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY,

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005 QnX Software Systems and others. * Copyright (c) 2005, 2007 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
@ -94,8 +94,6 @@ public class SetPathEntryContainerOperation extends CModelOperation {
} }
// trigger model refresh // trigger model refresh
CModelManager mgr = CModelManager.getDefault();
for (int i = 0; i < projectLength; i++) { for (int i = 0; i < projectLength; i++) {
if (isCanceled()) { if (isCanceled()) {
return; return;