mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 11:55:40 +02:00
Compiler warnings.
This commit is contained in:
parent
67ae4bb5a0
commit
3ef0d867cc
6 changed files with 9 additions and 12 deletions
|
@ -393,13 +393,11 @@ public class PathEntryUtil {
|
|||
if (otherPath.isPrefixOf(entryPath) && !otherPath.equals(entryPath)
|
||||
&& !CoreModelUtil.isExcluded(entryPath.append("*"), exclusionPatterns)) { //$NON-NLS-1$
|
||||
|
||||
String exclusionPattern = entryPath.removeFirstSegments(otherPath.segmentCount()).segment(0);
|
||||
if (CoreModelUtil.isExcluded(entryPath, exclusionPatterns)) {
|
||||
StringBuffer errMesg = new StringBuffer(
|
||||
CCorePlugin.getResourceString("CoreModel.PathEntry.NestedEntry")); //$NON-NLS-1$
|
||||
return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, errMesg.toString());
|
||||
} else if (otherKind == IPathEntry.CDT_SOURCE) {
|
||||
exclusionPattern += '/';
|
||||
StringBuffer errMesg = new StringBuffer(
|
||||
CCorePlugin.getResourceString("CoreModel.PathEntry.NestedEntry")); //$NON-NLS-1$
|
||||
return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, errMesg.toString());
|
||||
|
|
|
@ -267,14 +267,14 @@ public class CIndex implements IIndex {
|
|||
for (IIndexInclude include : includedBy) {
|
||||
if (handled.add(include.getIncludedByLocation())) {
|
||||
out.add(include);
|
||||
if (depth != 0) {
|
||||
if (nextLevel != null) {
|
||||
nextLevel.add(include.getIncludedBy());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (depth == 0 || nextLevel.isEmpty()) {
|
||||
if (nextLevel == null || nextLevel.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (depth > 0) {
|
||||
|
@ -304,7 +304,7 @@ public class CIndex implements IIndex {
|
|||
Object key= target != null ? (Object) target : include.getFullName();
|
||||
if (handled.add(key)) {
|
||||
out.add(include);
|
||||
if (depth != 0) {
|
||||
if (nextLevel != null) {
|
||||
IIndexFile includedByFile= resolveInclude(include);
|
||||
if (includedByFile != null) {
|
||||
nextLevel.add(includedByFile);
|
||||
|
@ -313,7 +313,7 @@ public class CIndex implements IIndex {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (depth == 0 || nextLevel.isEmpty()) {
|
||||
if (nextLevel == null || nextLevel.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (depth > 0) {
|
||||
|
|
|
@ -436,7 +436,7 @@ public class CdtMacroSupplier extends CoreMacroSupplierBase {
|
|||
macro = new CdtVariable(macroName,ICdtVariable.VALUE_TEXT,version);
|
||||
}
|
||||
else if("CDTVersion".equals(macroName)){ //$NON-NLS-1$
|
||||
String version = (String)CCorePlugin.getDefault().getBundle().getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
|
||||
String version = CCorePlugin.getDefault().getBundle().getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
|
||||
macro = new CdtVariable(macroName,ICdtVariable.VALUE_TEXT,version);
|
||||
}
|
||||
/* else if("MBSVersion".equals(macroName)){ //$NON-NLS-1$
|
||||
|
|
|
@ -128,7 +128,6 @@ public final class ToggleCommentAction extends TextEditorAction {
|
|||
ITypedRegion[] regions= TextUtilities.computePartitioning(document, fDocumentPartitioning,
|
||||
block.getOffset(), block.getLength(), false);
|
||||
|
||||
int lineCount= 0;
|
||||
int[] lines= new int[regions.length * 2]; // [startline, endline, startline, endline, ...]
|
||||
|
||||
// For each partition in the text selection, figure out the startline and endline.
|
||||
|
@ -147,8 +146,8 @@ public final class ToggleCommentAction extends TextEditorAction {
|
|||
// otherwise, get the line number of the endline and store it in the array.
|
||||
lines[j + 1]= (lines[j] == -1 ? -1 : document.getLineOfOffset(offset));
|
||||
|
||||
// Count the number of lines that are selected in this region
|
||||
lineCount += lines[j + 1] - lines[j] + 1;
|
||||
// We could count the number of lines that are selected in this region
|
||||
// lineCount += lines[j + 1] - lines[j] + 1;
|
||||
|
||||
assert i < regions.length;
|
||||
assert j < regions.length * 2;
|
||||
|
|
|
@ -331,7 +331,7 @@ public final class CompletionProposalComputerRegistry {
|
|||
final String avoidHint;
|
||||
final String culpritName= culprit == null ? null : culprit.getName();
|
||||
if (affectedPlugins.isEmpty()) {
|
||||
if (culpritName.equals(CUIPlugin.PLUGIN_ID)) {
|
||||
if (CUIPlugin.PLUGIN_ID.equals(culpritName)) {
|
||||
// don't warn about internal computers
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ public class UIStringListWidget extends InputUIElement {
|
|||
if (items != null) {
|
||||
items = items.trim();
|
||||
StringTokenizer st = new StringTokenizer(items, "|"); //$NON-NLS-1$
|
||||
for (int i = 0; st.hasMoreTokens(); i++) {
|
||||
while (st.hasMoreTokens()) {
|
||||
itemsList.add(st.nextToken());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue