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

Boost the warning of the compiler and fix the unnecessary

casting
This commit is contained in:
Alain Magloire 2004-03-22 21:32:51 +00:00
parent ef50454dbd
commit 05195a0a7d
13 changed files with 21 additions and 14 deletions

View file

@ -1,3 +1,10 @@
2004-03-22 Alain Magloire
Boost the warning of the compiler and remove
Unneeded castings.
* to many to enumerates.
2004-03-22 Alain Magloire 2004-03-22 Alain Magloire
* model/org/eclipse/cdt/core/model/CoreModel.java * model/org/eclipse/cdt/core/model/CoreModel.java

View file

@ -352,7 +352,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
} else { } else {
Openable openableParent = (Openable)getOpenableParent(); Openable openableParent = (Openable)getOpenableParent();
if (openableParent != null) { if (openableParent != null) {
CElementInfo openableParentInfo = (CElementInfo) CModelManager.getDefault().getInfo((ICElement) openableParent); CElementInfo openableParentInfo = (CElementInfo) CModelManager.getDefault().getInfo(openableParent);
if (openableParentInfo == null) { if (openableParentInfo == null) {
openableParent.openWhenClosed(null); openableParent.openWhenClosed(null);
} }

View file

@ -398,7 +398,7 @@ public class CElementDelta implements ICElementDelta {
if (equalsAndSameParent(delta.getElement(), element)) { // handle case of two jars that can be equals but not in the same project if (equalsAndSameParent(delta.getElement(), element)) { // handle case of two jars that can be equals but not in the same project
return delta; return delta;
} else { } else {
delta = ((CElementDelta)delta).getDeltaFor(element); delta = delta.getDeltaFor(element);
if (delta != null) if (delta != null)
return delta; return delta;
} }

View file

@ -44,7 +44,7 @@ public class CModelStatus extends Status implements ICModelStatus, ICModelStatus
/** /**
* Singleton OK object * Singleton OK object
*/ */
public static final ICModelStatus VERIFIED_OK = new CModelStatus(OK, OK, org.eclipse.cdt.internal.core.Util.bind("status.OK"));; //$NON-NLS-1$ public static final ICModelStatus VERIFIED_OK = new CModelStatus(OK, OK, org.eclipse.cdt.internal.core.Util.bind("status.OK")); //$NON-NLS-1$
/** /**
* Constructs an C model status with no corresponding elements. * Constructs an C model status with no corresponding elements.

View file

@ -62,7 +62,7 @@ public class CommitWorkingCopyOperation extends CModelOperation {
try { try {
beginTask("workingCopy.commit", 2); //$NON-NLS-1$ beginTask("workingCopy.commit", 2); //$NON-NLS-1$
WorkingCopy copy = (WorkingCopy)getElementToProcess(); WorkingCopy copy = (WorkingCopy)getElementToProcess();
ITranslationUnit original = (ITranslationUnit) copy.getOriginalElement(); ITranslationUnit original = copy.getOriginalElement();
// creates the delta builder (this remembers the content of the cu) // creates the delta builder (this remembers the content of the cu)
@ -127,7 +127,7 @@ public class CommitWorkingCopyOperation extends CModelOperation {
return new CModelStatus(ICModelStatusConstants.INVALID_ELEMENT_TYPES, wc); return new CModelStatus(ICModelStatusConstants.INVALID_ELEMENT_TYPES, wc);
} }
ITranslationUnit original= (ITranslationUnit)wc.getOriginalElement(); ITranslationUnit original= wc.getOriginalElement();
IResource resource = original.getResource(); IResource resource = original.getResource();
if (!wc.isBasedOn(resource) && !fForce) { if (!wc.isBasedOn(resource) && !fForce) {
return new CModelStatus(ICModelStatusConstants.UPDATE_CONFLICT); return new CModelStatus(ICModelStatusConstants.UPDATE_CONFLICT);

View file

@ -62,7 +62,7 @@ public abstract class CreateElementInTUOperation extends CModelOperation {
/** /**
* The element that is being created. * The element that is being created.
*/ */
protected ISourceReference fCreatedElement = null;; protected ISourceReference fCreatedElement = null;
/** /**
* The element that the newly created element is * The element that the newly created element is

View file

@ -320,7 +320,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////
if (isWorkingCopy()) { if (isWorkingCopy()) {
ITranslationUnit original = (ITranslationUnit) ((IWorkingCopy)this).getOriginalElement(); ITranslationUnit original = ((IWorkingCopy)this).getOriginalElement();
// might be IResource.NULL_STAMP if original does not exist // might be IResource.NULL_STAMP if original does not exist
IResource r = original.getResource(); IResource r = original.getResource();
if (r != null && r instanceof IFile) { if (r != null && r instanceof IFile) {

View file

@ -70,7 +70,7 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
*/ */
public void commit(boolean force, IProgressMonitor monitor) public void commit(boolean force, IProgressMonitor monitor)
throws CModelException { throws CModelException {
ITranslationUnit original = (ITranslationUnit)this.getOriginalElement(); ITranslationUnit original = this.getOriginalElement();
if (original.exists()) { if (original.exists()) {
CommitWorkingCopyOperation op= new CommitWorkingCopyOperation(this, force); CommitWorkingCopyOperation op= new CommitWorkingCopyOperation(this, force);
runOperation(op, monitor); runOperation(op, monitor);
@ -248,7 +248,7 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
// set the buffer source if needed // set the buffer source if needed
if (buffer.getCharacters() == null){ if (buffer.getCharacters() == null){
ITranslationUnit original= (ITranslationUnit)this.getOriginalElement(); ITranslationUnit original= this.getOriginalElement();
IBuffer originalBuffer = null; IBuffer originalBuffer = null;
try { try {
originalBuffer = original.getBuffer(); originalBuffer = original.getBuffer();

View file

@ -253,7 +253,7 @@ public class ErrorParserManager extends OutputStream {
path = fp; path = fp;
} }
} else { } else {
path = (IPath) getWorkingDirectory().append(filePath); path = getWorkingDirectory().append(filePath);
} }
IFile file = null; IFile file = null;

View file

@ -38,7 +38,7 @@ public class ProcessClosure {
fOutputStream= out; fOutputStream= out;
fInputStream= in; fInputStream= in;
setDaemon(true); setDaemon(true);
lineSeparator = (String) System.getProperty("line.separator"); //$NON-NLS-1$ lineSeparator = System.getProperty("line.separator"); //$NON-NLS-1$
} }
public void run() { public void run() {

View file

@ -106,7 +106,7 @@ public class Symbol implements ISymbol, Comparable {
} else if (obj instanceof Long) { } else if (obj instanceof Long) {
Long val = (Long) obj; Long val = (Long) obj;
anotherVal = val.longValue(); anotherVal = val.longValue();
thisVal = (long) this.addr; thisVal = this.addr;
} }
return (thisVal < anotherVal ? -1 : (thisVal == anotherVal ? 0 : 1)); return (thisVal < anotherVal ? -1 : (thisVal == anotherVal ? 0 : 1));
} }

View file

@ -232,7 +232,7 @@ public class PE {
buffer.append("StackCommit = ").append(SizeOfStackCommit).append(NL); //$NON-NLS-1$ buffer.append("StackCommit = ").append(SizeOfStackCommit).append(NL); //$NON-NLS-1$
buffer.append("HeapReserve = ").append(SizeOfHeapReserve).append(NL); //$NON-NLS-1$ buffer.append("HeapReserve = ").append(SizeOfHeapReserve).append(NL); //$NON-NLS-1$
buffer.append("HeapCommit = ").append(SizeOfHeapCommit).append(NL); //$NON-NLS-1$ buffer.append("HeapCommit = ").append(SizeOfHeapCommit).append(NL); //$NON-NLS-1$
buffer.append("LoaderFlags = ").append(LoaderFlags).append(NL);; //$NON-NLS-1$ buffer.append("LoaderFlags = ").append(LoaderFlags).append(NL); //$NON-NLS-1$
buffer.append("#Rva size = ").append(NumberOfRvaAndSizes).append(NL); //$NON-NLS-1$ buffer.append("#Rva size = ").append(NumberOfRvaAndSizes).append(NL); //$NON-NLS-1$
return buffer.toString(); return buffer.toString();
} }

View file

@ -35,7 +35,7 @@ public class DebugSym implements Comparable {
} else if (obj instanceof Long) { } else if (obj instanceof Long) {
Long val = (Long) obj; Long val = (Long) obj;
anotherVal = val.longValue(); anotherVal = val.longValue();
thisVal = (long) this.addr; thisVal = this.addr;
} }
return (thisVal < anotherVal ? -1 : (thisVal == anotherVal ? 0 : 1)); return (thisVal < anotherVal ? -1 : (thisVal == anotherVal ? 0 : 1));
} }