mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 21:35: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)
|
if (otherPath.isPrefixOf(entryPath) && !otherPath.equals(entryPath)
|
||||||
&& !CoreModelUtil.isExcluded(entryPath.append("*"), exclusionPatterns)) { //$NON-NLS-1$
|
&& !CoreModelUtil.isExcluded(entryPath.append("*"), exclusionPatterns)) { //$NON-NLS-1$
|
||||||
|
|
||||||
String exclusionPattern = entryPath.removeFirstSegments(otherPath.segmentCount()).segment(0);
|
|
||||||
if (CoreModelUtil.isExcluded(entryPath, exclusionPatterns)) {
|
if (CoreModelUtil.isExcluded(entryPath, exclusionPatterns)) {
|
||||||
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());
|
return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, errMesg.toString());
|
||||||
} else if (otherKind == IPathEntry.CDT_SOURCE) {
|
} else if (otherKind == IPathEntry.CDT_SOURCE) {
|
||||||
exclusionPattern += '/';
|
|
||||||
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());
|
return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, errMesg.toString());
|
||||||
|
|
|
@ -267,14 +267,14 @@ public class CIndex implements IIndex {
|
||||||
for (IIndexInclude include : includedBy) {
|
for (IIndexInclude include : includedBy) {
|
||||||
if (handled.add(include.getIncludedByLocation())) {
|
if (handled.add(include.getIncludedByLocation())) {
|
||||||
out.add(include);
|
out.add(include);
|
||||||
if (depth != 0) {
|
if (nextLevel != null) {
|
||||||
nextLevel.add(include.getIncludedBy());
|
nextLevel.add(include.getIncludedBy());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (depth == 0 || nextLevel.isEmpty()) {
|
if (nextLevel == null || nextLevel.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (depth > 0) {
|
if (depth > 0) {
|
||||||
|
@ -304,7 +304,7 @@ public class CIndex implements IIndex {
|
||||||
Object key= target != null ? (Object) target : include.getFullName();
|
Object key= target != null ? (Object) target : include.getFullName();
|
||||||
if (handled.add(key)) {
|
if (handled.add(key)) {
|
||||||
out.add(include);
|
out.add(include);
|
||||||
if (depth != 0) {
|
if (nextLevel != null) {
|
||||||
IIndexFile includedByFile= resolveInclude(include);
|
IIndexFile includedByFile= resolveInclude(include);
|
||||||
if (includedByFile != null) {
|
if (includedByFile != null) {
|
||||||
nextLevel.add(includedByFile);
|
nextLevel.add(includedByFile);
|
||||||
|
@ -313,7 +313,7 @@ public class CIndex implements IIndex {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (depth == 0 || nextLevel.isEmpty()) {
|
if (nextLevel == null || nextLevel.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (depth > 0) {
|
if (depth > 0) {
|
||||||
|
|
|
@ -436,7 +436,7 @@ public class CdtMacroSupplier extends CoreMacroSupplierBase {
|
||||||
macro = new CdtVariable(macroName,ICdtVariable.VALUE_TEXT,version);
|
macro = new CdtVariable(macroName,ICdtVariable.VALUE_TEXT,version);
|
||||||
}
|
}
|
||||||
else if("CDTVersion".equals(macroName)){ //$NON-NLS-1$
|
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);
|
macro = new CdtVariable(macroName,ICdtVariable.VALUE_TEXT,version);
|
||||||
}
|
}
|
||||||
/* else if("MBSVersion".equals(macroName)){ //$NON-NLS-1$
|
/* else if("MBSVersion".equals(macroName)){ //$NON-NLS-1$
|
||||||
|
|
|
@ -128,7 +128,6 @@ public final class ToggleCommentAction extends TextEditorAction {
|
||||||
ITypedRegion[] regions= TextUtilities.computePartitioning(document, fDocumentPartitioning,
|
ITypedRegion[] regions= TextUtilities.computePartitioning(document, fDocumentPartitioning,
|
||||||
block.getOffset(), block.getLength(), false);
|
block.getOffset(), block.getLength(), false);
|
||||||
|
|
||||||
int lineCount= 0;
|
|
||||||
int[] lines= new int[regions.length * 2]; // [startline, endline, startline, endline, ...]
|
int[] lines= new int[regions.length * 2]; // [startline, endline, startline, endline, ...]
|
||||||
|
|
||||||
// For each partition in the text selection, figure out the startline and 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.
|
// otherwise, get the line number of the endline and store it in the array.
|
||||||
lines[j + 1]= (lines[j] == -1 ? -1 : document.getLineOfOffset(offset));
|
lines[j + 1]= (lines[j] == -1 ? -1 : document.getLineOfOffset(offset));
|
||||||
|
|
||||||
// Count the number of lines that are selected in this region
|
// We could count the number of lines that are selected in this region
|
||||||
lineCount += lines[j + 1] - lines[j] + 1;
|
// lineCount += lines[j + 1] - lines[j] + 1;
|
||||||
|
|
||||||
assert i < regions.length;
|
assert i < regions.length;
|
||||||
assert j < regions.length * 2;
|
assert j < regions.length * 2;
|
||||||
|
|
|
@ -331,7 +331,7 @@ public final class CompletionProposalComputerRegistry {
|
||||||
final String avoidHint;
|
final String avoidHint;
|
||||||
final String culpritName= culprit == null ? null : culprit.getName();
|
final String culpritName= culprit == null ? null : culprit.getName();
|
||||||
if (affectedPlugins.isEmpty()) {
|
if (affectedPlugins.isEmpty()) {
|
||||||
if (culpritName.equals(CUIPlugin.PLUGIN_ID)) {
|
if (CUIPlugin.PLUGIN_ID.equals(culpritName)) {
|
||||||
// don't warn about internal computers
|
// don't warn about internal computers
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class UIStringListWidget extends InputUIElement {
|
||||||
if (items != null) {
|
if (items != null) {
|
||||||
items = items.trim();
|
items = items.trim();
|
||||||
StringTokenizer st = new StringTokenizer(items, "|"); //$NON-NLS-1$
|
StringTokenizer st = new StringTokenizer(items, "|"); //$NON-NLS-1$
|
||||||
for (int i = 0; st.hasMoreTokens(); i++) {
|
while (st.hasMoreTokens()) {
|
||||||
itemsList.add(st.nextToken());
|
itemsList.add(st.nextToken());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue