mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 01:35:39 +02:00
Fix warnings
This commit is contained in:
parent
52034c884a
commit
80c167206d
4 changed files with 24 additions and 31 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Intel Corporation and others.
|
* Copyright (c) 2007, 2008 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
|
||||||
|
@ -330,7 +330,7 @@ public class CDataUtil {
|
||||||
} else {
|
} else {
|
||||||
exts = data.getSourceExtensions();
|
exts = data.getSourceExtensions();
|
||||||
if(exts != null && exts.length != 0)
|
if(exts != null && exts.length != 0)
|
||||||
exts = (String[])exts.clone();
|
exts = exts.clone();
|
||||||
else
|
else
|
||||||
exts = CDefaultLanguageData.EMPTY_STRING_ARRAY;
|
exts = CDefaultLanguageData.EMPTY_STRING_ARRAY;
|
||||||
}
|
}
|
||||||
|
@ -516,7 +516,7 @@ public class CDataUtil {
|
||||||
}
|
}
|
||||||
CLanguageData lDatas[] = data.getLanguageDatas();
|
CLanguageData lDatas[] = data.getLanguageDatas();
|
||||||
for(int i = 0; i < lDatas.length; i++){
|
for(int i = 0; i < lDatas.length; i++){
|
||||||
CLanguageData lData = (CLanguageData)lDatas[i];
|
CLanguageData lData = lDatas[i];
|
||||||
String langId = lData.getLanguageId();
|
String langId = lData.getLanguageId();
|
||||||
if(langId != null){
|
if(langId != null){
|
||||||
ILanguageDescriptor des = (ILanguageDescriptor)langMap.remove(langId);
|
ILanguageDescriptor des = (ILanguageDescriptor)langMap.remove(langId);
|
||||||
|
@ -732,9 +732,10 @@ public class CDataUtil {
|
||||||
for(int i = 0; i < entries.size(); i++){
|
for(int i = 0; i < entries.size(); i++){
|
||||||
ICSourceEntry entry = (ICSourceEntry)entries.get(i);
|
ICSourceEntry entry = (ICSourceEntry)entries.get(i);
|
||||||
entry = include(path, entry);
|
entry = include(path, entry);
|
||||||
if(entry != null)
|
if(entry != null) {
|
||||||
entries.set(i, entry);
|
entries.set(i, entry);
|
||||||
return i;
|
return i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1590,11 +1590,8 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
formatOpeningBrace(preferences.brace_position_for_type_declaration, preferences.insert_space_before_opening_brace_in_type_declaration);
|
formatOpeningBrace(preferences.brace_position_for_type_declaration, preferences.insert_space_before_opening_brace_in_type_declaration);
|
||||||
final int braceIndent= scribe.numberOfIndentations;
|
final int braceIndent= scribe.numberOfIndentations;
|
||||||
|
|
||||||
if (true /* preferences.insert_new_line_after_opening_brace_in_enumerator_list */) {
|
scribe.startNewLine();
|
||||||
scribe.startNewLine();
|
|
||||||
} else if (true /* preferences.insert_space_after_opening_brace_in_enumerator_list */) {
|
|
||||||
scribe.space();
|
|
||||||
}
|
|
||||||
if (braceIndent == headerIndent) {
|
if (braceIndent == headerIndent) {
|
||||||
scribe.indent();
|
scribe.indent();
|
||||||
}
|
}
|
||||||
|
@ -1618,11 +1615,8 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
if (enumIndent > braceIndent) {
|
if (enumIndent > braceIndent) {
|
||||||
scribe.unIndent();
|
scribe.unIndent();
|
||||||
}
|
}
|
||||||
if (true /* preferences.insert_new_line_before_closing_brace_in_enumerator_list */) {
|
scribe.startNewLine();
|
||||||
scribe.startNewLine();
|
|
||||||
} else if (true /* preferences.insert_space_before_closing_brace_in_enumerator_list */) {
|
|
||||||
scribe.space();
|
|
||||||
}
|
|
||||||
formatClosingBrace(preferences.brace_position_for_type_declaration);
|
formatClosingBrace(preferences.brace_position_for_type_declaration);
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
@ -1758,9 +1752,9 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
|
||||||
}
|
}
|
||||||
} else if (node.isCatchAll()) {
|
} else if (node.isCatchAll()) {
|
||||||
scribe.printNextToken(Token.tELIPSE, false /* preferences.insert_space_before_ellipsis */);
|
scribe.printNextToken(Token.tELIPSE, false /* preferences.insert_space_before_ellipsis */);
|
||||||
if (false /* preferences.insert_space_after_ellipsis */) {
|
// if (false /* preferences.insert_space_after_ellipsis */) {
|
||||||
scribe.space();
|
// scribe.space();
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
scribe.printNextToken(Token.tRPAREN, preferences.insert_space_before_closing_paren_in_catch);
|
scribe.printNextToken(Token.tRPAREN, preferences.insert_space_before_closing_paren_in_catch);
|
||||||
final IASTStatement catchBody= node.getCatchBody();
|
final IASTStatement catchBody= node.getCatchBody();
|
||||||
|
|
|
@ -260,17 +260,15 @@ public final class CIndenter {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean prefParenthesisDeepIndent() {
|
private boolean prefParenthesisDeepIndent() {
|
||||||
if (true) // don't do parenthesis deep indentation
|
// don't do parenthesis deep indentation
|
||||||
return false;
|
// String option= getCoreFormatterOption(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION);
|
||||||
|
// try {
|
||||||
|
// return DefaultCodeFormatterConstants.getIndentStyle(option) == DefaultCodeFormatterConstants.INDENT_ON_COLUMN;
|
||||||
|
// } catch (IllegalArgumentException e) {
|
||||||
|
// // ignore and return default
|
||||||
|
// }
|
||||||
|
|
||||||
String option= getCoreFormatterOption(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION);
|
return false;
|
||||||
try {
|
|
||||||
return DefaultCodeFormatterConstants.getIndentStyle(option) == DefaultCodeFormatterConstants.INDENT_ON_COLUMN;
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
// ignore and return default
|
|
||||||
}
|
|
||||||
|
|
||||||
return false; // sensible default
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int prefParenthesisIndent() {
|
private int prefParenthesisIndent() {
|
||||||
|
|
|
@ -119,9 +119,9 @@ public class TUCorrectionProposal extends ChangeCorrectionProposal {
|
||||||
* @throws CoreException can be thrown if adding the edits is failing.
|
* @throws CoreException can be thrown if adding the edits is failing.
|
||||||
*/
|
*/
|
||||||
protected void addEdits(IDocument document, TextEdit editRoot) throws CoreException {
|
protected void addEdits(IDocument document, TextEdit editRoot) throws CoreException {
|
||||||
if (false) {
|
// if (false) {
|
||||||
throw new CoreException(CUIStatus.createError(IStatus.ERROR, "Implementors can throw an exception", null)); //$NON-NLS-1$
|
// throw new CoreException(CUIStatus.createError(IStatus.ERROR, "Implementors can throw an exception", null)); //$NON-NLS-1$
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LinkedProposalModel getLinkedProposalModel() {
|
protected LinkedProposalModel getLinkedProposalModel() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue